关于栅格的美丽事情是它们对于可视化和数学分析非常有用。They’re simple, versatile, and the best way to represent data on a continuous, pixel-by-pixel basis.

Here are a bunch of ways you can work with this data type—and I hope the list inspires you to think of even more possibilities. You’ll see how torestructurerasters to get exactly what you need, exerting specific control over cells, bands, palettes, even the way they’re geocoded. You’ll also see many ways tointegratethem, resulting in datasets that are much more rich and illustrative. If you hang around long enough, you might even learn how to use math and expression evaluation to impress your friends.

1. Convert between data formats

This GeoTIFF has been converted from a layered DWG, creating an image of the vector that better meets structural requirements.

This GeoTIFF has been converted from a layered DWG, creating an image of the vector that better meets structural requirements.

有很多栅格格式。我不想通过猜测有多少(在那些果冻豆罐猜游戏中一直可怕)来尴尬,但我可以告诉你FME works with more than 60of them. The most popular ones in our usage statistics are GeoTIFF/TIFF and ECW.

To get数据集成的所有好处,通常是值得转换程序er raster format, or translating between raster and vector, or combining rasters with point clouds, databases, CAD, GIS, or any other data type. In a world wheredata is liquid, it’s suicide to keep information locked in a single format.

2. Change the dimensions

This is a visual representation of a 25x25 DEM that has been downsampled to 10x10.

This is a visual representation of a 25×25 DEM that has been downsampled to 10×10.

Resample the image to your desired row/column dimensions, cell size, or percentage of the original size. Resampling is usually done to generate a smaller image, but it can also be used to make a bigger (though lower quality) one.

Unless you’re looking to make pixel art, you’ll want to get essentially the same representation of a picture (for a color image) or value distribution (for a numeric raster) when downsampling. Useful interpolation methods include nearest neighbor (fast), bicubic (best quality), bilinear (a compromise), and average 4 or 16 (good for numeric rasters like DEMs).

3. Change the coordinate system

Lat/long projections might be the most popular in our usage statistics, but different tasks require different coordinate systems.

Lat/long projections might be the most popular in our usage statistics, but different tasks require different coordinate systems.

Like any worthy, respectable spatial data format, rasters can be georeferenced and can come in a variety of coordinate systems.

If you need to project the graphics onto a map or combine it with other data, you can reproject it to another system. For example, KML requires WGS84 (LL84), while tiles in a Web Map Tile Service are likely in Spherical Mercator.

如果你真的想要具体,你甚至可以control your raster’s geocoding. For example, some rasters are embedded with Ground Control Points (GCPs) instead of having geocoding on the corners. You can extract or set the GCPs as needed.

4. Combine tiles into one image

Mosaicking means bringing multiple images together. At Safe, this is our most popular raster transformation.

Mosaicking means bringing multiple images together. At Safe, this is our most popular raster transformation.

