[postgis-users] question about order of geomcollfromtext()

Amit Kulkarni amitkulz at yahoo.com
Tue Nov 29 11:43:19 PST 2005


I thought about posting to the geos list but I felt this is a PostGIS
question.

Background: Sometime ago I posted a possible solution for aligning all
road segments in a particular direction to make sure their digitization
order is 'right' in postgis-users list. I was using Hartmut's azimuth()
function. Now I find it is not possible to use it in checking direction
because it works very well if you have road segments lined up
horizontally (I didn't check with only vertically aligned road
segments), but not multiple road segments whose orientation changes
sometimes from segment to segment while the actual road curves from
horizontal to vertical (or vertical to horizontal)... The resulting
angles change a lot giving false readings.

So I decided to rewrite the func from scratch remembering that a
startpoint of a segment is exactly similar (~= operator) to the
adjacent segment's endpoint.

There is a touches(), geometry_left, geometry_right and there is a
inbuilt geom collection func. (Is collect() useful?)

I am passing a street_name which has 100 road segments associated with
that name, and the row_id of the first road segment (with the desired
direction) to this function.

Now my question is if I call geomcollfromtext() what is the order of
the geometry segments when they are initially added while creating the
geometry collection? Is it added such that when you iterate over the
collection each geometry segment is adjacent to next? Or the order is
random?

I couldn't figure it out in the JTS/Geom code, many places call a
createGeometryCollection(null). There is just one call in
WKTReader.java/cpp which is in readGeometryCollectionText()

Thanks in advance!


		
__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com




More information about the postgis-users mailing list