GeoTools-MySQL

6 messages Options
Embed this post
Permalink
iceDice

GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
Hello,

I am interested does GeoTools renderer use spatial indexes from MySQL MyISAM tables when
rendering spatial data from MySQL database?
I am asking this because we want to use MySQL InnoDB tables both for spatial and non-spatial
data. Will GeoTools renderer be slower in this case in contrast if we had used MySQL MyISAM
tables for spatial-data?

Best regards.
aaime

Re: GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
iceDice ha scritto:

> Hello,
>
> I am interested does GeoTools renderer use spatial indexes from MySQL MyISAM
> tables when
> rendering spatial data from MySQL database?
> I am asking this because we want to use MySQL InnoDB tables both for spatial
> and non-spatial
> data. Will GeoTools renderer be slower in this case in contrast if we had
> used MySQL MyISAM
> tables for spatial-data?

Last time I checked (almost two years ago) MySQL supported spatial data
in MyISAM tables only.
Not sure if things changed in the meantime

Cheers
Andrea


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
iceDice

Re: GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
Hi Andrea,

I know that is possible to use InnoDB tables for spatial data, however without
support for spatial indexes.
What i want to know is does it make impact on GeoTools renderer.
I mean does renderer uses those spatial indexes from MyISAM tables or
maybe makes own spatial indexes?

Best regards.

aaime wrote:
iceDice ha scritto:
> Hello,
>
> I am interested does GeoTools renderer use spatial indexes from MySQL MyISAM
> tables when
> rendering spatial data from MySQL database?
> I am asking this because we want to use MySQL InnoDB tables both for spatial
> and non-spatial
> data. Will GeoTools renderer be slower in this case in contrast if we had
> used MySQL MyISAM
> tables for spatial-data?

Last time I checked (almost two years ago) MySQL supported spatial data
in MyISAM tables only.
Not sure if things changed in the meantime

Cheers
Andrea


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Jody Garnett-2

Re: GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
GeoTools is probably just issuing SQL statements to MySQL - you will  
need to check if those SQL statements speed up if a spatial index is  
available. For PostGIS the same statement will work for both a table  
with a spatial index and for a table without one....

GeoTools will not make its own spatial index.

Jody

On 28/09/2009, at 6:44 PM, iceDice wrote:

>
> Hi Andrea,
>
> I know that is possible to use InnoDB tables for spatial data, however
> without
> support for spatial indexes.
> What i want to know is does it make impact on GeoTools renderer.
> I mean does renderer uses those spatial indexes from MyISAM tables or
> maybe makes own spatial indexes?
>
> Best regards.
>
>
> aaime wrote:
>>
>> iceDice ha scritto:
>>> Hello,
>>>
>>> I am interested does GeoTools renderer use spatial indexes from  
>>> MySQL
>>> MyISAM
>>> tables when
>>> rendering spatial data from MySQL database?
>>> I am asking this because we want to use MySQL InnoDB tables both for
>>> spatial
>>> and non-spatial
>>> data. Will GeoTools renderer be slower in this case in contrast if  
>>> we had
>>> used MySQL MyISAM
>>> tables for spatial-data?
>>
>> Last time I checked (almost two years ago) MySQL supported spatial  
>> data
>> in MyISAM tables only.
>> Not sure if things changed in the meantime
>>
>> Cheers
>> Andrea
>>
>>
>> --
>> Andrea Aime
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry® Developer Conference in SF,  
>> CA
>> is the only developer event you need to attend this year. Jumpstart  
>> your
>> developing skills, take BlackBerry mobile applications to market  
>> and stay
>> ahead of the curve. Join us from November 9-12, 2009. Register
>> now!
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> Geotools-gt2-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/GeoTools-MySQL-tp3728017p3728255.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9-12, 2009. Register  
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Geotools-gt2-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
aaime

Re: GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
In reply to this post by iceDice
iceDice ha scritto:
> Hi Andrea,
>
> I know that is possible to use InnoDB tables for spatial data, however
> without
> support for spatial indexes.
> What i want to know is does it make impact on GeoTools renderer.
> I mean does renderer uses those spatial indexes from MyISAM tables or
> maybe makes own spatial indexes?

The renderer just makes bbox queries to the datastore, which in
turn issues sql that encodes the bbox filter in whatever is the syntax
used by MySQL.
I think it should work, but not having a spatial index will severely
limit the ability to scale to bigger amounts of data thought.

Cheers
Andrea


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
iceDice

Re: GeoTools-MySQL

Reply Threaded More More options
Print post
Permalink
Hello,

Thank you Andrea and Jody.
I will test it, however i have problems to show data from MySQL db on map.

I try to do that on following way:

Map params = new HashMap();
params.put("dbtype", "mysql");
params.put("host", "localhost");
params.put("port", new Integer(3306));
params.put("database", "my_db");
params.put("user", "root");

MySQLDataStoreFactory mySQLFactory = new MySQLDataStoreFactory();
MySQLDataStore mySQLDatastore = (MySQLDataStore) mySQLFactory.createDataStore(params);
// Prepare feature sources
fsStreets = mySQLDatastore.getFeatureSource("streets");

When i tried to display layer on JMapFrame i can't see anything. Values for map bounds in JMapFrame
Status bar (min and max Lat and Lon) are all NaN.

I check ogrinfo MySQL:my_db,user=root streets -so and get:
INFO: Open of `MySQL:my_db,user=root' using driver `MySQL' successful.
Layer name: streets
Geometry: Line String
Feature Count: 930
Extent: (19.559141, 46.026719) - (19.801404, 46.168960)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
FID Column = OGR_FID
Geometry Column = SHAPE
name: String (254.0)
oneway: String (254.0)
type: String (1.0)

What can be problem here? I make table in MySQL from shapefile without .prj file with
following command: ogr2ogr -f "MySQL" MYSQL:"my_db,host=localhost,user=root,port=3306" -nln "streets" -a_srs "EPSG:4326" streets.shp

Also i try all of this with Postgis and everything works perfect.

I hope so someone can help me about this.

Best regards.


aaime wrote:
iceDice ha scritto:
> Hi Andrea,
>
> I know that is possible to use InnoDB tables for spatial data, however
> without
> support for spatial indexes.
> What i want to know is does it make impact on GeoTools renderer.
> I mean does renderer uses those spatial indexes from MyISAM tables or
> maybe makes own spatial indexes?

The renderer just makes bbox queries to the datastore, which in
turn issues sql that encodes the bbox filter in whatever is the syntax
used by MySQL.
I think it should work, but not having a spatial index will severely
limit the ability to scale to bigger amounts of data thought.

Cheers
Andrea


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users