MySQL Linestring or Polygon Selection Issues

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

MySQL Linestring or Polygon Selection Issues

pplim87
Hi,

When i select my linestring layer then near linestring get highlighted in
place of current selection. Polygon have this problem as well. Point layer
no issue, worked like a charm.

If anyone have idea or suggestion then please help me.

Thank you.

MapGuide Open Source 3.1.2
MapGuide Maestro 6.0m10
MySQL MariaDB 10.4.6






--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
This is probably the long-standing limitation in the MySQL FDO provider that
intersection queries based on the bbox of the input geometry and not based
on the actual shape of the input geometry.

There's a long standing ticket about this:
https://trac.osgeo.org/fdo/ticket/893

If you are willing to help test, I might have some time this/next week to
fix this long-standing limitation once and for all.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
Yes Jackie,

I'm willing to help you test, let me know once u fixed this long-standing
limitation. Thank you.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
I've put up a patched MySQL FDO provider for MGOS 3.1.2 (64-bit windows)
which enables the full set of spatial operations (ST_Intersects, etc) for
MySQL 5.6 and above.

http://download.osgeo.org/mapguide/patches/MySQLProvider_MGOS312/MySQLProvider_MGOS_312_x64.zip

Give it a go and let me know how it goes.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
Hi, i overwrite the file MySQLProvider.dll from
MySQLProvider_MGOS_312_x64.zip and re-add all resources : feature source,
layers, maps, web layout through Mapguide Maestro. Linestring selection
problem still persists.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Do you have a screenshot of what the selection looks like (relative to the
position of your mouse pointer where you clicked it)? I can't picture the
problem.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
<http://osgeo-org.1560.x6.nabble.com/file/t385420/Untitled.png>

Hi, Red line is Linestring which loaded from MySQL database.

I used this patched and overwrite my old MySQLProvider.dll
http://download.osgeo.org/mapguide/patches/MySQLProvider_MGOS312/MySQLProvider_MGOS_312_x64.zip
<http://download.osgeo.org/mapguide/patches/MySQLProvider_MGOS312/MySQLProvider_MGOS_312_x64.zip>  

If i move my mouse cursor and click within the blue box, it still select the
red line, i want to select the red line based on the actual line shape, not
outside of the actual line shape.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Thanks for a concrete visual example.

Can I just confirm that after applying the patched dll when you go to the
mapagent test pages and do a GETCAPABILITIES request for the OSGeo.MySQL
provider with the connection string pointing to your MySQL/MariaDB server
that the capabilities XML response contains the following XML fragment:

<Spatial>
<Operation>EnvelopeIntersects</Operation>
<Operation>Intersects</Operation>
<Operation>Disjoint</Operation>
<Operation>Inside</Operation>
<Operation>Contains</Operation>
<Operation>CoveredBy</Operation>
<Operation>Equals</Operation>
<Operation>Overlaps</Operation>
<Operation>Within</Operation>
<Operation>Crosses</Operation>
<Operation>Touches</Operation>
</Spatial>

?

Because this is the expected capabilities I am getting from this patched
provider.

An example MySQL connection string would look like the following:

If your MySQL/MariaDB server is on 192.168.0.5 and your root password is
"secureme", the connection string for this would be:

Service=192.168.0.5;Username=root;Password=secureme

Let me know if you are getting the same capabilities XML fragment.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
This post was updated on .
Hi, i open http://localhost:8008/mapguide/mapagent/index.html 
I navigate to Feature Tab > GetCapabilities and enter

Operation: GETPROVIDERCAPABILITIES
Version: 2.0.0
Locale: en
Client Agent: MapGuide Developer
Provider: OSGeo.MySQL
Connection String: Service=localhost;Username=root;Password=password;



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Excuse the poor default browser output of XML content, you should:
 
 1. Save that frame content out to an XML file, format it and try to locate
the fragment I'm referring.
-OR-
 2. Open the GetCapbabilities link into a new browser window and submit from
there. Chrome should be able to auto-format the XML from there.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
Done. This is the XML fragment generated from my computer, only display 2 out
of 11 operation.

<Spatial>
              <Operation>EnvelopeIntersects</Operation>
              <Operation>Intersects</Operation>
</Spatial>

<http://osgeo-org.1560.x6.nabble.com/file/t385420/spatial.png>




--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Ok, that is strange. I'm expecting the full spatial capability suite if you
feed it a valid connection string.

Perhaps the MySQL >= 5.6 version check is incorrect for MariaDB. I'll have
to spin up an actual MariaDB instance to check (I had been testing with
MySQL 5.6)

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
No wonder i'm still unable to select the actual line based on the line shape.

I think below this link is the correct way to check the MySQL server version
for MariaDB?
https://mariadb.com/kb/en/library/mysql_get_server_version/

I hope this information useful for you.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
That is the version number I'm using, and I was going on the (mostly valid)
assumption that:

If you're using MariaDB 10.4.3, then our check of

10.4.3 >= 5.6.0 -> (10* 10000 + 4* 100 + 3) >= (5 * 10000 + 6 * 100 + 0)

Should still hold true and the provider will report the full spatial
capability suite.

Anyways debugging with a spun up MariaDB will tell me if I am telling the
truth.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
Hi Jackie, I tried my another computer installed MySQL 5.6, 5.7 & 8.0, i can
get the full spatial
capability suite from *GetCapabilities*

Obviously the MySQL version check is incorrect for MariaDB, can you help me
with this?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Perhaps you could help me help you.

Yes, the version check done by the provider is incorrect.

I spun up a MariaDB 10.4 docker container and when I talk to it with the
MySQL provider get the following information:

mysql_get_server_version() returns 50505
mysql_get_server_info() returns
"5.5.5-10.4.10-MariaDB-1:10.4.10+maria~bionic"

The provider actually calls mysql_get_server_info() for the version check
(why it does this instead of calling mysql_get_server_version() I do not
know) and parses the version string within. The version parsed here is also
50505, so regardless of how we get the version number, it results in the
same value of 50505.

So what is 5.5.5 in this case? MariaDB 10.4 supports the feature set of
MySQL 5.5.5? Why do both methods insist on reporting this version number
instead of 10.4.10?

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
Answering my own question: "5.5.5-" is a replication version hack:

https://stackoverflow.com/questions/56601304/what-does-the-first-part-of-the-mariadb-version-string-mean/56607492

So this tells me that our version detection needs to detect the presence of
this "5.5.5-" prefix and adjust accordingly.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
In reply to this post by pplim87
I've uploaded a new version of this provider with (hopefully) fixed version
checking for MariaDB.

http://download.osgeo.org/mapguide/patches/MySQLProvider_MGOS312/MySQLProvider_MGOS_312_x64_v2.zip

I've tested against MySQL 5.6 and MariaDB 10.4. Both report full spatial
capabilities and selects your example line string correctly. I hope you get
the same results as I have.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

pplim87
Hi Jackie,

Oh my God, It WORKS!!! Appreciate the information and guide me you have
given, as well as the information you have shared with me. Again, thank you
so much. I sincerely appreciate your helped.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MySQL Linestring or Polygon Selection Issues

Jackie Ng
That's great news. I'll put this in the post-release patches section for the
3.1.2 release notes when I have time.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users