Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Martin throwing HTTP 500 on complex geometry types #215

Closed
christianversloot opened this issue Jun 4, 2021 · 2 comments · Fixed by #218
Closed

Martin throwing HTTP 500 on complex geometry types #215

christianversloot opened this issue Jun 4, 2021 · 2 comments · Fixed by #218

Comments

@christianversloot
Copy link
Contributor

I am currently trying to implement a PoC using Martin with Leaflet VectorGrid for visualizing the Basisregistratie Grootschalige Topografie (BGT), which is a standardized dataset representing a variety of objects in the Dutch public area.

I am using the following POSTGIS dump for the PoC which represents a small slice from the entire BGT (all object types in one area): https://geocatalogus.nl/dataset/bgt-imgeo-database-dumps/resource/1ae231d7-5753-4e3b-afe8-e1b2636c474d

Martin finds all table sources nicely:

chris@DESKTOP-PJKJ0UE:/mnt/c/Users/chris/Downloads/martin-Windows-x86_64$ ./martin.exe postgres://postgres:pgpg@localhost:5433/bgt
[2021-06-04T08:10:13Z INFO  martin] Starting martin v0.5.0
[2021-06-04T08:10:13Z INFO  martin] Config is not set, scanning database
[2021-06-04T08:10:14Z INFO  martin] Connected to postgres://postgres:pgpg@localhost:5433/bgt
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bak table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bakactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bakactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.begroeidterreindeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bord table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bordactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.bordactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.buurt table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.buurtactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.buurtactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.functioneelgebied table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.functioneelgebiedactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.functioneelgebiedactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.gebouwinstallatie table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.gebouwinstallatieactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.gebouwinstallatieactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.installatie table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.installatieactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.installatieactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kast table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kastactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kastactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.kunstwerkdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.mast table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.mastactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.mastactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.onbegroeidterreindeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwaterdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwaterdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwaterdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ondersteunendwegdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ongeclassificeerdobject table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ongeclassificeerdobjectactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.ongeclassificeerdobjectactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimte table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimteactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimteactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimtelabel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimtelabelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.openbareruimtelabelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overbruggingsdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overbruggingsdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overbruggingsdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigbouwwerk table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigbouwwerkactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigbouwwerkactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheiding table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheiding table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheidingactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheidingactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheidingactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.overigescheidingactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.paal table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.paalactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.paalactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pand_nummeraanduiding table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pand_nummeraanduidingactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pand_nummeraanduidingactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pandactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.pandactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.plaatsbepalingspunt table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.put table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.putactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.putactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheiding table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheiding table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheidingactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheidingactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheidingactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.scheidingactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensor table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensor table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensoractueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensoractueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensoractueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.sensoractueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.spoor table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.spooractueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.spooractueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.stadsdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.stadsdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.stadsdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.straatmeubilair table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.straatmeubilairactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.straatmeubilairactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.tunneldeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.tunneldeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.tunneldeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobject table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobject table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobject table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.vegetatieobjectactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselement table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselement table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselementactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselementactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselementactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterinrichtingselementactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterschap table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterschapactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.waterschapactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeelactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wegdeelactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselement table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselement table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselement table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.weginrichtingselementactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wijk table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wijkactueel table source
[2021-06-04T08:10:14Z INFO  martin::table_source] Found latest.wijkactueelbestaand table source
[2021-06-04T08:10:14Z INFO  martin::function_source] Found latest.function_source function source
[2021-06-04T08:10:14Z INFO  martin] Martin has been started on 0.0.0.0:3000.

(side note: although Martin apparently finds many table sources twice (? no idea why), this cannot be the cause of the issue following next, because it also occurs with the latest.pand table source, which is found only once.)

It works nicely implementing latest.pand_nummeraanduidingactueel (house numbers), which has a POINT geometry_type:

image

{
    "id": "latest.pand_nummeraanduidingactueel",
    "schema": "latest",
    "table": "pand_nummeraanduidingactueel",
    "id_column": null,
    "geometry_column": "geometrie_nummeraanduiding",
    "srid": 28992,
    "extent": 4096,
    "buffer": 64,
    "clip_geom": true,
    "geometry_type": "POINT",
    "properties": {
      "relatievehoogteligging": "int4",
      "lokaalid": "varchar",
      "identificatiebagvbolaagstehuisnummer": "varchar",
      "nummeraanduidingtekst": "varchar",
      "lv_publicatiedatum": "timestamptz",
      "objectbegintijd": "date",
      "objecteindtijd": "date",
      "namespace": "varchar",
      "plus_status": "varchar",
      "tijdstipregistratie": "timestamptz",
      "nummeraanduidinghoek": "float8",
      "bronhouder": "varchar",
      "inonderzoek": "bool",
      "ogc_fid": "int4",
      "gml_id": "varchar",
      "bgt_status": "varchar",
      "identificatiebagpnd": "varchar",
      "eindregistratie": "timestamptz",
      "identificatiebagvbohoogstehuisnummer": "varchar"
    }
  },

However, when using latest.wegdeelactueel (road section surfaces) and latest.pand (building surfaces) a HTTP 500 error is thrown and nothing is displayed:

