blankblank blank


Archive for the 'coordinate conversion' Category Page 2 of 3



Reprojecting Raster Imagery II - ERDAS Viewfinder

For a long time, I thought that the free utility ERDAS Viewfinder 2.1 had slipped through the cracks after the acquisition of ERDAS by Leica Geosystems, but it recently re-surfaced for me in a Google search. And that’s great (thanks, Leica!), because while Viewfinder is an OK geographic image viewer, especially when compared to the many alternatives now available, it does have one very handy capability: the ability to re-project a raster image from one coordinate system to another, and save the new image in GeoTiff format with the new projection/datum data embedded.

Continue reading ‘Reprojecting Raster Imagery II - ERDAS Viewfinder’



Reprojecting Raster Imagery I

There’s no really complete free substitute for a good commercial program like Global Mapper or FME for reprojecting raster images from one coordinate system to another. Not only do they support virtually every projection and image format, but they also have batch conversion capabilities for converting many images in a single step. But they’re expensive, and overkill if you only have a small number of basic conversions you want to do; for those basic needs, there are some simple and free alternatives.

MicroDEM - I’ve covered the use of MicroDEM before for converting graphic files with worldfiles into GeoTiffs with both georeferencing and coordinate system data embedded. But you can also use it to convert GeoTiffs in the NAD27 datum to the program’s native WGS84 projection using essentially the same process: open the NAD27 GeoTiff, zoom it to 1:1, and then export it as a GeoTiff in WGS84 (read the original post for more info). That’s all it does, change the datum - it maintains the projection of the original (i.e. if you start with UTM or geographic, the two projections it supports, that’s what you’ll wind up with). And it converts indexed color files to RGB, making the filesize lot larger. But for the common need to convert USGS topo maps from NAD27, like those freely available from Libremap or other sources, to WGS84, it may be enough for some people.

gdalwarp - Part of the GDAL library (included in FWTools), this command-line raster re-projection utility is extremely powerful, but its command-line nature makes it less than user-friendly, and learning the proper codes and syntax for converting from one coordinate system to another isn’t my idea of fun. If you have one conversion you do on a regular basis, setting up a batch file might make that process a bit easier, but a graphical user interface would be even better. Note to command-line fans: Yes, I’m a wimp.

MapWindow - I include MapWindow because, not coincidentally, it does include a graphic interface to gdalwarp that supports many projections/datums, and which also appears to have a limited batch processing capability. Access it using the GIS Tools => Image => Reproject Images menu function (make sure GIS Tools is enabled in the Plugins menu). The image file and coordinate system selections (source and target) are straightforward. The one problem is … I haven’t been able to get it to work on my system. After going through the whole process, I keep getting an error message saying that image export through GDAL isn’t supported. But I’m guessing this will be fixed reasonably soon, and as a bonus, MapWindow also comes with a really nice shapefile coordinate system converter.

But until MapWindow is functional, I’ve found another free program that re-projects georeferenced image files from one coordinate system to another, supports a fair number of datums and projections, and supports export in indexed color format. More on that in the next post.



More Degree-Minute-Second Converter Options

A commenter on yesterday’s post asks if I know of any programs that will convert a list of coordinates in degree-minute-second format to decimal degrees. Haven’t tried it, but Zonums Software has a free Excel macro called Ectrans that will supposedly convert a spreadsheet list of coordinates in degree-minute second format to decimal degrees (and vice versa), or one set of coordinates at a time manually. It also converts spreadsheet coordinate lists from lat/long to UTM and back again. If you don’t have Excel, it might work with OpenOffice, since I hear rumors that OpenOffice may support some VBA macros.

Zonums also has online decimal-DMS converters for converting one point at a time, adding them to a text box that can be copied and pasted as a CSV spreadsheet file; points can also be plotted on a Google Maps interface. There are also online lat/long to UTM converters accessible from the same page, but they don’t appear to be working currently.

From comments in yesterday’s post, Dylan Beaudette describes how to do it using FWTools (command-line, run away! ;-):

1. convert DD -> DMS:
cs2cs +proj=latlong +datum=NAD83 +to +proj=latlong +datum=NAD83

2. convert DMS -> DD
cs2cs -f “%.6f” +proj=latlong +datum=NAD83 +to +proj=latlong +datum=NAD83

If you invoke the command as listed above (without reference to a data stream) you will get an interactive prompt. This approach is a lot more useful when you have a file full of coordinates, or a stream of coordinates:

cs2cs +proj=latlong +datum=NAD83 +to +proj=latlong +datum=NAD83 < DD_coords.txt > DMS_coords.txt

Also from the comments, for programmers, Aron Rubin posts code for a C function that will do the conversion.



Degree-Minute-Second To Decimal Degree Converter

