Hello list !
I'm searching for a way to add shapes from a shapefile, to a feature in a PostGIS Database using Geoserver. (assuming the feature already exists, and the shapes structure is the same as described in the feature's schema)
My first idea was to extract data from the shapefile, and to build GML transaction queries. Then I would have Geoserver execute my queries, and add the shapes to the postGis database. But this would be a huge work for me (the easiest way I found is to study "shp2pgsl" source code and to modify it so that it outputs a GML query).
That's why I'd like to know if there is a simpler way.
Since Geoserver can handle shapefiles, I had an idea :
I could open my shapefile with Geoserver, using a GetFeature request; and then I could easily transform the output into a insert request tragetting the feature in the postGis database.
So the first thing to do is to create a new feature type for my shapefile which is exactly the same as the one for my PostGis table, but with :
<DatasourceParams>
<url>file://home/...wherever/the/file/is.shp</url>
</DatasourceParams>
(instead of postgis connection settings in the infos.xml file of the feature.)
But there, I have a problem :
The capabilities document doesn't show the new feature type.
That's why I ask the question : Is it possible to have both postGis and shapefiles features types on the same geoServer ?
The answer must be 'yes'.... But I can't find why it doesn't work...
Maybe it's because I'm on windows and my shapefile url is something like
<Url>file:c:/program files/easyphp/www/mapserverimage/upload/upload_ligne_electrique.shp</Url>
I also tried DOS name :
<Url>file:c:/progra~1/easyphp/www/mapser~1/upload/upload~3.shp</Url>
But I get the same result ....
Maybe someone can help me !
And if you have some other ideas on how to import shapes from a shapefile to a PostGis database... Let me know !
(Sorry for my bad english, I hope this mail is understandable !!)
Steph
_________________________________________________________________
Téléchargez gratuitement MSN Messenger ! http://www.msn.fr/msger/default.asp