[Geoserver-users] Oracle multiple SDO_geometry fields

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the first
geometry column is empty (we have a generic datamodel for different
clients).
I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error:
08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I did not find a description anywhere how to choose the geometry-column (i
assume i must specify it earlier?). I tried using both the Oracle (OCI) and
the Oracle NG datastore, but they gave the same results.

I am using GeoServer 1.7.4 on Windows.

Any suggestions or hints would be greatly appreciated :slight_smile:

--
View this message in context: http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p23924656.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

nathanvda ha scritto:

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the first
geometry column is empty (we have a generic datamodel for different
clients).

Is this happening with the oracle datastore, or the oracle NG one?
The NG should not suffer from this problem.

I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error: 08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I see you're using lowercase names, but all geometry columns in Oracle
are forced to uppercase. Did you check the name is exactly as what
the geoserver feature type configuration shows?

Cheers
Andrea

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

Nathan,

Although there may be another way to do this, we created views with the
appropriate sdo_geom column. In the view, we also added a filter to make
sure it only returns rows that are not null for that column.

Thanks,

//SIGNED//
Bryan Hall, 38 EIG COMM GIO, L3-COM

One DoD... One Map
38 EIG/EN, Tinker AFB, OK
405-734-9762, DSN 884-9762, Cell 405-503-4832
Lon/Lat: -97.3587, 35.4025

-----Original Message-----
From: nathanvda [mailto:nathan@anonymised.com]
Sent: Monday, June 08, 2009 9:01 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Oracle multiple SDO_geometry fields

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the
first
geometry column is empty (we have a generic datamodel for different
clients).
I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error:
08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the
layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I did not find a description anywhere how to choose the geometry-column
(i
assume i must specify it earlier?). I tried using both the Oracle (OCI)
and
the Oracle NG datastore, but they gave the same results.

I am using GeoServer 1.7.4 on Windows.

Any suggestions or hints would be greatly appreciated :slight_smile:

--
View this message in context:
http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p239
24656.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------
------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Bryan,

i tried this too, but with OracleNG i got the error that the SRID did not
match the SRID from the layer. With the normal Oracle datastore i get the
error that he could not find an entry in the USER_SDO_GEOM_METADATA for the
view.

What did you do to fix that?

Using views seems very useful to me, because you can do some filtering
beforehand. Now I do the filtering using SLD, but that doesn't always seem
as efficient i think.

Thanks for anymore insights you could give :slight_smile:

Hall, Bryan D Contr USAF AFMC 38 EIG/ENC wrote:

Nathan,

Although there may be another way to do this, we created views with the
appropriate sdo_geom column. In the view, we also added a filter to make
sure it only returns rows that are not null for that column.

Thanks,

//SIGNED//
Bryan Hall, 38 EIG COMM GIO, L3-COM

One DoD... One Map
38 EIG/EN, Tinker AFB, OK
405-734-9762, DSN 884-9762, Cell 405-503-4832
Lon/Lat: -97.3587, 35.4025

-----Original Message-----
From: nathanvda [mailto:nathan@anonymised.com]
Sent: Monday, June 08, 2009 9:01 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Oracle multiple SDO_geometry fields

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the
first
geometry column is empty (we have a generic datamodel for different
clients).
I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error:
08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the
layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I did not find a description anywhere how to choose the geometry-column
(i
assume i must specify it earlier?). I tried using both the Oracle (OCI)
and
the Oracle NG datastore, but they gave the same results.

I am using GeoServer 1.7.4 on Windows.

Any suggestions or hints would be greatly appreciated :slight_smile:

--
View this message in context:
http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p239
24656.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------
------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p23930519.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Unbelievable! This works! So now i use the Oracle NG and specify the
column-name in uppercase, and it works.

Thank you for your reply!!

Andrea Aime-4 wrote:

nathanvda ha scritto:

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the
first
geometry column is empty (we have a generic datamodel for different
clients).

