[Geoserver-devel] (no subject)

Hi,

I'm a little confused about viewing shape files that have been loaded into
the server. I have loeaded a shape file (the main roads of california),
and it gets looaded without incidence. How, at this point do I view it?
I looked at the demo with the bc roads and was confused by the boundingbox
servlet parameter

example:
http://nebulous.nceas.ucsb.edu:8070/geoserver/wms?request=GetMap&layers=topp:bc_roads&bbox=489153,5433000,529000,5460816&width=1000&height=200&srs=EPSG:27354&styles=normal&Format=image/png
* what coordinate system do 489153,5433000,529000,5460816 refer to?

It would seem to me that if the info.xml file describes the shapefile in
geocoordinates (lat/long) then the query should be in geocoordiantes also
-- I'm probably missing something simple here.

So, as I was saying I loaded up the california roads without a hitch, but
I'm not sure what boundingbox query prarmeters I should submit to the
servlet -- I tried some abitrary ones an got completly white png's. Here
are some example queries that I issued:

http://nebulous.nceas.ucsb.edu:8070/geoserver/wms?request=GetMap&layers=topp:major_roads_unprojected&bbox=4891,5433000,529,5460816&width=200&height=200&srs=EPSG:27354&styles=normal&Format=image/png
http://nebulous.nceas.ucsb.edu:8070/geoserver/wms?request=GetMap&layers=topp:major_roads_unprojected&bbox=-100,100,-100,100&width=200&height=200&srs=EPSG:27354&styles=normal&Format=image/png

(both bame up white (blank) images)

my info.xml files are like:

####################### start info #######################################
<featureType datastore = "usaroads" >
<name>major_roads_unprojected</name>
<!--
native wich EPGS code for the FeatureTypeInfoDTO
-->
<SRS>27354</SRS>
<title>test usa roads</title>
<abstract>This is some road features USA</abstract>
<numDecimals value = "0" />
<keywords>USA, road, </keywords>
<latLonBoundingBox dynamic = "false" miny = "32.54218933792563" maxy =
"42.00256500076555" maxx = "-114.4803222939074" minx =
"-124.26521346951216" />
<!--
the default style this FeatureTypeInfoDTO can be represented by.
at least must contain the "default" attribute
-->
<styles default = "normal" />
</featureType>

####################### end info #######################################

if interested I put the shp file and associated dbf etc at:
http://nebulous.nceas.ucsb.edu/harris/ca_road_shape.tgz

thanks for your help. John

Quoting harris@anonymised.com:

Hi,

I'm a little confused about viewing shape files that have been loaded
into
the server. I have loeaded a shape file (the main roads of
california),
and it gets looaded without incidence. How, at this point do I view
it?
I looked at the demo with the bc roads and was confused by the
boundingbox
servlet parameter

example:

http://nebulous.nceas.ucsb.edu:8070/geoserver/wms?request=GetMap&layers=topp:bc_roads&bbox=489153,5433000,529000,5460816&width=1000&height=200&srs=EPSG:27354&styles=normal&Format=image/png

* what coordinate system do 489153,5433000,529000,5460816 refer to?

It refers to the coordinate system specified in srs (spatial reference
system) parameter - EPSG:27354. Granted that parameter is fairly
ignored, as we have yet to implement reprojection, so the only valid
epsg is the one that the data is stored in (but I don't think we raise
an exception for requesting the wrong srs yet).

It would seem to me that if the info.xml file describes the shapefile
in
geocoordinates (lat/long) then the query should be in geocoordiantes
also
-- I'm probably missing something simple here.

No, you're right, the query should be in geocoordinates. For the sample
file the coordinates aren't in geocoordinates. I'm actually trying to
find a second good sample file, that is in lat/long and that contains
polygons instead of lines. If anyone has a nice small one, preferably
with a string as at least one of the attributes, that is of the real
world, then send it along to me.

So, as I was saying I loaded up the california roads without a hitch,
but
I'm not sure what boundingbox query prarmeters I should submit to the
servlet -- I tried some abitrary ones an got completly white png's.

If the bounding box for lat/long for you info.xml file then the bbox
param should be: BBOX=-124.26521347,32.54218934,-114.48032229,42.002565

And actually, I just tested it out, thanks a ton for having a server
available on the internet. This seemed to work for me:

http://nebulous.nceas.ucsb.edu:8070/geoserver/wms?request=GetMap&layers=topp:major_roads_unprojected&bbox=-124.26521347,32.54218934,-114.48032229,42.002565&width=200&height=200&srs=EPSG:27354&styles=normal&Format=image/png

The best way to figure out the bbox to use is by issueing a GetFeature
request:
http://nebulous.nceas.ucsb.edu:8070/geoserver/wfs?request=getFeature&typename=topp:major_roads_unprojected
And the boundedBy element for the collection will have a Box, which is
the limits of the data set. Just use that box, in the same order. If
you copy and paste you just need to change the middle space to a comma.

And I need to make a tutorial on how to do this, add a shapefile and
visualize the data, as I've answered this too many times :slight_smile: You're
right in asking though, as we don't document this well anywhere, and
it's one of the most common operations.

best regards,

Chris

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/