0

I use geonode and geoserver, and geogig for versioning my data.

but I have a problem with "import existed postgis layer in to geogig store". geoserver has a importer module but it has not api for import postgis table.

after research, some people said that first you should export your layer in geoJSON and then import geoJSON file in to geogig store with geoserver importer api.

somebody said that you can use publish layer api in geoserver and publish your postgis layer in to geogig store.

I try these two way but in first way I think that in not reasonable! and in second way I had this problem that the layer's data not imported.

first I copy my postgis layer:

CREATE TABLE new_layer_title ( like old_layer_name including all)

and then insert old_layer_data in to new_layer. after that I call this api with POSTfor publishing my postgis layer in to geoserver:

http://localhost:8080/geoserver/rest/workspaces/myWorkspace/datastores/geogig/featuretypes/

in body (new layer title is test_geogig4253):

<featureType>
<name>test_geogig4253</name>
<nativeName>test_geogig4253</nativeName>
<namespace>
<name>GeoTajak</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://192.168.11.47:8080/geoserver/rest/namespaces/GeoTajak.xml" type="application/xml"/>
</namespace>
<title>test_geogig4253</title>
<abstract/>
<keywords>
<string>features</string>
<string>test_geogig4253</string>
</keywords>
<srs>EPSG:4326</srs>
<nativeBoundingBox>
<minx>46.9703609806</minx>
<maxx>50.2470333438</maxx>
<miny>34.579760701</miny>
<maxy>35.5598420373</maxy>
<crs>EPSG:4326</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>46.9703609806</minx>
<maxx>50.2470333438</maxx>
<miny>34.579760701</miny>
<maxy>35.5598420373</maxy>
<crs>EPSG:4326</crs>
</latLonBoundingBox>
<projectionPolicy>FORCE_DECLARED</projectionPolicy>
<enabled>true</enabled>
<advertised>true</advertised>
<store class="dataStore">
<name>GeoTajak:datasto</name>
</store>
<maxFeatures>0</maxFeatures>
<numDecimals>0</numDecimals>
<overridingServiceSRS>false</overridingServiceSRS>
<skipNumberMatched>false</skipNumberMatched>
<circularArcPresent>false</circularArcPresent>
<attributes>
<attribute>
<name>fid</name>
<minOccurs>1</minOccurs>
<maxOccurs>1</maxOccurs>
<nillable>false</nillable>
<binding>java.lang.Integer</binding>
</attribute>
<attribute>
<name>the_geom</name>
<minOccurs>1</minOccurs>
<maxOccurs>1</maxOccurs>
<nillable>false</nillable>
<binding>com.vividsolutions.jts.geom.Point</binding>
</attribute>
</attributes>
</featureType>

my base question is:

what is reasonable way for importing postgis layer in to another store (like geogig store) with api?

Your Answer

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

Browse other questions tagged or ask your own question.