Is this happening with the oracle datastore, or the oracle NG one?
The NG should not suffer from this problem.

I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error:
08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I see you're using lowercase names, but all geometry columns in Oracle
are forced to uppercase. Did you check the name is exactly as what
the geoserver feature type configuration shows?

Cheers
Andrea

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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p23930547.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Ow. Seems i was too soon.
I got a lot of errors, thought nothing of it. At least it was busy with
drawing, i thought. But i had to adapt the scale inside my SLD, so not all
objects are drawn at the top-level (it took way too long to retrieve all of
them :D)
But when i adapted the scale, i got the same error, but nothing was drawn.
Whoops.

This is the error i receive now: This type of sequence is always
2-dimensional.

That is a bit weird. The SDO_GEOMETRY should contain polygons.
It works for my other tables, but this is the only table where i use the SLD
to specify which Geometry column to use. But maybe that is not related :slight_smile:

nathanvda wrote:

Unbelievable! This works! So now i use the Oracle NG and specify the
column-name in uppercase, and it works.

Thank you for your reply!!

Andrea Aime-4 wrote:

nathanvda ha scritto:

Hi there,

i am trying to get get geoserver to draw from an Oracle Table (in Oracle
10g) containing more than 1 SDO_GEOMETRY.
When i try to calculate the bounding box, i get an error, because the
first
geometry column is empty (we have a generic datamodel for different
clients).

Is this happening with the oracle datastore, or the oracle NG one?
The NG should not suffer from this problem.

I need to draw from the second geometry column.

I tried to find the answer on the net. What i did find/do:
- entered the bbox manually
- used an SLD and specified the correct Geometry column inside the SLD.

What then happens is that i get the following error:
08 Jun 15:54:41 ERROR [geoserver.ows] -
org.vfny.geoserver.wms.WmsException: The requested Style can not be used
with this layer. The style specifies an attribute of geom2 and the
layer
is: data:parcels

So for some reason he doesn't find the second geometry column.

I see you're using lowercase names, but all geometry columns in Oracle
are forced to uppercase. Did you check the name is exactly as what
the geoserver feature type configuration shows?

Cheers
Andrea

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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Oracle-multiple-SDO_geometry-fields-tp23924656p23931415.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

nathanvda ha scritto:

Ow. Seems i was too soon.
I got a lot of errors, thought nothing of it. At least it was busy with
drawing, i thought. But i had to adapt the scale inside my SLD, so not all
objects are drawn at the top-level (it took way too long to retrieve all of
them :D)
But when i adapted the scale, i got the same error, but nothing was drawn.
Whoops.

This is the error i receive now: This type of sequence is always
2-dimensional.

That is a bit weird. The SDO_GEOMETRY should contain polygons.
It works for my other tables, but this is the only table where i use the SLD
to specify which Geometry column to use. But maybe that is not related :slight_smile:

It most probably is. I guess your polygon data is 3-dimensional, in that
is has 3 dimensional coordinates.
GeoServer cannot still handle it, thought we're working on it (support
for typical 2d geometry shapes with 3d coordinates).

For the time being you'll have to flatten your data (I guess Oracle
provides some tool to do so, but I never actually tried).

Cheers
Andrea

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

Hi Andrea,

thank you for your explanation.

All our Oracle data is indeed 3D. I guess it is called 2,5D: it has x,y and a depth. Which is never shown on the map.
It is weird though, because the other objects/tables that have only 1 geometry column do draw.
I will check, because this specific table is definitely the one where we do not need the Z-coordinate.

Can i help in developing this part? I have the test setup (Oracle +data). I am not very experienced in java, but that should do i guess. I am also guessing it could not be too difficult to change. I am thinking along the lines of converting whatever is in the database to a 2d-coordinate array. Maybe that is simplifying it too much?
We definitely need it :slight_smile:

I check the data first, then i will check the code.

Thank you for your prompt reply.

Nathan

On Tue, Jun 9, 2009 at 8:31 AM, Andrea Aime <aaime@anonymised.com> wrote:

