[Geoserver-users] Pgrouting and Geoserver

Hello every one, I am currently developing application where the users can
route from one point to another using geoserver and pgrouting.

First of all I have the map on SHP format, I converted it into POSGIS
database and going to integrate it with pgroute (I wrote a java code to
routing to check the results).

So every thing is done, but I ran into a problem, where the results need to
be displayed, I had the result with me as I can see them on console (using
eclipse and GWT with OpenLayers), the results are 100% correct, but how
could I display the route on screen?

I could make a field (Boolean) in database and put a rule on SLD file,the
SLD rule will display all streets in green, when the user routes the
selected streets will set the field to true, and SLD will show them in RED
(well this is not a solution actually, just some thoughts), anyone could
help me to display the route results on the map without the need to refresh
the map? I am using Geoserver + POSTGIS + PGROUTE + Openlayers + GWT.

I saw some example using Openlayers and Pgrouting with Google maps, but I am
not using google maps in my case, here the example
http://demo.postlbs.org/openrouting/web/geobase.html

Thanx in advance
Ahmad Bdair, Computer Systems Engineer.
--
View this message in context: http://www.nabble.com/Pgrouting-and-Geoserver-tp19783273p19783273.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Ahmad,

You will most likely get a better answer to this question on the openlayers mailing list, there are folks there who have done this sort of thing. Here are some links you might find useful.

http://pgrouting.postlbs.org/wiki/OpenLayers
http://crschmidt.net/blog/categories/pgrouting/

-Justin

bdair2002 wrote:

Hello every one, I am currently developing application where the users can
route from one point to another using geoserver and pgrouting.

First of all I have the map on SHP format, I converted it into POSGIS
database and going to integrate it with pgroute (I wrote a java code to
routing to check the results).

So every thing is done, but I ran into a problem, where the results need to
be displayed, I had the result with me as I can see them on console (using
eclipse and GWT with OpenLayers), the results are 100% correct, but how
could I display the route on screen?

I could make a field (Boolean) in database and put a rule on SLD file,the
SLD rule will display all streets in green, when the user routes the
selected streets will set the field to true, and SLD will show them in RED
(well this is not a solution actually, just some thoughts), anyone could
help me to display the route results on the map without the need to refresh
the map? I am using Geoserver + POSTGIS + PGROUTE + Openlayers + GWT.

I saw some example using Openlayers and Pgrouting with Google maps, but I am
not using google maps in my case, here the example
http://demo.postlbs.org/openrouting/web/geobase.html

Thanx in advance Ahmad Bdair, Computer Systems Engineer.

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Thank you, I am not really sure from where to solve this problem so I posted
here, I though I could pass lets say Vector of GID from server side directly
to SLD and geoserver displays (change the street colors) on the fly, as I
said I didn't setup pgrouting yet, I made my own java class to calculate
routing for test purposes.

So basically, whether I used geoserver or Google maps, it has nothing to do
with routing display? and Google maps does not have internal support for
this feature? and the solution can be done through openlayers and pgrouting?
Can anyone confirm this please?

bdair2002 wrote:

Hello every one, I am currently developing application where the users can
route from one point to another using geoserver and pgrouting.

First of all I have the map on SHP format, I converted it into POSGIS
database and going to integrate it with pgroute (I wrote a java code to
routing to check the results).

So every thing is done, but I ran into a problem, where the results need
to be displayed, I had the result with me as I can see them on console
(using eclipse and GWT with OpenLayers), the results are 100% correct, but
how could I display the route on screen?

I could make a field (Boolean) in database and put a rule on SLD file,the
SLD rule will display all streets in green, when the user routes the
selected streets will set the field to true, and SLD will show them in RED
(well this is not a solution actually, just some thoughts), anyone could
help me to display the route results on the map without the need to
refresh the map? I am using Geoserver + POSTGIS + PGROUTE + Openlayers +
GWT.

I saw some example using Openlayers and Pgrouting with Google maps, but I
am not using google maps in my case, here the example
http://demo.postlbs.org/openrouting/web/geobase.html

Thanx in advance
Ahmad Bdair, Computer Systems Engineer.

--
View this message in context: http://www.nabble.com/Pgrouting-and-Geoserver-tp19783273p19795844.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I am trying to limit the attributes returned for features from a
GetFeature request by using the propertyname parameter on the URL, for
example:

http://192.168.100.9:8080/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=dg:VATEventLine&propertyname=event_id,timestamp,route_name

The attribute selection works with the exception that the geometry
columns are still being returned. I want to be able to select features
and return attributes without returning their large geometries. Any
ideas? I am using 1.6.4.
Thanks, David

--

David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: drrobison@anonymised.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately.

David R Robison ha scritto:

I am trying to limit the attributes returned for features from a
GetFeature request by using the propertyname parameter on the URL, for
example:

http://192.168.100.9:8080/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=dg:VATEventLine&propertyname=event_id,timestamp,route_name

The attribute selection works with the exception that the geometry
columns are still being returned. I want to be able to select features
and return attributes without returning their large geometries. Any
ideas? I am using 1.6.4.

The WFS specification says that GetFeature must return all required
attribute, plus all that are mandatory for the schema.
The schema is reverse engineered from the database, and all not
nullable columns are considered mandatory (because they are mandatory
in case of an insert).
So if you want the geometry to be optional, you'll have to mark
it as nullable in the underlying db.

Hope this helps
Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thanks for the quick response.
The data comes from my own datasource plugin. I create the feature type as such:

FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(typeName);
typeBuilder.setNamespace(new URI(namespace));
typeBuilder.setDefaultGeometry(new GeometricAttributeType("segment", Geometry.class, true, null, CRS.decode("EPSG:4326"), null));
typeBuilder.addType(new GeometricAttributeType("start_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new GeometricAttributeType("end_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new TemporalAttributeType("timestamp", true, 0, 64, null, null)); typeBuilder.addType(new TextualAttributeType("event_id", true, 0, 64, null, null)); ...
featureType = typeBuilder.getFeatureType();

I also verified that the WFS FeatureBounding property was set to FALSE and, indeed, I do not get feature bounds, yet I am still getting the geometry attributes. Any thoughts? David

Andrea Aime wrote:

David R Robison ha scritto:

I am trying to limit the attributes returned for features from a
GetFeature request by using the propertyname parameter on the URL, for
example:

http://192.168.100.9:8080/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=dg:VATEventLine&propertyname=event_id,timestamp,route_name

The attribute selection works with the exception that the geometry
columns are still being returned. I want to be able to select features
and return attributes without returning their large geometries. Any
ideas? I am using 1.6.4.

The WFS specification says that GetFeature must return all required
attribute, plus all that are mandatory for the schema.
The schema is reverse engineered from the database, and all not
nullable columns are considered mandatory (because they are mandatory
in case of an insert).
So if you want the geometry to be optional, you'll have to mark
it as nullable in the underlying db.

Hope this helps
Cheers
Andrea

--

David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: drrobison@anonymised.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately.

David R Robison ha scritto:

Thanks for the quick response.
The data comes from my own datasource plugin. I create the feature type as such:

FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(typeName);
typeBuilder.setNamespace(new URI(namespace));
typeBuilder.setDefaultGeometry(new GeometricAttributeType("segment", Geometry.class, true, null, CRS.decode("EPSG:4326"), null));
typeBuilder.addType(new GeometricAttributeType("start_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new GeometricAttributeType("end_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new TemporalAttributeType("timestamp", true, 0, 64, null, null)); typeBuilder.addType(new TextualAttributeType("event_id", true, 0, 64, null, null)); ...
featureType = typeBuilder.getFeatureType();

I also verified that the WFS FeatureBounding property was set to FALSE and, indeed, I do not get feature bounds, yet I am still getting the geometry attributes. Any thoughts? David

Hum, can you issue a DescribeFeatureType against that feature type
and paste the output? The above code seems to create a nullable geometry
indeed, but you never know... (you're also using a deprecated way to
build the geometry attribute type).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I see......

<xsd:complexType name="VATEventLineType">

<xsd:complexContent>

<xsd:extension base="gml:AbstractFeatureType">

<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="segment" nillable="true"
type="gml:GeometryPropertyType"/>
<xsd:element maxOccurs="1" minOccurs="1" name="start_point"
nillable="true" type="gml:GeometryPropertyType"/>
<xsd:element maxOccurs="1" minOccurs="1" name="end_point"
nillable="true" type="gml:GeometryPropertyType"/>
<xsd:element maxOccurs="64" minOccurs="0" name="timestamp"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="event_id"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="sender_group"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="type_event"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="severity"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="priority"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="status" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="update_time"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="initial_report"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="scheduled_start_time"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="scheduled_stop_time"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="special_facility"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="route_name"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="travel_direction"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0" name="offset1_mi_dec"
nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="999" minOccurs="0" name="offset2_mi_dec"
nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="999" minOccurs="0" name="from_intersection"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0" name="to_intersection"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="containing_jurisdiction"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="containing_region"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="event_category"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="event_subcategory"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="height_restrictions_ft"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="height_restrictions_in"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="width_restrictions_ft"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="width_restrictions_in"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="weight_restrictions"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="alternating_lanes"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="mobile_lanes"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lane_count"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_affected"
nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_direction"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_id"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_position"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_condition"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_clear_time"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="lanes_close_time"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="template_511_text"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="public_free_text"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="delay_type"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="delay_miles"
nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="64" minOccurs="0" name="event_name_user"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="segment_start_time"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="segment_stop_time"
nillable="true" type="xsd:dateTime"/>
<xsd:element maxOccurs="64" minOccurs="0" name="segment_status"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_place_name"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0" name="nearest_place_distance"
nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_place_direction"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="road_system"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_ivr_name"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0" name="nearest_ivr_distance"
nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_ivr_direction"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_to_place_name"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0"
name="nearest_to_place_distance" nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="64" minOccurs="0"
name="nearest_to_place_direction" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="nearest_to_ivr_name"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="999" minOccurs="0"
name="nearest_to_ivr_distance" nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="64" minOccurs="0"
name="nearest_to_ivr_direction" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="64" minOccurs="0" name="event_type_other"
nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

It shows that it is nilable but that the minOccurs=1. This must be the
problem.

Andrea Aime wrote:

David R Robison ha scritto:

Thanks for the quick response.
The data comes from my own datasource plugin. I create the feature type as such:

FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(typeName);
typeBuilder.setNamespace(new URI(namespace));
typeBuilder.setDefaultGeometry(new GeometricAttributeType("segment", Geometry.class, true, null, CRS.decode("EPSG:4326"), null));
typeBuilder.addType(new GeometricAttributeType("start_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new GeometricAttributeType("end_point", Geometry.class, true, null, CRS.decode("EPSG:4326"), null)); typeBuilder.addType(new TemporalAttributeType("timestamp", true, 0, 64, null, null)); typeBuilder.addType(new TextualAttributeType("event_id", true, 0, 64, null, null)); ...
featureType = typeBuilder.getFeatureType();

I also verified that the WFS FeatureBounding property was set to FALSE and, indeed, I do not get feature bounds, yet I am still getting the geometry attributes. Any thoughts? David

Hum, can you issue a DescribeFeatureType against that feature type
and paste the output? The above code seems to create a nullable geometry
indeed, but you never know... (you're also using a deprecated way to
build the geometry attribute type).

Cheers
Andrea

--

David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: drrobison@anonymised.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately.

David R Robison ha scritto:

I see......

...

It shows that it is nilable but that the minOccurs=1. This must be the
problem.

Right right, you should set the min occurs of that type to 0 instead.
There is a constructor allowing to set min and max.
Out of curiosity, what is your datastore about? Anything that can
be of interest of a larger audience? :wink:

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

We have developed statewide network for sharing transportation critical data within the state of Virginia. The data is sent in the IEEE 1512 standard and wrapped with the EDXL-DE standard envelope. However, we have partners that need to receive the data for presentation on a web site and a statewide IVR site. Instead of them having to read the 1512 XML, I take the data and generate various GIS "feeds" that they can query. We also use the WMS for drawing the incidents and events on a web based mapping application.

We have also written datastore plugins to hold roadway device information. The information is geocoded to the roadway and represents the current state and information from the device. For example, the current message on an overhead sign or the current temperature of the roadbed. These layers directly reference the CORBA objects that represent these devices and allow GIS based applications to have direct access to those devices and their state.

Thanks again for a great product! David

Andrea Aime wrote:

David R Robison ha scritto:

I see......

...

It shows that it is nilable but that the minOccurs=1. This must be the
problem.

Right right, you should set the min occurs of that type to 0 instead.
There is a constructor allowing to set min and max.
Out of curiosity, what is your datastore about? Anything that can
be of interest of a larger audience? :wink:

Cheers
Andrea

--

David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: drrobison@anonymised.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately.