GeoServer considerations for using MySQL data sources

Source: Internet
Author: User

Because the database used in the project is MySQL, GeoServer also needs to use the MySQL data source in order to ensure data synchronization.

(The GIS service engine also goes to GeoServer because ArcGIS does not support MySQL)


GeoServer's Open source nature, decided that he will inevitably have bugs, fortunately there is source code, repair is not trouble.


BUG 1:

The configured Layer data space field cannot have a null value, otherwise it throws an error that the boundary range cannot be evaluated. Causes the layer to be completely unusable.

Solution:

Increase the default Value property on the table layer's spatial field.

The view requires an increase in function conversions such as:

Create VIEW v_points as SELECT coalesce (Pt. Geom,st_geomfromtext (' point (0 0) ', 4326)) as GEOM from POINTS

BUG 2:

Page search is not the same, WFS query geoserver original startindex,maxfeatures page search is really useful. However, in the MySQL plug-in, there will be data query results inconsistent or simply 0 results.

The root cause is that when you do SQL mapping, the filter where condition is not written to the query statement. The modification method is also very simple, find Gt-jdbc-mysql-version.jar, modify the Mysqlfiltertosql.java source file. It is estimated that the original author's negligence. Only spatial query filtering was added, and general DBMS SQL filtering was ignored.

Caps.addall (sqldialect.base_dbms_capabilities)
  @Override     protected filtercapabilities createfiltercapabilities ()   {        //mysql does not actually implement  all of the special functions         Filtercapabilities caps = super.createfiltercapabilities ();         caps.addall (sqldialect.base_dbms_capabilities);         Caps.addtype (Bbox.class);         caps.addtype (Contains.class);         //caps.addtype (Crosses.class);         caps.addtype (Disjoint.class);         caps.addtype ( Equals.class);         caps.addtype (Intersects.class);         caps.addType (Overlaps.class);         caps.addtype (Touches.class);         caps.addtype (Within.class);         caps.addtype (Beyond.class);                 return caps;    }

BUG 3:

The polygon search result becomes a rectangular search. Cause polygon Search to be a misnomer.

Solution:

This should belong to MySQL itself. It is said that the new version has been repaired and remains to be verified

GeoServer considerations for using MySQL data sources

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.