nathanvda ha scritto:

Ow. Seems i was too soon.
I got a lot of errors, thought nothing of it. At least it was busy with
drawing, i thought. But i had to adapt the scale inside my SLD, so not all
objects are drawn at the top-level (it took way too long to retrieve all of
them :D)
But when i adapted the scale, i got the same error, but nothing was drawn.
Whoops.

This is the error i receive now: This type of sequence is always
2-dimensional.

That is a bit weird. The SDO_GEOMETRY should contain polygons.
It works for my other tables, but this is the only table where i use the SLD
to specify which Geometry column to use. But maybe that is not related :slight_smile:

It most probably is. I guess your polygon data is 3-dimensional, in that
is has 3 dimensional coordinates.
GeoServer cannot still handle it, thought we’re working on it (support
for typical 2d geometry shapes with 3d coordinates).

For the time being you’ll have to flatten your data (I guess Oracle
provides some tool to do so, but I never actually tried).

Cheers
Andrea


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

Nathan Van der Auwera ha scritto:

Hi Andrea,

thank you for your explanation.

All our Oracle data is indeed 3D. I guess it is called 2,5D: it has x,y and a depth. Which is never shown on the map.
It is weird though, because the other objects/tables that have only 1 geometry column do draw.
I will check, because this specific table is definitely the one where we do not need the Z-coordinate.

Can i help in developing this part? I have the test setup (Oracle +data). I am not very experienced in java, but that should do i guess. I am also guessing it could not be too difficult to change. I am thinking along the lines of converting whatever is in the database to a 2d-coordinate array. Maybe that is simplifying it too much?

I'm actually about to start working on 2.5d support in GeoTools
the library we use to connect to various data stores:
http://docs.codehaus.org/display/GEOTOOLS/Partial+3D+data+support

But I don't have time to upgrade the Oracle datastore as well.
So once I'm done you can have a look at the changes I'm going to
make in PostGIS and do similar changes in Oracle NG (the old
Oracle datastore is unmaintained and will be dropped completely
in the GeoServer 2.0 series).

Cheers
Andrea

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

Nathan,

Using a view you can easily change the "3D" items to 2D. You can use an
inline function to do this. I have one posted on the Oracle forum (see
2nd to last message in the thread):

http://forums.oracle.com/forums/thread.jspa?messageID=959104&#959104

Then you can just SELECT to_2d(3Dgeometry) for those columns on your
view.

Thanks,

//SIGNED//
Bryan Hall, 38 EIG COMM GIO, L3-COM

One DoD... One Map
38 EIG/EN, Tinker AFB, OK
Lon/Lat: -97.3587, 35.4025

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, June 09, 2009 5:47 AM
To: Nathan Van der Auwera
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Oracle multiple SDO_geometry fields

Nathan Van der Auwera ha scritto:

Hi Andrea,

thank you for your explanation.

All our Oracle data is indeed 3D. I guess it is called 2,5D: it has

x,y

and a depth. Which is never shown on the map.
It is weird though, because the other objects/tables that have only 1
geometry column do draw.
I will check, because this specific table is definitely the one where

we

do not need the Z-coordinate.

Can i help in developing this part? I have the test setup (Oracle
+data). I am not very experienced in java, but that should do i guess.

I

am also guessing it could not be too difficult to change. I am

thinking

along the lines of converting whatever is in the database to a
2d-coordinate array. Maybe that is simplifying it too much?

I'm actually about to start working on 2.5d support in GeoTools
the library we use to connect to various data stores:
http://docs.codehaus.org/display/GEOTOOLS/Partial+3D+data+support

But I don't have time to upgrade the Oracle datastore as well.
So once I'm done you can have a look at the changes I'm going to
make in PostGIS and do similar changes in Oracle NG (the old
Oracle datastore is unmaintained and will be dropped completely
in the GeoServer 2.0 series).

Cheers
Andrea

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

------------------------------------------------------------------------
------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users