Classcast exception linestring incompatible with multilinestring

View: New views
5 Messages — Rating Filter:   Alert me  

Classcast exception linestring incompatible with multilinestring

by Kris Geusebroek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I have an empty table in oracle spatial where sdo meta data is set to sdo_gtype 2003 etc.

In geoserver (1.7.6) config the geometry column shows up as MultiLineSting but I’m inserting linestrings from openlayers drawing layer so classcast exception is thrown.

 

I tried to add linestring to the table but geoserver config is still saying column is multilinestring.

 

How does geoserver determine this and can  override geoserver by specifying this somewhere (in info.xml for example?)

 

Thanks in advance

 

P.S. same goes for polygon table.

 

Cheers Kris

 

Met vriendelijke groet, Kind regards,

 

Kristiaan Geusebroek

Consultant

 

Logo xebia (3).tif

software development done right.png

 

Email: kgeusebroek@...

Tel: +31 (0)35 538 1921

Fax: +31 (0)35 538 1922

Mobiel: +31 (0)6 3069 7223

 

Utrechtseweg 49

1213 TL Hilversum

The Netherlands

http://www.xebia.com

 

Xebia Blog: http://blog.xebia.com/

Xebia Podcast: http://podcast.xebia.com/

 




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: Classcast exception linestring incompatible withmultilinestring

by Kris Geusebroek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

Just answering my own question for future reference!

 

The problem was that the featuretype definition showed that the geometry attribute was a multiline. This was caused by a third party script that create the spatial index for me.

Geoserver determines the type of the attribute with the following queries:

 

SELECT META.SDO_LAYER_GTYPE

  FROM ALL_INDEXES INFO

 INNER JOIN MDSYS.USER_SDO_INDEX_METADATA META

    ON INFO.INDEX_NAME = META.SDO_INDEX_NAME

 WHERE INFO.TABLE_NAME = '<TABLENAME>'

   AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';

 

SELECT META.SDO_LAYER_GTYPE

  FROM ALL_INDEXES INFO

 INNER JOIN MDSYS.ALL_SDO_INDEX_METADATA META

    ON INFO.INDEX_NAME = META.SDO_INDEX_NAME

 WHERE INFO.TABLE_NAME = '<TABLENAME>'

   AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';

 

So no matter what data is in the table and what you specified in the sdo_geom_metadata table, the index definition is leading.

 

And the third party script for generating indexes specified the SDO_LAYER_GTYPE parameter as multiline at creation time.

So overriding that to LINE did the trick.

 

Cheers Kris

 

From: Kris Geusebroek [mailto:kgeusebroek@...]
Sent: Friday, November 06, 2009 4:04 PM
To: geoserver-users
Subject: [Geoserver-users] Classcast exception linestring incompatible withmultilinestring

 

Hi,

 

I have an empty table in oracle spatial where sdo meta data is set to sdo_gtype 2003 etc.

In geoserver (1.7.6) config the geometry column shows up as MultiLineSting but I’m inserting linestrings from openlayers drawing layer so classcast exception is thrown.

 

I tried to add linestring to the table but geoserver config is still saying column is multilinestring.

 

How does geoserver determine this and can  override geoserver by specifying this somewhere (in info.xml for example?)

 

Thanks in advance

 

P.S. same goes for polygon table.

 

Cheers Kris

 

Met vriendelijke groet, Kind regards,

 

Kristiaan Geusebroek

Consultant

 

Logo xebia (3).tif

software development done right.png

 

Email: kgeusebroek@...

Tel: +31 (0)35 538 1921

Fax: +31 (0)35 538 1922

Mobiel: +31 (0)6 3069 7223

 

Utrechtseweg 49

1213 TL Hilversum

The Netherlands

http://www.xebia.com

 

Xebia Blog: http://blog.xebia.com/

Xebia Podcast: http://podcast.xebia.com/

 




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: Classcast exception linestring incompatible withmultilinestring

by Andrea Aime-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kris Geusebroek ha scritto:

> Hi,
>
>  
>
> Just answering my own question for future reference!
>
>  
>
> The problem was that the featuretype definition showed that the geometry
> attribute was a multiline. This was caused by a third party script that
> create the spatial index for me.
>
> Geoserver determines the type of the attribute with the following queries:
>
>  
>
> SELECT META.SDO_LAYER_GTYPE
>
>   FROM ALL_INDEXES INFO
>
>  INNER JOIN MDSYS.USER_SDO_INDEX_METADATA META
>
>     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
>
>  WHERE INFO.TABLE_NAME = '<TABLENAME>'
>
>    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
>
>  
>
> SELECT META.SDO_LAYER_GTYPE
>
>   FROM ALL_INDEXES INFO
>
>  INNER JOIN MDSYS.ALL_SDO_INDEX_METADATA META
>
>     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
>
>  WHERE INFO.TABLE_NAME = '<TABLENAME>'
>
>    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
>
>  
>
> So no matter what data is in the table and what you specified in the
> sdo_geom_metadata table, the index definition is leading.

