Converting a SHP file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Converting a SHP file

Eduardo Spremolla
I have a polygon shapefile , generated from a postgis table with
pgsql2shp that is on meter coordinates.
The projection is

+proj=tmerc
+ellps=intl
+lon_0=-55.8
+lat_0=-90
+x_0=500000

I need it on lat long, but pgsql2shp do not accept a SRID for exporting.

Any opensource tool can do the job?
I know that mapserver can re project on the fly, but for some reason
this link:
http://xx.xx.xx.xx/cgi-bin/mapserv?map=/srv/www/htdocs/gsm/muestro.map&imgxy=200.0
%20
200.0&mode=indexquery&qlayer=local&map_local_template=localidad2.html&shapeindex=106&mapext=shape

goes ok if the query layer in on latlong and wrong otherwise.

Thanks

-  
Ing. Eduardo Spremolla
Ger. Desarrollo Aplicado
Antel
Uruguay



El   presente  e-mail   y   cualquier    posible   archivo   adjunto  está dirigido  únicamente  al destinatario  del  mensaje y contiene información que  puede ser  confidencial.  Si  Ud. no es el destinatario  correcto por favor notifique al remitente respondiendo  anexando este mensaje y elimine inmediatamente   el e-mail y los posibles archivos adjuntos al mismo de su sistema. Está  prohibida  cualquier utilización,  difusión o copia de este e-mail por   cualquier  persona  o  entidad  que  no  sean las específicas destinatarias del  mensaje.  ANTEL  no acepta  ninguna responsabilidad con respecto  a cualquier  comunicación  que  haya sido  emitida  incumpliendo nuestra Política de Seguridad de la Información.
. . . . . . . . .
This e-mail and any attachment is confidential and is  intended solely for the addressee(s).  If you are not  intended  recipient  please  inform the sender immediately,  answering  this  e-mail and  delete it as well as the attached files. Any use, circulation or copy of this e-mail by  any person or entity that is not the specific  addressee(s)  is prohibited.  ANTEL is not  responsible  for  any  communication  emitted  without respecting our Information Security Policy.
Reply | Threaded
Open this post in threaded view
|

Re: Converting a SHP file

Jeff McKenna-2
Yes you can use the ogr2ogr utility to reproject your shapefile
(http://www.gdal.org/ogr/ogr2ogr.html).

e.g.

ogr2ogr -f "ESRI Shapefile" -s_srs EPSG:42304 -t_srs "+proj=aea
+ellps=GRS80 +datum=NAD83 +lat_0=42 +lon_0=-72 +lat_1=43 +lat_2=46
+x_0=0 +y_0=0 +units=m" destination.shp source.shp


-jeff





Eduardo Spremolla wrote:
>
> I need it on lat long, but pgsql2shp do not accept a SRID for exporting.
>
> Any opensource tool can do the job?



--
Jeff McKenna
DM Solutions Group Inc.
http://www.dmsolutions.ca
Reply | Threaded
Open this post in threaded view
|

Re: Converting a SHP file

Karsten-3-2
In reply to this post by Eduardo Spremolla
Or you can do it in postgis before exporting it with pgsql2shp:

1) add a second geometry column (the_geom2) to your postgis polyon layer
select
AddGeometryColumn('public','your_polylayer','the_geom2',4326,'MULTIPOLYGON',
2);

2) Transform the geometry and update new geometry column in one step:
update your_polylayer set the_geom2 = transform(the_geom,4326);

3) export to shape with pgsql2shp using the_geom2 (instead of the_geom)

Karsten


-----Original Message-----
From: Jeff McKenna [mailto:[hidden email]]
Sent: Friday, December 07, 2007 06:39
Subject: Re: Converting a SHP file

Yes you can use the ogr2ogr utility to reproject your shapefile
(http://www.gdal.org/ogr/ogr2ogr.html).

e.g.

ogr2ogr -f "ESRI Shapefile" -s_srs EPSG:42304 -t_srs "+proj=aea
+ellps=GRS80 +datum=NAD83 +lat_0=42 +lon_0=-72 +lat_1=43 +lat_2=46
+x_0=0 +y_0=0 +units=m" destination.shp source.shp


-jeff





Eduardo Spremolla wrote:
>
> I need it on lat long, but pgsql2shp do not accept a SRID for exporting.
>
> Any opensource tool can do the job?



--
Jeff McKenna
DM Solutions Group Inc.
http://www.dmsolutions.ca