Mosaic multiple rasters into a single feature. For example, maybe you need to bring tiles together into a simple overview in a lat/long projection. This would involve a mosaic, resample (#2), and reproject (#3) transformation.

It’s like a puzzle! One where the pieces don’t really fit together!

是。关于那个。Reproject可以略微旋转图像,然后何时摩擦,我们经常在碎片之间留下空的黑色区域。一个强迫症的噩梦。别担心。您可以通过添加“Nodata”值来修复它,因此空区域变得透明并拾取下面的背景。

This image has been compressed by 75% to make it easier to work with while not compromising the overall quality.

This image has been compressed to make it easier to work with while not reducing quality.

5. Compress raster files

Like putting your raster in Spanx, compressing it makes everything slimmer and trimmer. 75% is a pretty good ratio to use if you want a smaller image that’s quicker to process, but still good quality.

许多格式支持压缩:JPEG / JPEG2000,ECW,地理灯/ TIFF,Oracle Spatial Georaster,ArcSDE栅格,地理数据库栅格,CADRG和WEPP命名十。

6. Clip to boundaries

Clipping is essentially a combination of rasters and vectors to produce more useful output. For instance, each of these clipped pieces can be stored in a PostGIS database with its associated metadata.

Clipping is essentially a combination of rasters and vectors to produce more useful output. For instance, each of these clipped pieces can be stored in a PostGIS database with its associated metadata.

Clip an image to keep only the pieces you need, and toss away the parts outside of your defined boundary.

For example, you can merge an ECW of California with a polygon defining the coastline, and clip away the ocean (who needs that big blue wet thing anyway?). The result will be an image of just the state.

如果你剪断许多地区,像公园boundaries, you can merge the attributes from the vector features so each clipped piece retains all the properties, like the park name. As mentioned in #4, it’s handy to define the empty pieces as “nodata” so they stay transparent, making it easy to view over a background map.

查看fme.ly/parks以查看图像和元数据的样本HTML目录。

Check outfme.ly/parks查看图像和元数据的样本HTML目录。

7. Make a catalog of raster graphics and/or metadata

Consolidate graphics and their properties into a useful place, one you can share with your mom to show her all the cool stuff you do at work.

To see what I mean, check outfme.ly/parks. That’s a catalog of a bunch of clipped images and information on each piece.

The catalog reads the raster as a binary blob from a database that doesn’t support imagery, and then uses some simple HTML to make everything look nice.

This GIF has been tiled, resulting in the same output in many pieces. Note the shadows in this image have been exaggerated so the tiles can be distinguished.

This GIF has been tiled, resulting in the same output in pieces. The shadows have been exaggerated to distinguish the tiles.

8.将一个大图像分成瓷砖

Split a raster into a series of tiles. Maybe you want images in a particular size, or maybe you want a particular number. Maybe you need smaller pieces for processing. Maybe you need to load your raster in software that doesn’t support highly compressed wavelengths. Maybe you just like your data in really tiny pieces—like data confetti. I don’t blame you. Confetti is fun.

Whatever your situation, you have a giant image and you want it in smaller pieces. Tile it.

最常用的Web地图平铺方案是Google和Bing映射兼容一个。访问MSDN了解有关此平铺方案的更多信息。

The most commonly used web map tiling scheme is theGoogle and Bing Maps compatible一。

9. Create a web map tile service

Create a series of image tiles that can be utilized by web mapping applications such as Google Maps, Bing Maps, or other Web Map Tile Service.

WMT中的图像存储在瓷砖集中,因此在缩放时,您会看到不同分辨率的不同瓦片集。您可以通过恢复球形Mercator(#3),以重新采样来创建一个WMTS,以各种分辨率(#2),并拆分为瓷砖(#8)。

10. Texture a geometric surface

This 3D model is the result of a multi-step raster transformation: a JPEG draped onto a TIN surface that was generated from a DEM.

This 3D model is the result of a multi-step raster transformation: a JPEG draped onto a TIN surface that was generated from a DEM.

I feel like no raster has fulfilled its destiny until it’s been used to texture a surface. First, rasters are a 2D representation of a 3D world. Second, 3D models are often plain and textureless. Neither is as helpful as it could be. Draping a raster over a 3D model is often an enlightening integration.

Say you have an Esri Shapefile of contours, and a MrSID orthophoto. You can create a DEM by converting the contours to 3D based on elevation. When generated as a TIN and integrated with the orthophoto, you end up with a much more useful 3D model with a textured surface, like Candy Mountain over there on the right.

Draping a point cloud with RGB and DEM rastersalso results in some great surface model transformations (one of our most popular莱达processing tasks).

11. Attach an image as an attribute of a feature

Esri ArcGIS supports the ability to add attachments in a Geodatabase feature class.

Esri ArcGIS supports the ability to add attachments in aGeodatabasefeature class.

A lot of formats, likeGeodatabaseor Excel, allow for image attachments.

This is great news for interoperability, because you can make a raster out of anything. Photos, scans, statistical data, charts, illustrations, satellite imagery … One time I demoed an enterprise raster reader/writer using a picture of a pony.

Anything that can go in a raster can also go in a format that supports image attachments.

This 32-bit RGBA PNG has been transformed to have an alpha band so it can represent transparency. This type of “feathering” can be useful when mosaicking.

This 32-bit RGBA PNG has been transformed to have an alpha band so it can represent transparency. This type of “feathering” can be useful when mosaicking.

12. Restructure the bands

Ok, now we’re getting into some more powerful stuff. (Puts on sunglasses.)

If you have multi-band data and you need to convert to a format that doesn’t support it—for example, if you have an intense 8-band format but all you want is an RGB overview—you can remove bands you don’t need.

You can also recode or add bands, for instance to recode from RGB into RGB with transparency, or to remove the alpha band so you end up with plain RGB.

In this example, the user has generated a set of vector polygons based on values in a DEM.

In this example, the user has generated a set of vector polygons based on values in a DEM.

13.根据值矢量化光栅

One way to convert raster to vector is to create a polygon for each contiguous area of pixels with the same value. We call this classifying a raster.

In the vector image on the right, polygons were generated by rounding off the nearest 25 meters in the elevation model before classifying. NURBS were then made from the polygons, resulting in a vectorized contour map.

Either that, or someone put a rainbow in a blender. I’m not sure.

此加拿大数字海拔数据已被山丘阴影,然后覆盖背景图。

此加拿大数字海拔数据已被山丘阴影,然后覆盖背景图。

14.用山丘遮荫制作位图逼真

如果您使用高程数据,您可能熟悉普通,黑白图形,高海拔是白色,低海拔是黑色的。对不起,甚至3D眼镜也不能让那东西看起来3D。相信我,我试过。

Hill shading offers a real-world rendering of what the picture actually looks like. This is particularly useful for visualizing terrain when putting together a cartographic product.

15. Colorize point clouds

This pretty point cloud has been colorized with a raster.

This point cloud has been colorized with a raster.

Datasets are like spices, and until you blend them together you don’t experience the full burst of flavor.

Overlay a point cloud on a georeferenced raster to color the points.

Combining rasters and point clouds makes LiDAR visualization much more eye-pleasing. Check out my blog post on14 Ways to Take Charge of LiDAR Datato see many ways to integrate point clouds. Some of the most useful, beautiful outputs involve rasters.

These red polygons were overlaid based on algebra performed to identify areas of interest.

These red polygons were overlaid based on algebra performed to identify areas of interest.

16. Pixel by pixel expression evaluation

Perform calculations based on the value of one or more cells. For example, you can calculate the slope or aspect (direction of slope) for each cell, or extract the extents, or detect changes between two inputs.

You could also modify pixel values based on an algorithm. Yes, friends, if these pixels store RGB values, then this is just a fancy way of saying “make your own Valencia or X-Pro II”. Free spork to anyone who uses raster expression evaluation to make their own Instagram filter.

In this example, a GeoTIFF and PNG have been combined by copying cell values from the road image over to the background layer.

GeoTIFF和PNG已经被复制组合cell values from the road image over to the background layer.

17.通过复制单元或使用半透明层或使用半透明层栅格

Combine two rasters to see information from both layers. You can do this by taking only certain pixels from one of the images (e.g. the white and yellow roads), or by adding transparency (#12). An alpha band allows you to smoothly blend the images when overlaying them. Kind of like digital iron-on transfer paper.

要查看如何使用FME完成上述所有任务,请访问亚搏在线safe.com/瑞斯特. I recommend you watch this October 2013网络研讨会记录对于伟大的现场演示,包括结合多个数据源(包括WMS),高级转换和数学的令人印象深刻的方案。我们还有一系列巨大的文章FME社亚搏国际在线官网区to help you accomplish your raster needs.

What kind of translations and transformations do you do with raster data? What do you find the most challenging?

关于Data Data Transformation Graphics Images Integration 栅格 栅格s Spatial Data Interoperability Transformation

Tiana Warner

天籁是安全软件的高级营销专家。亚搏在线她在计算机编程和创意爱好中的背景使她成为安全软件的创造性内容的主要生产商之一。亚搏在线天纳花了她的空闲时间,写幻想小说,骑马,与她的救援小狗,乔伊探索自然。

Comments

16 Responses to “17 Ways to Be a Raster Master”

  1. Ruz says:

    Ha Ha! 14 out of 17 – I am almost there!

    当然它缺少运行插值过程,光栅计算器,查找边缘,时间失误等的东西......

    • Tiana Warner says:

      Ruz, I think 14 out of 17 makes you truly the Master of Rasters! Thanks for pointing out those extra functions. It’s interesting to read about all the advanced workflows people require for their data.

  2. Jeremy Dunn says:

    Morning All,

    Does anyone have an example of normalizing raster imagery with FME. It’s some simple band math but I was wondering if someone had already done this in FME.

    Regards.

    Jeremy.

  3. Dave Campanas says:

    Hi Jeremy,

    I am assuming that by normalizing, you mean stretching the pixel values to fit the band range. You can do this with a few transformers:

    1.您可以使用RasterBandminMaxExtractor来提取频段中存在的值范围。

    2.使用offsetter偏移栅格的x和y将移动它,但偏移z将偏移像素值。将z偏移设置为 - (最小数据值)以将像素值移动到频带的底部。

    3. Like the Offsetter, the Scaler will scale the pixel values by the Z scale factor. Set the Z scale to (maximum possible band value / (max data value – min data value)). This will expand the data values to fill the band range.

    If you would like a workspace example using your own data, please contact our Support crew throughhttp://www.亚搏在线safe.com/support.,我们很乐意为您提供帮助。

    亲切的问候,
    Dave Campanas
    Product Specialist

  4. Teresa B. says:

    Hello,
    我正试图为边界实现NR 6“剪辑”。我有一个.tif-file,我用一个国家的.shp文件剪辑。用剪辑变压器这很简单。我正在努力的是将空碎片设置为“Nodata”并在全国各地获得透明度。目前它都填充了白色。我需要哪种其他变压器来获得透明度?我非常感谢所有的建议。

    亲切的问候,
    特蕾莎

    • Tiana Warner says:

      Hi Teresa,

      它听起来您需要在剪辑后需要一个漂流带诺多特asetter变压器,将背景值设置为nodata。

      我们的栅格网络研讨会讨论了剪裁和透明度,大约43分钟://www.baooytra.com/webinar/13-ways-to-avoid-a-raster-disaster/You can also download the workspaces from that webinar.

      如果您正在努力,请随时向我们发送工作区和来源。我们的支持团队将很乐意提供帮助。http://fmepedia.亚搏在线safe.com/knowledgesubmitcase.?

      Cheers,
      Tiana

      • Teresa B. says:

        Hi Tiana,
        thank you for your reply and the interesting links. I’ve tried it with a RasterBandNodataSetter transformer but that removed every white part from the image. That’s probably due to my original data which is a raster with a palette. I tried to work around this with a RasterPaletteRemover before and a RasterPaletteGenerator after the clipper, but the same problem persists – now with everything black. And the palette is all screwed up.
        我认为会很容易做的事情,似乎更加困难......
        Once I’ve cleared it with my supervisor, I going to send my data/workspace to your colleagues. Maybe they can figure something out.
        Regards,
        特蕾莎

  5. […] together to make photos, and those photos capture all the wonderful memories we hold most dear! Raster images can become finicky to use though if not formatted correctly for your print or web needs. In […]

  6. Paal says:

    Hello,

    I am wondering how can I find properties like the size of an image pixel width * pixel hight?
    I must find these either with a transformer or with pythonCaller,
    Any suggestions?

    Cheers.
    Paal

  7. Paal says:

    得到它,rasterpropertiesextractor。

  8. Rob Choucroun says:

    The link in part 7 is not working. The catalog of rasters. This would be very useful to me.

  9. Kristof says:

    Is in the figure in 2 DEM resampled from 25 to 10 or from 10 to 25? I believe the later.

    • Tiana Warner says:

      Thanks for your comment. The picture shows a representation of a 25×25 raster on the left, and a 10×10 raster on the right, so that’s what we mean by resampling from 25 to 10 in this case.

      Cheers,
      Tiana

  10. 哈曼 says:

    Hi,

    I like to have my nodata areas filled up by interpolation… how can that be done?

    Best,
    哈曼

Leave a Reply to匿名Cancel reply

Your email address will not be published.Required fields are marked*

Related Posts