Actually the index is the only place I know of where the geometry
type can be specified. Can you declare it in any other place?

Without the index declaration the column can actually contain any
kind of geometry type no?

Cheers
Andrea

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: Classcast exception linestring incompatible withmultilinestring

by Kris Geusebroek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Andrea,

I was in the assumption that the type was defined by setting the GTYPE
in the geom_metadata (2002 for linestring for example).
Could be my mistake ;-).


Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@...]
Sent: Monday, November 09, 2009 2:55 PM
To: Kris Geusebroek
Cc: geoserver-users
Subject: Re: [Geoserver-users] Classcast exception linestring
incompatible withmultilinestring

Kris Geusebroek ha scritto:
> Hi,
>
>  
>
> Just answering my own question for future reference!
>
>  
>
> The problem was that the featuretype definition showed that the
geometry
> attribute was a multiline. This was caused by a third party script
that
> create the spatial index for me.
>
> Geoserver determines the type of the attribute with the following
queries:

>
>  
>
> SELECT META.SDO_LAYER_GTYPE
>
>   FROM ALL_INDEXES INFO
>
>  INNER JOIN MDSYS.USER_SDO_INDEX_METADATA META
>
>     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
>
>  WHERE INFO.TABLE_NAME = '<TABLENAME>'
>
>    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
>
>  
>
> SELECT META.SDO_LAYER_GTYPE
>
>   FROM ALL_INDEXES INFO
>
>  INNER JOIN MDSYS.ALL_SDO_INDEX_METADATA META
>
>     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
>
>  WHERE INFO.TABLE_NAME = '<TABLENAME>'
>
>    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
>
>  
>
> So no matter what data is in the table and what you specified in the
> sdo_geom_metadata table, the index definition is leading.

Actually the index is the only place I know of where the geometry
type can be specified. Can you declare it in any other place?

Without the index declaration the column can actually contain any
kind of geometry type no?

Cheers
Andrea

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: Classcast exception linestring incompatiblewithmultilinestring

by Rahkonen Jukka :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

There is no place for GTYPE:
SQL> desc all_sdo_geom_metadata
 NAME                          
 ------------------------------
 OWNER                          
 TABLE_NAME                    
 COLUMN_NAME                    
 DIMINFO                        
 SRID

-Jukka Rahkonen-                          

> -----Alkuperäinen viesti-----
> Lähettäjä: Kris Geusebroek [mailto:kgeusebroek@...]
> Lähetetty: 9. marraskuuta 2009 16:07
> Vastaanottaja: Andrea Aime
> Kopio: geoserver-users
> Aihe: Re: [Geoserver-users] Classcast exception linestring
> incompatiblewithmultilinestring
>
> Hi Andrea,
>
> I was in the assumption that the type was defined by setting
> the GTYPE in the geom_metadata (2002 for linestring for example).
> Could be my mistake ;-).
>
>
> Cheers Kris
>
> -----Original Message-----
> From: Andrea Aime [mailto:aaime@...]
> Sent: Monday, November 09, 2009 2:55 PM
> To: Kris Geusebroek
> Cc: geoserver-users
> Subject: Re: [Geoserver-users] Classcast exception linestring
> incompatible withmultilinestring
>
> Kris Geusebroek ha scritto:
> > Hi,
> >
> >  
> >
> > Just answering my own question for future reference!
> >
> >  
> >
> > The problem was that the featuretype definition showed that the
> geometry
> > attribute was a multiline. This was caused by a third party script
> that
> > create the spatial index for me.
> >
> > Geoserver determines the type of the attribute with the following
> queries:
> >
> >  
> >
> > SELECT META.SDO_LAYER_GTYPE
> >
> >   FROM ALL_INDEXES INFO
> >
> >  INNER JOIN MDSYS.USER_SDO_INDEX_METADATA META
> >
> >     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
> >
> >  WHERE INFO.TABLE_NAME = '<TABLENAME>'
> >
> >    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
> >
> >  
> >
> > SELECT META.SDO_LAYER_GTYPE
> >
> >   FROM ALL_INDEXES INFO
> >
> >  INNER JOIN MDSYS.ALL_SDO_INDEX_METADATA META
> >
> >     ON INFO.INDEX_NAME = META.SDO_INDEX_NAME
> >
> >  WHERE INFO.TABLE_NAME = '<TABLENAME>'
> >
> >    AND REPLACE(meta.sdo_column_name, '"') = '<GEOMETRYCOLUMN>';
> >
> >  
> >
> > So no matter what data is in the table and what you
> specified in the
> > sdo_geom_metadata table, the index definition is leading.
>
> Actually the index is the only place I know of where the
> geometry type can be specified. Can you declare it in any other place?
>
> Without the index declaration the column can actually contain
> any kind of geometry type no?
>
> Cheers
> Andrea
>
> --
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
> --------------------------------------------------------------
> ----------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day trial. Simplify your report design,
> integration and deployment - and focus on what you do best,
> core application coding. Discover what's new with Crystal
> Reports now.  http://p.sf.net/sfu/bobj-july 
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@...
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users