[Geoserver-users] tiger shapefiles

Hi,

I'm trying to import a tiger shapefile (state_highways) to postgis using shp2pgsql. When I use the shp file itself as a datastore and configure feature type to have srid 4326, I can view it in google earth and everything's fine, but when I use shp2pgsql and specify srid as 4326, the coordinates that get inserted into postgis are way out of bounds. The geometry is multistring and coordinates become 6 digit decimal degrees. Anyone know what's wrong?

Thanks,
Doris

Hi Doris,

Does the shapefile have a .prj file associated with it? What might be happening is that when you load it as a shapefile datastore geoserver is doing the projection from the native coordinate system to the one you are declaring (4326).

I could be wrong but I dont think that shp2pgsql will recognize the .prj file and will just assume the data is in the srid you specify...

If you want a utility that supports the conversion and will reproject your data I would suggest ogr2ogr, which is part of the gdal suite of tools.

-Justin

dlamoris@anonymised.com wrote:

Hi,

I'm trying to import a tiger shapefile (state_highways) to postgis using shp2pgsql. When I use the shp file itself as a datastore and configure feature type to have srid 4326, I can view it in google earth and everything's fine, but when I use shp2pgsql and specify srid as 4326, the coordinates that get inserted into postgis are way out of bounds. The geometry is multistring and coordinates become 6 digit decimal degrees. Anyone know what's wrong?

Thanks,
Doris

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,469e987e103172085621377!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Yeah it does. I guess that's why...Thanks! I'll try using ogr2ogr to convert it.

Quoting Justin Deoliveira <jdeolive@anonymised.com>:

Hi Doris,

Does the shapefile have a .prj file associated with it? What might be
happening is that when you load it as a shapefile datastore geoserver
is doing the projection from the native coordinate system to the one
you are declaring (4326).

I could be wrong but I dont think that shp2pgsql will recognize the
.prj file and will just assume the data is in the srid you specify...

If you want a utility that supports the conversion and will reproject
your data I would suggest ogr2ogr, which is part of the gdal suite of
tools.

-Justin

dlamoris@anonymised.com wrote:

Hi,

I'm trying to import a tiger shapefile (state_highways) to postgis using shp2pgsql. When I use the shp file itself as a datastore and configure feature type to have srid 4326, I can view it in google earth and everything's fine, but when I use shp2pgsql and specify srid as 4326, the coordinates that get inserted into postgis are way out of bounds. The geometry is multistring and coordinates become 6 digit decimal degrees. Anyone know what's wrong?

Thanks,
Doris

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,469e987e103172085621377!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org