VM375:1 GET http://localhost:3000/latest.pand/16/33817/21620.pbf net::ERR_ABORTED 500 (Internal Server Error)

What I noticed is that these have compound/set types like CURVEPOLYGON and MULTISURFACE

{
    "id": "latest.wegdeelactueel",
    "schema": "latest",
    "table": "wegdeelactueel",
    "id_column": null,
    "geometry_column": "geometrie_vlak",
    "srid": 28992,
    "extent": 4096,
    "buffer": 64,
    "clip_geom": true,
    "geometry_type": "CURVEPOLYGON",
    "properties": {
      "geometrie_kruinlijn": "geometry",
      "objecteindtijd": "date",
      "gml_id": "varchar",
      "relatievehoogteligging": "int4",
      "bgt_fysiekvoorkomen": "varchar",
      "lv_publicatiedatum": "timestamptz",
      "namespace": "varchar",
      "plus_functie": "varchar",
      "wegdeeloptalud": "bool",
      "plus_fysiekvoorkomen": "varchar",
      "ogc_fid": "int4",
      "tijdstipregistratie": "timestamptz",
      "bronhouder": "varchar",
      "bgt_functie": "varchar",
      "inonderzoek": "bool",
      "plus_status": "varchar",
      "eindregistratie": "timestamptz",
      "objectbegintijd": "date",
      "bgt_status": "varchar",
      "lokaalid": "varchar"
    }
{
    "id": "latest.pand",
    "schema": "latest",
    "table": "pand",
    "id_column": null,
    "geometry_column": "geometrie_vlak",
    "srid": 28992,
    "extent": 4096,
    "buffer": 64,
    "clip_geom": true,
    "geometry_type": "MULTISURFACE",
    "properties": {
      "ogc_fid": "int4",
      "relatievehoogteligging": "int4",
      "inonderzoek": "bool",
      "gml_id": "varchar",
      "identificatiebagpnd": "varchar",
      "objecteindtijd": "date",
      "lokaalid": "varchar",
      "bronhouder": "varchar",
      "plus_status": "varchar",
      "namespace": "varchar",
      "bgt_status": "varchar",
      "eindregistratie": "timestamptz",
      "lv_publicatiedatum": "timestamptz",
      "tijdstipregistratie": "timestamptz",
      "objectbegintijd": "date"
    }
  }

For some reason I am not seeing any logs whatsoever related to the error, despite performing the following:

  1. In the docker based version, starting the container with the RUST_LOG export provided as an env variable (-e ...)
  2. In the windows based version (running with WSL2), first export-ing the RUST_LOG variable.

Martin thus seems to be struggling with these types :)

I have thought about this a bit more and when converting my data into GeoJSON format before (ultimately failed; nobody wants to download a 250MB GeoJSON every time they use the app) I had to use https://postgis.net/docs/ST_CurveToLine.html first before I could use ST_AsGeoJSON. One possible fix is to create a function source that does this for me and then using that in Leaflet.

However, it can still be a good idea to support these more complex/compound types out of the box if possible :)

Thanks!

@christianversloot
Copy link
Contributor Author

Can confirm that the issue relates to the complex geometry types.

The base function source (changed into EPSG:28992 format which I use) does not work, providing these errors:

CREATE OR REPLACE FUNCTION latest.function_source(z integer, x integer, y integer, query_params json) RETURNS bytea AS $$
DECLARE
  mvt bytea;
BEGIN
  SELECT INTO mvt ST_AsMVT(tile, 'latest.function_source', 4096, 'geom') FROM (
    SELECT
      ST_AsMVTGeom(ST_Transform(geom, 3857), TileBBox(z, x, y, 3857), 4096, 64, true) AS geom
    FROM latest."wegdeel"
    WHERE geom && TileBBox(z, x, y, 28992)
  ) as tile WHERE geom IS NOT NULL;

  RETURN mvt;
END
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;
2021-06-07 14:34:25.982 CEST [25232] ERROR:  lwgeom_get_basic_type: Invalid type (10)

