3

The geographical information data that INEGI (part of the Mexico's goverment) provides are in the following coordinate system (or is projection?)

Lambert Conformal Conic, double standard parallel
Units: Meter
Coordinate System Type:
Datum: World Geodetic System of 1984.
False Origin
Northing: 0.0000
Easting: 2500000.000
Projection Parameters
Origin latitude: 12° 0’ 0.0’’
Origin longitude: -102° 0’ 0.0’’
Northern standard parallel: 29° 30’ 0.0’’
Southern standard parallel: 17° 30’ 0.0’’

I already put the information in the PostGIS/PostgreSQL database, now, How I can change the projection/coordinate system to that projection? Could you provide the code for doing it? And How I can change it to the coordinate system that Google use?

  • ST_Transform postgis.refractions.net/documentation/manual-2.0/… will change the projection when you request it – Mapperz Jul 29 '13 at 1:24
  • Thanks @Mapperz but, I don't understand how setting that projection... Could you give me some tips? – nanounanue Jul 29 '13 at 2:49
  • What is the spatial reference of the actual data that you have put in PostGIS? Is it already in the required projection, or do you need to transform it? – Devdatta Tengshe Jul 29 '13 at 6:56
  • What i understand from question , data is already in coorect projection but PostGIS srid is defined wrong ( probably 0 or 4326) Using ST_Transform dosnt work ( im not sure does transform understand 0 srid to be not transformed or not), ST_SetSRID is correct way to "fix" undefined or wrongly set srid – simplexio Jul 29 '13 at 8:36
  • @simplexio: If your assumption is correct, then you just need this: gis.stackexchange.com/questions/34612/… – Devdatta Tengshe Jul 30 '13 at 9:45
5

You have to set up a custom projection, because the lcc projection they use has no EPSG code.

You can try to add a sample dataset to QGIS, and look if it fits correct against a Google openlayers plugin background. The proj string for the custom projection should be:

+proj=lcc +lat_1=29.5 +lat_2=17.5 +lat_0=12.0 +lon_0=-102.0 +x_0=2500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

I haven't tried it myself, because I don't undersand the content of the Spanish language web site of INEGI.

If the reprojection fits, you can add the projection information to your postgis database, or reproject the data with QGIS to EPSG:3857 (aka Google mecator).


EDIT

To add the CRS to your Postgis database, do the following in pgAdmin III:

  • start pgAdmin III
  • select the database you are working with
  • click on schemata, public, tables
  • click on the SQL icon
  • In the SQL Editor window upper left, enter:

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 909090, 'sr-org', 7759, '', '"+proj=lcc +lat_1=29.5 +lat_2=17.5 +lat_0=12.0 +lon_0=-102.0 +x_0=2500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"');

  • click on the green triangle icon to start the command
  • to check the result, right-click on the table spatial_ref_sys -> show data -> filtered
  • enter srid=909090 in the box and hit ok

To apply the new srid named 909090 to your data, follow this guide: How to change the SRID of exisisting data in PostGIS?

  • SetSRID sets srid if you have data in wrong projection – simplexio Jul 29 '13 at 6:48
  • 1
    With Postgis 2.0, shouldn't it be postgis.net/docs/ST_SetSRID.html? Anyway, you have to define the SRID if it is not a valid EPSG code. – AndreJ Jul 29 '13 at 7:08
  • indeed. But if data is already in database it probably has 0 or some other wrong srid. S o right way to do it is define new srid (and give it some random number) , use St_SetSRID to set prober coordinate system. – simplexio Jul 29 '13 at 8:34
  • @AndreJoost thank you for your response, indeed, the data is already in the database and I didn't set any srid, so probably it is wrong. Could you detail the steps for setting the srid and tranform it to google coordinate system? (I mean the code) thanks in advance – nanounanue Jul 31 '13 at 11:06
  • See my extended answer. – AndreJ Aug 3 '13 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.