Converting from Albers to GPS coordinates - geolocation

I have some coordinate data and the only thing i know about its coordinate system is the
following description:
PROJCS["Basic Albers NAD83",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137.0,298.257222101]
],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]
],
PROJECTION["Albers"],
PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-96.0],
PARAMETER["Standard_Parallel_1",45.5],
PARAMETER["Standard_Parallel_2",29.5],
PARAMETER["Latitude_Of_Origin",23.0],
UNIT["Foot_US",0.3048006096012192]
]
this comes from a prj arcGis file.
I need to convert from this system to GPS (Google maps) system and vice-versa.
this must be done programatically and i cannot use esri libraries (license issues)...
Could you explain the meaning of all these parameters?
are the coordinates expressed in the spheroid and the projection (albers) used only when drawing
the map? or the coordinates depend on the projection used also?
Do you know an open source library I could use for this transformation?
Thanks!

All these parameters define the projection, including:
Projection type (Albers)
GEOGCS defines the geoid (idealized Earth shape) used by the project. In this case, it's NAD83, which uses degrees for units and is centered at the Greenwich, the 0th longitude.
Where the projection itself is centered
How far the projection is moved north and east to make any negative coordinates
positive (False Easting and False Northing)
Units for coordinates in this projection (US Feet)
Some other information about how coordinates of the projection were transformed to be drawn on a flat service.
I have a blog post which goes over the details for an OGC WKT definition, which is very similar to the content in an ESRI .prj file: http://www.dev-garden.org/2011/07/30/projections-for-programmers-one-projection/. You may find it useful.
With projected coordinates, they have already been 'drawn on the map', and you need to reproject them to use in other coordinate systems like Google's projection.
There are many open source tools you can use to reproject your coordinates from one projected system to another. Here are a few:
Geotools or Proj4j - Java
Proj4js - Javascript
Proj - C or C++
dotspatial - C#
One command line tool I find very useful is ogr2ogr. Using ogr2ogr, it is very easy to reproject coordinates from one system to another. Here's how to convert a projected shapefile to a Google Earth projection:
ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:3857 NEWFILE.shp OLDFILE.shp
Ogr2ogr uses the .prj file to determine the current projection of the shapefile, and then reprojects it to Googles projection, defined here by the EPSG shorthand EPSG:3857. You can find ogr2ogr for Windows and other platforms at http://fwtools.maptools.org/

Related

LAS reprojection not mapping properly in Cesium

I have a small section of point cloud on MGA55 projection.
I converted it to a new las file on EPSG 7855 using las2las from the LASTools suite.
I then uploaded the 2 files to Cesium and I am seeing a difference or around 1.8m cloud to cloud.
I have interrogated the 2 files in CloudCompare to see that the file contents has not changed. They do not, they overlay perfectly.
The only thing about the 2 las files that I can see that is different is that the projection information in the las header and the variable length records has changed after the conversion, which I would assume is entirely to be expected.
I cannot figure out why this reprojection is not mapping perfectly, any ideas?
I guess the difference comes from
the conversion from MGA55 to ECCF and the conversion from EPSG 7855 to ECCF.
I have found the issue, I believe the tool set I am using is reprojecting to an old datum:
"The Geocentric Datum of Australia 2020 (GDA2020) is Australia’s new national datum which replaces GDA94. GDA2020 is of higher-accuracy than GDA94, aligns more closely with GPS and GNSS positioning services and supports nationally consistent datasets, free of the known distortions of GDA94. GDA2020 coordinates are approximately 1.8 metres to the north east of GDA94 coordinates, which represents the tectonic motion of the Australian plate between 1994 and 2020."
My errors align with the rough bearing and distance indicated by this post.

APIs for returning a geoJSON circle shape file for a post request that contains a lat/long centerpoint

Does anyone have suggestions regarding APIs available (free and paid) for posting a lat/long and the API returning a geoJSON shape file built from the lat/long posted?
For example, if I want to a shapefile of a 50 meter circle, derived from a lat/long 42.38567/-86.26877 CenterPoint, are there APIs that can do that? I have 24,000 locations I need this for, and I would very much like not to hand draw 24K polygons on a map.
I've investigated turf.js and developer.here.com but the documentation has been pretty unclear on what endpoint to post to, to solve this problem.
Most geographical libraries have buffer method, meaning they can do it locally (you don't even need any external API).
E.g. geopandas has buffer(distance, resolution) method - distance controls the radius, and resolution tells how precise the circle has to be. You construct point, call buffer method - get circle (approximated as polygon) as output.
Or you can load these points to a database with geospatial functionality (say, PostgreSQL + PostGIS) and call ST_Buffer method to do the same.

Does Imagemagick have functions to redraw/distort images to the various map projections? ie mollweide, mercator, orthographic

I searched the Imagemagick documentation for this but could not find references to standard geographical map projections. There are other applications that do this, but not with IM's level of precision. "Matthews Map Projection software" is a good example. I wish to use IM in a script to demonstrate these projections applied to fictional world maps.
It seems such a natural thing for IM to cover. Considering all the other distortions available, maps would be right up its alley. example projections: mercator, mollweide, orthographic, gnomonic...
link to MMPS
http://www.users.globalnet.co.uk/~arcus/mmps/
IM does not have cartographic projection functions yet.
Other open source software can suffice.
Matthews Map Projection Software
http://www.users.globalnet.co.uk/~arcus/mmps/
And xplanet
http://xplanet.sourceforge.net
Have command line options that are scriptable.
Displacement maps, the -fx function, and the -process function are other avenues.

British National Grid Shapefile - convert to WGS84 Lat/Lon

I have a set of ESRI shapefiles which, I'm told, have been written using the British National Grid coordinate system. I need to convert these files to WGS84 lat/lons, for onward conversion to KML files. I'm having trouble doing this as follows:
If I open each of the original files in MapInfo Professional telling it that my file has a projection which is British National Grid then I can't see any geographic objects in the file; the map window is completely empty.
If I use MapInfo Professional's Universal Translator to convert the files to a WGS84 MapInfo TAB file then, just as before, the converted file won't display any geographic objects, the MapInfo window is empty.
Can I verify the coordinate system of these files? Am I missing anything here? Should I be able to convert the shapefiles in the way I'm expecting to be able to and view them using MapInfo Professional? Will another tool do a better job for me?
Thanks.
More Info:
My shapefile has coordinates which don't seem to translate to lat/lon properly and I'm now wondering if the coordinates aren't actually British National Grid. I'm seeing coordinates such as 383702523, 399081141 which appears to be approximately lat/lon 53.488182, -2.247153. Have you any idea what projection system my input file is in?
OS grid doesn't use WGS84 - it uses Airy 1936 (OSGB36) spheroid
So you need to go from OSgrid -> lat/lon then OSGB36->WGS84.
See http://www.ordnancesurvey.co.uk/oswebsite/gps/docs/convertingcoordinatesEN.pdf
To do OS grid to lat-lon see http://www.movable-type.co.uk/scripts/latlong-gridref.html
Then to go from OSGB36 -> WGS84 see http://www.movable-type.co.uk/scripts/latlong-convert-coords.html
http://gothos.info/2009/04/14/transform-projections-with-gdal-ogr/
ogr2ogr is a great tool for doing these sorts of conversions. You would run it with a command like
ogr2ogr -t_srs EPSG:4326 map_wgs84.shp map_original.shp
-t_srs is the option to transform co-ordinate systems. 4326 is the EPSG SRID for WGS84.

Is there a formula to convert from Thomas Bros Map page & grid to a latitude/longitude?

I'm working on a project that contains Thomas Brothers Map page and grid numbers. Is there a way to programatically convert from this map page to a latitude & longitude?
An Example would be for the intersection of the US101 & I405 freeways.
ThomasBrothers: 561-3G (page-grid)
Not that I know of, but I don't have a lot of experience with Thomas bros maps. Are you talking about printed version of the maps or is there a link somewhere to an online map?
If you just need a few lat/longs, then you can look up the locations that correspond to the grid and get the lats and longs manually at many websites, including http://itouchmap.com/latlong.html
If you provide a link to a Thomas bros map that you are using, I might be able to help further.
By looking at the link above, you can determine that US 101 and I-405 has a latitude of 34.16073390017978 and a longitude of -118.46952438354492.
Your best source would be the map publisher. If they choose to help, someone there can tell you exactly what you need to know. If they won't help you, it's unlikely that they've released the information to anyone else.
If that's the case, you could do some work by hand to correlate one point from the map grid to your target coordinate system. Effectively, you could reverse engineer a mapping "datum" for each page. You'd also have to know what map projection was used to render the maps, so that you can calculate the transform from the map coordinates to the geographic coordinates as you move away from your "origin". Finally, you'll need to establish the orientation of the map, since different notions of "north" exist.
It sounds like the Thomas maps use a new grid for every page, rather than bleeding the grid continuously from page to page. If that's the case, you'll have to correlate one point on each map. For example, find a spot where a map grid intersection coincides with a notable road intersection. Then you can find the coordinates of the road intersection using a map with latitude and longitude (a topographic map, TerraServer, etc.). Doing this with two points on the same vertical grid line should help you establish the north used on the map as well.
The short answer is that each of the nine regions has a grid derived from a Lambert conformal conic projection with custom parameters, so you cannot write a conversion program without the parameters.
I've also got ThomasBros. pages that I would like to convert to lat/long for lookup against Google Maps API. They also provided something called TBXY ... not sure what this is -- perhaps some notation for GPS/lat/long?
<Area>"El Cajon"</Area>
<ThomasBrothers>"1297 5E"</ThomasBrothers>
<TBXY>"6481390:1827008"</TBXY>
Thomas Brothers Maps invested a lot when developing their GIS system to create their digital mapping system. Though the first "digitally produced" map was Sacramento County-1990, the development began back in 1986. I expect that their map projection equations are a well guarded trade-secret, which Rand McNally now owns. I'd don't know those equations, but would also like to know them.
There are 9 projections covering the 48 states. If you know the equations for Los Angeles, it is valid across California & Nevada. Oregon & Washington have their own projection. Arizona, New Mexico, Colorado, and Utah share another projection.
I do know this...
As many know, the page grid is an exact 1/2 mile square, or 2640 feet by 2640 feet. The coordinate measurement unit is 1 foot.
To determine the Thomas Brothers XY Coordinate, get one or more of the Thomas Guide CD- ROM maps, which were recently discontinued. The last ones produced for certain California counties were the 2008 edition. Last editions for Seattle, Portland, Las Vegas, and Phoenix/Tucson were the 2007 edition. Each is still available on the Rand McNally website for $20.
When you geo-code a group of addresses, you'll see an output file with the TGXY coordinates and Lat/Lon for the addresses you specified, and the page # and grid that point is in. Once that file is open, you can click on the map to add additional geo-coded points, which will also provide both the coordinates. The output file is saved in an Access database ".mdb" file.
If you know a lot about map projections or solid geometry, the set of corresponding TGXY and Lat/Lon coordiantes will provide you some good data for testing.
As you mentioned San Diego Page 1297, I'll provide its bordering coordinates.
West x=3062760
East x=3086520
North y=0985040
South-y=0966560
This is not in range of the "TBXY" you found on Google. Maybe it's the same projection, with a relocated origin.

Resources