It can be fixed by wrapping the geom in the column with ST_CurveToLine, which "[c]onverts a CIRCULAR STRING to regular LINESTRING or CURVEPOLYGON to POLYGON or MULTISURFACE to MULTIPOLYGON" (https://postgis.net/docs/ST_CurveToLine.html):

CREATE OR REPLACE FUNCTION latest.function_source(z integer, x integer, y integer, query_params json) RETURNS bytea AS $$
DECLARE
  mvt bytea;
BEGIN
  SELECT INTO mvt ST_AsMVT(tile, 'latest.function_source', 4096, 'geom') FROM (
    SELECT
      ST_AsMVTGeom(ST_Transform(ST_CurveToLine(geom), 3857), TileBBox(z, x, y, 3857), 4096, 64, true) AS geom
    FROM latest."wegdeel"
    WHERE geom && TileBBox(z, x, y, 28992)
  ) as tile WHERE geom IS NOT NULL;

  RETURN mvt;
END
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;

This gives me the roads I need:

image

@christianversloot
Copy link
Contributor Author

Question: as for simple geometries spatial equality seems to remain preserved, can't we include ST_CurveToLine(...) in Martin by default?

select ST_Equals(ST_CurveToLine(ST_GeomFromText('POINT(0 0)')), ST_GeomFromText('POINT(0 0)')) LIMIT 1;
select ST_Equals(ST_CurveToLine(ST_GeomFromText('LINESTRING(0 0, 1 1, 2 2)')), ST_GeomFromText('LINESTRING(0 0, 1 1, 2 2)')) LIMIT 1;
select ST_Equals(ST_CurveToLine(ST_GeomFromText('MULTILINESTRING((-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932))')), ST_GeomFromText('MULTILINESTRING((-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932))')) LIMIT 1;
select ST_Equals(ST_CurveToLine(ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,
-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))')), ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,
-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))')) LIMIT 1;
select ST_Equals(ST_CurveToLine(ST_GeomFromText('MULTIPOLYGON(((-71.1031880899493 42.3152774590236,
-71.1031627617667 42.3152960829043,-71.102923838298 42.3149156848307,
-71.1023097974109 42.3151969047397,-71.1019285062273 42.3147384934248,
-71.102505233663 42.3144722937587,-71.10277487471 42.3141658254797,
-71.103113945163 42.3142739188902,-71.10324876416 42.31402489987,
-71.1033002961013 42.3140393340215,-71.1033488797549 42.3139495090772,
-71.103396240451 42.3138632439557,-71.1041521907712 42.3141153348029,
-71.1041411411543 42.3141545014533,-71.1041287795912 42.3142114839058,
-71.1041188134329 42.3142693656241,-71.1041112482575 42.3143272556118,
-71.1041072845732 42.3143851580048,-71.1041057218871 42.3144430686681,
-71.1041065602059 42.3145009876017,-71.1041097995362 42.3145589148055,
-71.1041166403905 42.3146168544148,-71.1041258822717 42.3146748022936,
-71.1041375307579 42.3147318674446,-71.1041492906949 42.3147711126569,
-71.1041598612795 42.314808571739,-71.1042515013869 42.3151287620809,
-71.1041173835118 42.3150739481917,-71.1040809891419 42.3151344119048,
-71.1040438678912 42.3151191367447,-71.1040194562988 42.3151832057859,
-71.1038734225584 42.3151140942995,-71.1038446938243 42.3151006300338,
-71.1038315271889 42.315094347535,-71.1037393329282 42.315054824985,
-71.1035447555574 42.3152608696313,-71.1033436658644 42.3151648370544,
-71.1032580383161 42.3152269126061,-71.103223066939 42.3152517403219,
-71.1031880899493 42.3152774590236)),
((-71.1043632495873 42.315113108546,-71.1043583974082 42.3151211109857,
-71.1043443253471 42.3150676015829,-71.1043850704575 42.3150793250568,-71.1043632495873 42.315113108546)))')), ST_GeomFromText('MULTIPOLYGON(((-71.1031880899493 42.3152774590236,
-71.1031627617667 42.3152960829043,-71.102923838298 42.3149156848307,
-71.1023097974109 42.3151969047397,-71.1019285062273 42.3147384934248,
-71.102505233663 42.3144722937587,-71.10277487471 42.3141658254797,
-71.103113945163 42.3142739188902,-71.10324876416 42.31402489987,
-71.1033002961013 42.3140393340215,-71.1033488797549 42.3139495090772,
-71.103396240451 42.3138632439557,-71.1041521907712 42.3141153348029,
-71.1041411411543 42.3141545014533,-71.1041287795912 42.3142114839058,
-71.1041188134329 42.3142693656241,-71.1041112482575 42.3143272556118,
-71.1041072845732 42.3143851580048,-71.1041057218871 42.3144430686681,
-71.1041065602059 42.3145009876017,-71.1041097995362 42.3145589148055,
-71.1041166403905 42.3146168544148,-71.1041258822717 42.3146748022936,
-71.1041375307579 42.3147318674446,-71.1041492906949 42.3147711126569,
-71.1041598612795 42.314808571739,-71.1042515013869 42.3151287620809,
-71.1041173835118 42.3150739481917,-71.1040809891419 42.3151344119048,
-71.1040438678912 42.3151191367447,-71.1040194562988 42.3151832057859,
-71.1038734225584 42.3151140942995,-71.1038446938243 42.3151006300338,
-71.1038315271889 42.315094347535,-71.1037393329282 42.315054824985,
-71.1035447555574 42.3152608696313,-71.1033436658644 42.3151648370544,
-71.1032580383161 42.3152269126061,-71.103223066939 42.3152517403219,
-71.1031880899493 42.3152774590236)),
((-71.1043632495873 42.315113108546,-71.1043583974082 42.3151211109857,
-71.1043443253471 42.3150676015829,-71.1043850704575 42.3150793250568,-71.1043632495873 42.315113108546)))')) LIMIT 1;
select ST_Equals(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,220227 150406)')), ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,220227 150406)')) LIMIT 1;

These all resolve to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant