What David meant was looking at the result XML of the GET request you should
be able to sort out the correct structure of the POSTed request. Said that,
here's an working cURL request made against a GS 2.0.2 instance:
curl -u admin:geoserver -XPOST -H "Content-type: text/xml" -d
"<featureType><name>MY_FEATURE_NAME</name><nativeName>MY_FEATURE_NAME</nativeName><title>MY_FEATURE_NAME</title><nativeCRS
class='projected'>EPSG:27492</nativeCRS><srs>EPSG:27492</srs><latLonBoundingBox><minx>-180.0</minx><maxx>180.0</maxx><miny>-90.0</miny><maxy>90.0</maxy><crs>EPSG:4326</crs></latLonBoundingBox><projectionPolicy>FORCE_DECLARED</projectionPolicy><enabled>true</enabled><metadata><entry
key='cachingEnabled'>false</entry></metadata><maxFeatures>0</maxFeatures><numDecimals>0</numDecimals></featureType>"
"
http://localhost:8080/Geoserver/rest/workspaces/datageo/datastores/MY_DATASTORE/featuretypes
"
Hope this helps,
Pedro Mendes
On Sat, Jan 29, 2011 at 8:59 AM, Chris <[email protected]> wrote:
> David Winslow <dwinslow <at> opengeo.org> writes:
>
> >
> >
> > Use the GeoServer web interface to configure the layer properly, then
> issue a
> GET request in the UI to get a sample XML document with all the fields you
> have
> set.
> >
> > Hope this helps.
> >
> >
> > --
> > David Winslow
> > OpenGeo - http://opengeo.org/On Wed, Nov 3, 2010 at 2:14 PM, Kostis
> Kyzirakos
> <kkyzir <at> di.uoa.gr> wrote:Cool!I am able to create new features using
> my
> postgis tables, but for some reason the layer that is been created has null
> values at the Native SRS and the bounding box...
> > Could you help me with this? Can I pass these values though curl somehow?
> I
> searched the documentation but I didn't find anything relevant.
> >
> >
> > Cheers,
> > Kostis
> >
> >
> >
> >
> > On Tue, Nov 2, 2010 at 6:31 PM, David Winslow <dwinslow <at> opengeo.org
> >
> wrote:GeoServer has an extension providing a REST API for just this sort of
> thing:
> > http://docs.geoserver.org/stable/en/user/extensions/rest/index.html
> >
> >
> >
> >
> > Hope this helps.
> >
> > --
> > David Winslow
> > OpenGeo - http://opengeo.org/
> >
> >
> >
> >
> >
> > On Tue, Nov 2, 2010 at 12:25 PM, Kostis Kyzirakos <kkyzir <at> di.uoa.gr
> >
> wrote:
> >
> >
> >
> >
> >
> > Hi,
> > I am new to geoserver and a have a question that may be trivial for
> everybody,
> but unfortunatelly it is not clear for me (and googling wasn't very
> helpful).
> >
> > I have some gis data stored in a PostGIS database. Depending on data that
> are
> been inserted in PostGIS, I am currently creating some views that contain
> some
> geometry columns. I would like to know if there is an automatic way to
> create/publish this views as a new layer through geoserver. I know
> before-hand
> all the parameters that I need to know to create the new layer, but I want
> to
> this this automatically (e.g., some java code or a bash script or a
> postgres
> trigger or someting like that).
> >
> >
> >
> >
> >
> >
> > Is this possible in GeoServer? If so, could you provide me some relevant
> pointers? Or even better, is there a similar example out there?
> >
> > Thanks in advance for your help!
> >
> >
> >
> >
> >
> >
> >
> > Regards,
> > Kostis
> >
> >
> >
> ------------------------------------------------------------------------------
> > Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> > Create new apps & games for the Nokia N8 for consumers in U.S. and
> Canada
> > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi
> Storehttp://p.sf.net/sfu/nokia-
> dev2dev_______________________________________________
> > Geoserver-users mailing listGeoserver-users <at>
> lists.sourceforge.nethttps://
> lists.sourceforge.net/lists/listinfo/geoserver-
> users
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Achieve Improved Network Security with IP and DNS Reputation.
> > Defend against bad network traffic, including botnets, malware,
> > phishing sites, and compromised hosts - saving your company time,
> > money, and embarrassment. Learn More!
> > http://p.sf.net/sfu/hpdev2dev-nov
> >
> > _______________________________________________
> > Geoserver-users mailing list
> > Geoserver-users <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
> >
>
> So, what do we actually gain by using curl/REST if we have to then go in
> and fix
> the details of a newly uploaded layer before we can do anything with it? Is
> there any sort of fully automatable workaround here? This seems like a big
> oversight, unless I'm missing something (probably am).
>
> Best,
> Chris
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
--
Cumprimentos,
Pedro Mendes
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users