Thanks for the reply on this.
Yes, I have managed to create the feature types using the REST API and ajax -
see code extract below - so, as you say, the nativeCRS is all done for me.
GeoServer reads the EPSG code from the the_geom field in my postGIS view.
//Do Ajax POST to make new featuretype from the db view for this layer
$.ajax({
type: "POST",
url:
"http://localhost:8080/geoserver/rest/workspaces/"+wsname+"/datastores/"+dsname+"/featuretypes.xml",
data: '<featureType><name>' + lyrname + '</name></featureType>',
username: "admin",
password: "geoserver",
contentType: "application/xml", //; charset=utf-8 -not needed
dataType: "json", //get response in JSON format
async: false,
success: function(resp){
//resp is null if successful
},
error: function(xReq, txtStatus) {
if (xReq.status != 201) {
alert('Error: '+ xReq.status + '; responseText= ' +
xReq.responseText);
}
},
complete: function(xReq,txtStatus) {
//alert('Making layer: '+ lyrname+'- Status code: ' +
xReq.status + ' ,xStatusText: ' + xReq.statusText + ' ,txtStatus:' +txtStatus);
//now send another request to amend layer title, abstract and
defaultStyle
amendLayer(lyrname,lyrtype, lyrtitle,lyrstyle);
}
}); // end of $.ajax
Anne Brookes
Senior Analyst - GIS and System Development
From: Justin Deoliveira [mailto:[email protected]]
Sent: 02 December 2010 15:35
To: Anne Brookes
Cc: [email protected]
Subject: Re: [Geoserver-users] nativeCRS definition when dynamically creating
GeoServer featureType
How are you creating the feature types? ARe you writing the xml configuration
files directly? If so you will have to use geotools to map the epsg code to the
wkt defintion.
I also think (not 100% sure) that for native crs you can actually just use an
epsg code, rather than the wkt text. So you can try that.
Finally you can also use the REST configuration api to create the feature type
with only having to specify the epsg code and geoserver will automatically
populate the other fields like nativeCRS.
-Justin
On Wed, Dec 1, 2010 at 4:04 AM, Anne Brookes <[email protected]>
wrote:
Hello,
Could someone tell me how the nativeCRS is defined? I want to create a
Geoserver featuretype dynamically but am not sure how I would define the
nativeCRS.$ string, just from knowing the EPSG projection code It looks
similar but not the same as a Proj4js projection definition. Here is the JSON
nativeCRS.$ response from GeoServer for an existing featuretype in RGF93
projection
But the Proj4js def for RGF93 is :
+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000
+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Cann anyone help, please? Thanks,
Anne Brookes
Senior Analyst - GIS and System Development
JBA Consulting
South Barn
Broughton Hall
Skipton
North Yorkshire
BD23 3AE
United Kingdom
t: +44 (0)1756 799919 | f: +44 (0)1756 799449
JBA is a Carbon Neutral Company. Please don't print this e-mail unless you
really need to.
This email is covered by JBA Consulting's email disclaimer.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users