Converting a SHP file

karsten vennemann karsten at TERRAGIS.NET
Sat Dec 8 01:14:19 EST 2007


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:jmckenna at DMSOLUTIONS.CA] 
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



More information about the mapserver-users mailing list