Someday, working with latitude/longitude in degrees-minutes-seconds will be a bad memory, and everyone will use either decimal degrees or rational metric units like UTM exclusively. But until that happy day, if you need a desktop utility to easily convert from degrees-minutes-seconds to decimal degrees or degrees-minutes (and the opposite direction as well), you may find it useful to have the Degree/Minute/Second Converter handy. It’s a small download at 307 kB with a full installer, but make note of which Start Menu folder it puts the shortcuts in (default is Accessories). Operation is dead simple:

dms

Enter the degrees, minutes and seconds separated by spaces, set the number of decimal places with the Precision option, select the result type you want, then click Convert. It converts in the opposite sense directly, i.e. enter a decimal degree and have it converted to degrees-minutes or degrees-minutes-seconds. In this latter mode, checking Min/Sec Blank Fill removes the zero from the front of single digit minutes and seconds (e.g. 1 instead of 01 minute, 4.2 instead of 04.2 seconds). Can’t quite figure out what Degree Zero Fill does, though ….



MGRS/UTM/Latitude-Longitude Converter

For converting to and from the Military Grid Reference System (MGRS) and UTM/LatLong, the MGRS Conversion Utility is a small utility (365kB download) which does only that. During installation, everything stops for a long while, but it’s not a crash - it will eventually complete the installation process. Once installed and run, just enter one of three kinds of coordinates, UTM, latitude/longitude, or MGRS, click Enter next to the entered coordinates, and they will be converted to the other two coordinate systems:

mgrs

You can choose from 61 different datums in the “Ellipsoid” section at top. Latitude/longitude can be entered in decimal degrees, or as degree-minute-second with each set of numbers separated by a space. Set the MGRS precision with the up/down arrows; check “Use Bessel Code” for those areas where it’s appropriate for MGRS (mainly Europe - see the help file for more info).

And if you’re interested in displaying MGRS coordinate data in Google Earth, the Nearby.org.uk website has a link that plots MGRS gridlines in Google Earth, with a central marker that displays the 1-meter MGRS reference.

Addendum: See this post for a roundup of MGRS utilities.



Natural Area Coding Tool For Google Earth

Ogle Earth posts on NAC Earth, a Google-Earth addon that lets you navigate to a Natural Area Coding (NAC) location. Never heard of NAC? Neither had I until this post. It’s apparently a proprietary universal address system that can assign a sequence of up to 8 letters and digits to any geographic location or landmark; Stefan at Ogle Earth describes it as the geographic equivalent of tinyurl. He also doesn’t see much need for it, and truthfully neither do I - if you want to describe a location by a semi-cryptic series of letters and numbers, you can always use MGRS. Given that the system has been around now for five years without picking up any traction, I’m guessing others feel the same way.

Need to convert a set of geographic coordinates to an NAC code? Try Barry Hunter’s online coordinate converter. The NACGeo site also has some free online services for looking up and plotting NAC locations.



Handy Online Lookup Of EPSG Coordinate System Codes

The European Petroleum Survey Group (EPSG; now defunct, and superseded by the OGP Surveying and Positioning Committee) created and maintains a spatial reference database, assigning EPSG code numbers to spatial reference systems (combinations of coordinate systems, projections, and datums). There really is no way to figure out the spatial reference system from just the code number alone, or vice versa, so you need to look them up. The official database is in Microsoft Access format, not terribly easy to use; the code list in tabular format isn’t much better. There’s now a convenient online version of the database, searchable by keywords or code number. You can then access additional information for that spatial reference system in a number of different formats:

  • Human-Readable OGC WKT
  • Proj4
  • OGC WKT
  • JSON
  • GML
  • ESRI WKT
  • USGS
  • MapServer Mapfile
  • PostGIS spatial_ref_sys INSERT statement

Users can also upload their own spatial reference definitions, which I suppose is a good thing as long as you exercise caution in using them.

Via import cartography.



Fast Lookup Of The State Plane Coordinate System ID For Any US County

The State Plane Coordinate System (SPCS) is a projected coordinate system that achieves greater accuracy than UTM by dividing states up into sub-zones based on county, and then uses a local projection in that sub-zone (typically Transverse Mercator for zones that are oriented more north-south, and Lambert Conformal Conic for those that run more east-west). Keeping track of which county goes with which zone for every state can be a pain. The State Plane Zone Locator is a free utility that makes looking up the state plane system for any county easy. Download the utility from this site (look for the “Download It!” link), and install it. Oddly enough, the install doesn’t put any shortcuts into the Start Menu or on the Desktop, but the default install directory for the program is “C:\Program Files\MentorSoftwareCO\CountyLookup\”, and the executable is “CountyLookup.exe”‘. Run the program, and use the drop-down selections to choose the state and county you’re interested in:

The State Plane system ID info (NAD83 only) will show up at the bottom, in this example AZ83-C (AZ Central, NAD83). You also get the state and county Federal Information Processing Standards (FIPS) codes.