On Fri, Mar 18, 2011 at 4:34 AM, brian youngblood <[email protected]> wrote: > > I'm new to layers based on sql statements and the rest api, and may have > likely missed something obvious. Any thoughts our suggestions would be > greatly appreciated. Two part question: > 1) I'm trying to create a layer based on a sql view using mysql, but the > geometry type is responding as a byte[]. I'm testing with a simple select > statement as "select * from `counties`" Adding the layer by selecting the > table directly works fine. Here is my table description. Odd that it works > directly, but doing so based on a sql statement produces different results. > > CREATE TABLE `counties` ( > `id` int(10) unsigned NOT NULL, > `county_name` varchar(32) NOT NULL DEFAULT '', > `state_name` varchar(25) NOT NULL DEFAULT '', > `state_initials` char(2) DEFAULT NULL, > `member_count` mediumint(9) DEFAULT '0', > `percentage` int(11) DEFAULT '0', > `state_fips` char(2) NOT NULL DEFAULT '', > `county_fips` char(3) NOT NULL DEFAULT '', > `fips` varchar(10) NOT NULL DEFAULT '0', > `nces_fips` varchar(10) DEFAULT NULL, > `county_shape` geometry NOT NULL DEFAULT '', > `county_center` point NOT NULL DEFAULT '', > UNIQUE KEY `fips` (`fips`), > SPATIAL KEY `geo` (`county_shape`), > KEY `state_initials` (`state_initials`), > KEY `county_fips` (`county_fips`) > ) ENGINE=MyISAM AUTO_INCREMENT=3142 DEFAULT CHARSET=latin1; > 2) Eventually I'd like to create this layer using a more complex sql > statement using the REST api. Still digging into that, but would I just need > to wrap the sql statement in a xml string? > Also looking forward to trying out the wms pass-thru to the GeoWebCache. The > improvements there look awesome. Thanks for the help!
As far as I can see the sql view support in mysql has never been tested, the test harness in geotools does not have that test class, only h2, postgis and oracle have it (but 90% of the code is shared among databases, so it's likely it's something quite specific to mysql). The sql view code guesses the types of the various columns out of a resultset metadata, it may be that the mysql jdbc driver is buggy and returning the wrong type for the geometry column, or that the code needs to be amended to take into account some mysql oddity. It would help to have some developer that actually uses mysql for spatial data, afaik Justin is trying to maintain the mysql store out of his good hearth but he's not even using mysql regularly (props to him, but having someone else that actually uses mysql day in/day out to help out in development would be a step forward) Cheers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
