MCoordinateSequence and the mgeom package in Hibernate Spatial

3 messages Options
Embed this post
Permalink
Alexandre Walter Pretyman

MCoordinateSequence and the mgeom package in Hibernate Spatial

Reply Threaded More More options
Print post
Permalink
Hello list,

I've noticed that the Point Geometry instances that are loaded from the database have their CoordinateSequence implemented as MCoordinateSequence with MCoordinates inside. Is it possible to tell HibernateSpatial to use the JTS counterparts and not the ones in the org.hibernatespatial.mgeom package? I guess the other Geometry classes are affected as well.

My problem is that I need to serialize the Geometry classes to a client which runs on a web browser and my CustomSerializer for the Geometry classes only know the JTS implementations (I am using the Google Web Toolkit to write the client).

If it is not possible to tell HibernateSpatial to use only the JTS classes when loading a Geometry from the database, I guess I can convert MCoordinateSequence for a CoordinateArraySequence if I am not using the m attribute with no problems, correct? Or are there any caveats? My other options will be to write a custom serializer for the MCoordinateSequence, but that would mean I would have to replicate MCoordinateSequence on the client side with a custom implementation as well, so I would much rather transform it.

Regards,
Alexandre Pretyman

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: MCoordinateSequence and the mgeom package in Hibernate Spatial

Reply Threaded More More options
Print post
Permalink
Hi Alexandre,


On 26 Sep 2008, at 18:44, Alexandre Pretyman wrote:

> I've noticed that the Point Geometry instances that are loaded from  
> the database have their CoordinateSequence implemented as  
> MCoordinateSequence with MCoordinates inside. Is it possible to  
> tell HibernateSpatial to use the JTS counterparts and not the ones  
> in the org.hibernatespatial.mgeom package? I guess the other  
> Geometry classes are affected as well.

Currently this is not possible, but I'll add it as a new RFE in JIRA.  
I see that this could be useful.

>
> My problem is that I need to serialize the Geometry classes to a  
> client which runs on a web browser and my CustomSerializer for the  
> Geometry classes only know the JTS implementations (I am using the  
> Google Web Toolkit to write the client).
>
> If it is not possible to tell HibernateSpatial to use only the JTS  
> classes when loading a Geometry from the database, I guess I can  
> convert MCoordinateSequence for a CoordinateArraySequence if I am  
> not using the m attribute with no problems, correct? Or are there  
> any caveats? My other options will be to write a custom serializer  
> for the MCoordinateSequence, but that would mean I would have to  
> replicate MCoordinateSequence on the client side with a custom  
> implementation as well, so I would much rather transform it.
>

I think you can simply convert the MCoordinateSequence. I don't  
foresee any problems. If you run into problems, just let us know.

Regards,

Karel
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Alexandre Walter Pretyman

Re: MCoordinateSequence and the mgeom package in Hibernate Spatial

Reply Threaded More More options
Print post
Permalink
Thanks for your attention Karel, I did indeed just create a new CoordinateArraySequence from a new Coordinate[] array created from the MCoordinate[] and everything is working ok up to now.

Regards,
Alexandre Pretyman

On Tue, Sep 30, 2008 at 5:09 PM, Karel Maesen <[hidden email]> wrote:
Hi Alexandre,


On 26 Sep 2008, at 18:44, Alexandre Pretyman wrote:

> I've noticed that the Point Geometry instances that are loaded from
> the database have their CoordinateSequence implemented as
> MCoordinateSequence with MCoordinates inside. Is it possible to
> tell HibernateSpatial to use the JTS counterparts and not the ones
> in the org.hibernatespatial.mgeom package? I guess the other
> Geometry classes are affected as well.

Currently this is not possible, but I'll add it as a new RFE in JIRA.
I see that this could be useful.

>
> My problem is that I need to serialize the Geometry classes to a
> client which runs on a web browser and my CustomSerializer for the
> Geometry classes only know the JTS implementations (I am using the
> Google Web Toolkit to write the client).
>
> If it is not possible to tell HibernateSpatial to use only the JTS
> classes when loading a Geometry from the database, I guess I can
> convert MCoordinateSequence for a CoordinateArraySequence if I am
> not using the m attribute with no problems, correct? Or are there
> any caveats? My other options will be to write a custom serializer
> for the MCoordinateSequence, but that would mean I would have to
> replicate MCoordinateSequence on the client side with a custom
> implementation as well, so I would much rather transform it.
>

I think you can simply convert the MCoordinateSequence. I don't
foresee any problems. If you run into problems, just let us know.

Regards,

Karel
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users