[Geoserver-users] What mechanism makes a new FeatureType?

Hi everyone,

I’m playing around with how to add a new layer into GeoServer without using the web interface. I’m starting simple, with a shapefile named “congressional_districts.shp”. I did the following:

  1. Added new dir under featureTypes named “congressional_districts”
  2. Copied in an info.xml file from another layer into new featureType dir and edited it (attached to email)
  3. Copied “default_polygon.sld” to “congressional_districts.sld” and edited to change Name to “congressional_districts”
  4. Added an entry in catalog.xml for new layer:






  5. Copied “congressional_districts.shp” into the data/shapefiles dir.

When I started GeoServer, I could see that the new featuretype didn’t get loaded. When I checked through the config menus, I found the new datastore, but no feature type or style. Did I miss something, or does the featuretype have to be created through the config menus?

Thanks,

Roger

Roger André
GIS Developer/Analyst
Enterprise Management Solutions
CH2M HILL
Tel: 425.233.3042

info.xml (932 Bytes)

(Obviously this is not really supported) You're missing the directory and XML file in <data dir>/featureTypes

Note that we started work on a RESTful interface[1] where you should be able to HTTP PUT a .zip with a shapefile, and maybe a SLD file, and the rest happens automatically. I am not sure what the status on that is, I'm sure you'll get an update tomorrow, there's a big discussion going on regarding the next generation configuration interface.

-Arne

1: http://geoserver.org/display/GEOSDOC/RESTful+Configuration+API

Roger Andre wrote:

Hi everyone,

I'm playing around with how to add a new layer into GeoServer without using the web interface. I'm starting simple, with a shapefile named "congressional_districts.shp". I did the following:

1. Added new dir under featureTypes named "congressional_districts"
2. Copied in an info.xml file from another layer into new featureType dir and edited it (attached to email)
3. Copied "default_polygon.sld" to "congressional_districts.sld" and edited to change Name to "congressional_districts"
4. Added an entry in catalog.xml for new layer:
    <datastore namespace = "topp" enabled = "true" id = "congressional_districts" >
      <connectionParams >
        <parameter value = "topp" name = "namespace" />
        <parameter value = "file:data/shapefiles/congressional_districts.shp" name = "url" />
        <parameter value = "ISO-8859-1" name = "charset" />
      </connectionParams>
    </datastore>
5. Copied "congressional_districts.shp" into the data/shapefiles dir.

When I started GeoServer, I could see that the new featuretype didn't get loaded. When I checked through the config menus, I found the new datastore, but no feature type or style. Did I miss something, or does the featuretype have to be created through the config menus?

Thanks,

Roger
--
Roger André
GIS Developer/Analyst
Enterprise Management Solutions
CH2M HILL
Tel: 425.233.3042

!DSPAM:4038,4802ce81161794901796417!
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

!DSPAM:4038,4802ce81161794901796417!
  ------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4038,4802ce81161794901796417!
  

Roger Andre ha scritto:

Hi everyone,

I'm playing around with how to add a new layer into GeoServer without using the web interface. I'm starting simple, with a shapefile named "congressional_districts.shp". I did the following:

1. Added new dir under featureTypes named "congressional_districts"
2. Copied in an info.xml file from another layer into new featureType dir and edited it (attached to email)
3. Copied "default_polygon.sld" to "congressional_districts.sld" and edited to change Name to "congressional_districts"
4. Added an entry in catalog.xml for new layer:
    <datastore namespace = "topp" enabled = "true" id = "congressional_districts" >
      <connectionParams >
        <parameter value = "topp" name = "namespace" />
        <parameter value = "file:data/shapefiles/congressional_districts.shp" name = "url" />
        <parameter value = "ISO-8859-1" name = "charset" />
      </connectionParams>
    </datastore>
5. Copied "congressional_districts.shp" into the data/shapefiles dir.

When I started GeoServer, I could see that the new featuretype didn't get loaded. When I checked through the config menus, I found the new datastore, but no feature type or style. Did I miss something, or does the featuretype have to be created through the config menus?

The only supported way is to create it thru the config menus.
Anyways, from what I can see, you did not add to the catalog
an entry for the style you specified in the info.xml:
congressional_districts_style

Looking into the log you should see a message that sounds like:
"congressional_districts" not loaded because style
"congressional_districts_style" could not be found

Cheers
Andrea