[spatialite] 03/14: Imported Upstream version 4.4.0~rc0+20160424-f73a4c7295

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Thu May 5 18:44:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch experimental
in repository spatialite.

commit d4759f7b0f5c673ea28555115969cadaa4a3ea5f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu May 5 19:36:47 2016 +0200

    Imported Upstream version 4.4.0~rc0+20160424-f73a4c7295
---
 .fslckout                                          |  Bin 0 -> 18578432 bytes
 Android_4.4.0.mk                                   |   37 +
 Makefile.am                                        |   11 +-
 Makefile.in                                        |   10 +-
 amalgamate.c                                       | 1140 +++++++++
 compile                                            |  348 +--
 config-msvc.h                                      |    6 +-
 config.h.in                                        |   20 +-
 configure                                          |  268 +-
 configure.ac                                       |   71 +-
 examples/HOW-TO-BUILD.txt                          |  137 +
 makefile.vc                                        |    3 +-
 makefile_mod.vc                                    |  116 +
 nmake.opt                                          |    2 +-
 nmake_mod.opt                                      |   12 +
 spatialite-4.4.0.mk                                |  210 ++
 spatialite-sql-latest.html                         |  311 ++-
 src/connection_cache/alloc_cache.c                 |  176 +-
 src/cutter/gaia_cutter.c                           |   60 +-
 src/dxf/dxf_load_distinct.c                        |   10 +-
 src/dxf/dxf_loader.c                               |    2 +-
 src/dxf/dxf_parser.c                               |    4 +-
 src/dxf/dxf_writer.c                               |    4 +
 src/gaiaaux/gg_sqlaux.c                            |    4 +-
 src/gaiaaux/gg_utf8.c                              |   14 +-
 src/gaiageo/Makefile.am                            |    2 +-
 src/gaiageo/Makefile.in                            |   20 +-
 src/gaiageo/flex/ewktLexer.l                       |    2 +-
 src/gaiageo/flex/geoJsonLexer.l                    |    2 +-
 src/gaiageo/flex/gmlLexer.l                        |    2 +-
 src/gaiageo/flex/kmlLexer.l                        |    2 +-
 src/gaiageo/flex/vanuatuLexer.l                    |    2 +-
 src/gaiageo/gg_advanced.c                          |    3 +-
 src/gaiageo/gg_extras.c                            |    7 +
 src/gaiageo/gg_geoJSON.c                           |    6 +
 src/gaiageo/gg_geodesic.c                          |    4 -
 src/gaiageo/gg_geoscvt.c                           |    2 +-
 src/gaiageo/gg_gml.c                               |  143 +-
 src/gaiageo/gg_kml.c                               |   18 +-
 src/gaiageo/gg_lwgeom.c                            | 2529 -------------------
 src/gaiageo/gg_relations.c                         |   28 +-
 src/gaiageo/gg_relations_ext.c                     |   24 +-
 src/gaiageo/gg_rttopo.c                            | 2613 ++++++++++++++++++++
 src/gaiageo/gg_transform.c                         |   28 +
 src/gaiageo/gg_wkt.c                               |    8 +-
 src/gaiageo/gg_xml.c                               |   20 +-
 src/gaiageo/lex.Ewkt.c                             |  883 ++++---
 src/gaiageo/lex.GeoJson.c                          | 1017 ++++----
 src/gaiageo/lex.Gml.c                              |  632 ++---
 src/gaiageo/lex.Kml.c                              |  632 ++---
 src/gaiageo/lex.VanuatuWkt.c                       | 1159 +++++----
 src/headers/spatialite.h                           |   29 +
 src/headers/spatialite/gaia_topology.h             |  110 +-
 src/headers/spatialite/gg_advanced.h               |  233 +-
 src/headers/spatialite_private.h                   |   55 +-
 src/md5/gaia_md5.c                                 |    2 +-
 src/md5/md5.c                                      |  369 +--
 src/shapefiles/shapefiles.c                        |  354 ++-
 src/shapefiles/validator.c                         |   46 +-
 src/spatialite/metatables.c                        |   12 +-
 src/spatialite/se_helpers.c                        |   43 +-
 src/spatialite/spatialite.c                        |  381 ++-
 src/spatialite/spatialite_init.c                   |    4 -
 src/spatialite/srid_aux.c                          |    2 +-
 src/spatialite/statistics.c                        |  177 +-
 src/spatialite/virtualXL.c                         |   17 +-
 src/spatialite/virtualbbox.c                       |    4 +-
 src/spatialite/virtualdbf.c                        |    6 +
 src/spatialite/virtualelementary.c                 |    2 +-
 src/spatialite/virtualfdo.c                        |    6 +-
 src/spatialite/virtualknn.c                        |    9 +
 src/spatialite/virtualnetwork.c                    |    3 +-
 src/spatialite/virtualshape.c                      |    6 +
 src/spatialite/virtualspatialindex.c               |    4 +-
 src/srsinit/epsg_inlined_extra.c                   |    2 +-
 src/topology/gaia_auxnet.c                         |   19 +-
 src/topology/gaia_auxtopo.c                        | 2169 +++++++++++++---
 src/topology/gaia_netstmts.c                       |    6 +-
 src/topology/gaia_network.c                        |   75 +-
 src/topology/gaia_topology.c                       | 2595 ++++++++++++++-----
 src/topology/gaia_topostmts.c                      |    7 +-
 src/topology/lwn_network.c                         |   89 +-
 src/topology/lwn_network.h                         |    3 +-
 src/topology/lwn_network_private.h                 |    1 +
 src/topology/net_callbacks.c                       |    5 +-
 src/topology/topo_callbacks.c                      | 1247 ++++++----
 src/topology/topology_private.h                    |  171 +-
 src/virtualtext/virtualtext.c                      |   85 +-
 src/wfs/wfs_in.c                                   |   10 +-
 test/Makefile.am                                   |    6 +-
 test/Makefile.in                                   |    6 +-
 test/check_create.c                                |   10 +-
 test/check_dxf.c                                   |    4 +-
 test/check_extension.c                             |   14 +-
 test/check_multithread.c                           |    8 +-
 test/check_network2d.c                             |    4 +-
 test/check_network3d.c                             |    4 +-
 test/check_network_log.c                           |    4 +-
 test/check_relations_fncts.c                       |    2 +-
 test/check_shp_load.c                              |    4 +-
 test/check_shp_load_3d.c                           |    4 +-
 test/check_sql_stmt.c                              |   51 +-
 test/check_topology2d.c                            |    9 +-
 test/check_topology3d.c                            |    6 +-
 test/check_topoplus.c                              |  626 ++++-
 test/check_virtualknn.c                            |    6 +-
 test/geos-init.supp                                |   13 +
 test/gpkg_test.gpkg                                |  Bin 386048 -> 238592 bytes
 test/shape_primitives.c                            |    4 +-
 test/shp/ReadMe.txt                                |   11 +
 test/sql_stmt_cache_tests/Makefile                 |  460 ++++
 test/sql_stmt_freexl_tests/Makefile                |  456 ++++
 test/sql_stmt_geopackage_tests/Makefile.am         |   11 +-
 test/sql_stmt_geopackage_tests/Makefile.in         |   10 +-
 test/sql_stmt_geos_tests/geoserror8.testcase       |   11 +
 test/sql_stmt_geosadvanced_tests/Makefile          |  487 ++++
 test/sql_stmt_gpkg_epsg_tests/Makefile.am          |   10 +
 test/sql_stmt_gpkg_epsg_tests/Makefile.in          |  457 ++++
 .../transform_geopackage1.testcase                 |    0
 .../transform_geopackage2.testcase                 |    7 +
 .../transform_geopackage3.testcase                 |    7 +
 .../transform_geopackage4.testcase                 |    7 +
 .../transform_geopackage5.testcase                 |    7 +
 .../transform_geopackage6.testcase                 |    7 +
 .../transform_geopackage7.testcase                 |    7 +
 .../transform_geopackage8.testcase                 |    7 +
 .../registerStllGroupStyle2.testcase               |    7 +
 .../unregisterStllGroupStyle2.testcase             |    7 +
 test/sql_stmt_lwgeom_20_tests/st_asx3d25.testcase  |    3 +-
 test/sql_stmt_lwgeom_20_tests/st_asx3d26.testcase  |    3 +-
 test/sql_stmt_lwgeom_20_tests/st_asx3d30.testcase  |    3 +-
 test/sql_stmt_lwgeom_22_tests/Makefile.am          |   96 +-
 test/sql_stmt_lwgeom_22_tests/Makefile.in          |  102 +-
 .../linesnapseed1.testcase                         |    7 +
 .../linesnapseed10.testcase                        |    7 +
 .../linesnapseed11.testcase                        |    7 +
 .../linesnapseed12.testcase                        |    7 +
 .../linesnapseed13.testcase                        |    7 +
 .../linesnapseed14.testcase                        |    7 +
 .../linesnapseed15.testcase                        |    7 +
 .../linesnapseed16.testcase                        |    7 +
 .../linesnapseed17.testcase                        |    7 +
 .../linesnapseed2.testcase                         |    7 +
 .../linesnapseed3.testcase                         |    7 +
 .../linesnapseed4.testcase                         |    7 +
 .../linesnapseed5.testcase                         |    7 +
 .../linesnapseed6.testcase                         |    7 +
 .../linesnapseed7.testcase                         |    7 +
 .../linesnapseed8.testcase                         |    7 +
 .../linesnapseed9.testcase                         |    7 +
 .../pointsnapseed1.testcase                        |    7 +
 .../pointsnapseed10.testcase                       |    7 +
 .../pointsnapseed11.testcase                       |    7 +
 .../pointsnapseed12.testcase                       |    7 +
 .../pointsnapseed13.testcase                       |    7 +
 .../pointsnapseed14.testcase                       |    7 +
 .../pointsnapseed15.testcase                       |    7 +
 .../pointsnapseed16.testcase                       |    7 +
 .../pointsnapseed17.testcase                       |    7 +
 .../pointsnapseed2.testcase                        |    7 +
 .../pointsnapseed3.testcase                        |    7 +
 .../pointsnapseed4.testcase                        |    7 +
 .../pointsnapseed5.testcase                        |    7 +
 .../pointsnapseed6.testcase                        |    7 +
 .../pointsnapseed7.testcase                        |    7 +
 .../pointsnapseed8.testcase                        |    7 +
 .../pointsnapseed9.testcase                        |    7 +
 .../topogeofromext1.testcase                       |    7 +
 .../topogeofromext10.testcase                      |    7 +
 .../topogeofromext11.testcase                      |    7 +
 .../topogeofromext12.testcase                      |    7 +
 .../topogeofromext13.testcase                      |    7 +
 .../topogeofromext14.testcase                      |    7 +
 .../topogeofromext15.testcase                      |    7 +
 .../topogeofromext16.testcase                      |    7 +
 .../topogeofromext17.testcase                      |    7 +
 .../topogeofromext18.testcase                      |    7 +
 .../topogeofromext19.testcase                      |    7 +
 .../topogeofromext2.testcase                       |    7 +
 .../topogeofromext20.testcase                      |    7 +
 .../topogeofromext21.testcase                      |    7 +
 .../topogeofromext22.testcase                      |    7 +
 .../topogeofromext23.testcase                      |    7 +
 .../topogeofromext24.testcase                      |    7 +
 .../topogeofromext25.testcase                      |    7 +
 .../topogeofromext26.testcase                      |    7 +
 .../topogeofromext27.testcase                      |    7 +
 .../topogeofromext28.testcase                      |    7 +
 .../topogeofromext29.testcase                      |    7 +
 .../topogeofromext3.testcase                       |    7 +
 .../topogeofromext30.testcase                      |    7 +
 .../topogeofromext31.testcase                      |    7 +
 .../topogeofromext32.testcase                      |    7 +
 .../topogeofromext33.testcase                      |    7 +
 .../topogeofromext34.testcase                      |    7 +
 .../topogeofromext35.testcase                      |    7 +
 .../topogeofromext36.testcase                      |    7 +
 .../topogeofromext37.testcase                      |    7 +
 .../topogeofromext38.testcase                      |    7 +
 .../topogeofromext39.testcase                      |    7 +
 .../topogeofromext4.testcase                       |    7 +
 .../topogeofromext5.testcase                       |    7 +
 .../topogeofromext6.testcase                       |    7 +
 .../topogeofromext7.testcase                       |    7 +
 .../topogeofromext8.testcase                       |    7 +
 .../topogeofromext9.testcase                       |    7 +
 .../topogeofromtable10.testcase                    |    2 +-
 .../topogeoremoveedges1.testcase                   |    7 +
 .../topogeoremoveedges2.testcase                   |    7 +
 .../topogeoremoveedges3.testcase                   |    7 +
 .../topogeoremoveedges4.testcase                   |    7 +
 .../topogeoremoveedges5.testcase                   |    7 +
 .../topogeoremovenodes1.testcase                   |    7 +
 .../topogeoremovenodes2.testcase                   |    7 +
 .../topogeoremovenodes3.testcase                   |    7 +
 .../topogeoremovenodes4.testcase                   |    7 +
 .../topogeoremovenodes5.testcase                   |    7 +
 .../topogeoremovesmall1.testcase                   |    7 +
 .../topogeoremovesmall2.testcase                   |    7 +
 .../topogeoremovesmall3.testcase                   |    7 +
 .../topogeoremovesmall4.testcase                   |    7 +
 .../topogeoremovesmall5.testcase                   |    7 +
 .../topogeoremovesmall6.testcase                   |    7 +
 .../topogeoremovesmall7.testcase                   |    7 +
 .../topogeoremovesmall8.testcase                   |    7 +
 .../topogeoremovesmall9.testcase                   |    7 +
 .../topomettotable25.testcase                      |    7 +
 .../toponetupdateseeds1.testcase                   |    7 +
 .../toponetupdateseeds10.testcase                  |    7 +
 .../toponetupdateseeds2.testcase                   |    7 +
 .../toponetupdateseeds3.testcase                   |    7 +
 .../toponetupdateseeds4.testcase                   |    7 +
 .../toponetupdateseeds5.testcase                   |    7 +
 .../toponetupdateseeds6.testcase                   |    7 +
 .../toponetupdateseeds7.testcase                   |    7 +
 .../toponetupdateseeds8.testcase                   |    7 +
 .../toponetupdateseeds9.testcase                   |    7 +
 test/sql_stmt_lwgeom_tests/Makefile.am             |  294 ---
 test/sql_stmt_lwgeom_tests/Makefile.in             |  741 ------
 test/sql_stmt_lwgeom_tests/st_asx3d14.testcase     |    7 -
 test/sql_stmt_lwgeom_tests/st_asx3d15.testcase     |    7 -
 test/sql_stmt_lwgeom_tests/st_asx3d8.testcase      |    7 -
 test/sql_stmt_lwgeom_tests/st_asx3d9.testcase      |    7 -
 test/sql_stmt_nocache_tests/Makefile               |  455 ++++
 .../3ddistance1.testcase                           |    0
 .../3ddistance10.testcase                          |    0
 .../3ddistance2.testcase                           |    0
 .../3ddistance3.testcase                           |    0
 .../3ddistance4.testcase                           |    0
 .../3ddistance5.testcase                           |    0
 .../3ddistance6.testcase                           |    0
 .../3ddistance7.testcase                           |    0
 .../3ddistance8.testcase                           |    0
 .../3ddistance9.testcase                           |    0
 .../3dlength1.testcase                             |    0
 .../3dlength2.testcase                             |    0
 .../3dlength3.testcase                             |    0
 .../3dlength4.testcase                             |    0
 .../3dlength5.testcase                             |    0
 .../3dlength6.testcase                             |    0
 .../3dlength7.testcase                             |    0
 .../3dlength8.testcase                             |    0
 .../3dmaxdistance1.testcase                        |    0
 .../3dmaxdistance10.testcase                       |    0
 .../3dmaxdistance2.testcase                        |    0
 .../3dmaxdistance3.testcase                        |    0
 .../3dmaxdistance4.testcase                        |    0
 .../3dmaxdistance5.testcase                        |    0
 .../3dmaxdistance6.testcase                        |    0
 .../3dmaxdistance7.testcase                        |    0
 .../3dmaxdistance8.testcase                        |    0
 .../3dmaxdistance9.testcase                        |    0
 test/sql_stmt_rtgeom_tests/Makefile.am             |  298 +++
 test/sql_stmt_rtgeom_tests/Makefile.in             |  745 ++++++
 .../maxdistance1.testcase                          |    0
 .../maxdistance10.testcase                         |    0
 .../maxdistance2.testcase                          |    0
 .../maxdistance3.testcase                          |    0
 .../maxdistance4.testcase                          |    0
 .../maxdistance5.testcase                          |    0
 .../maxdistance6.testcase                          |    0
 .../maxdistance7.testcase                          |    0
 .../maxdistance8.testcase                          |    0
 .../maxdistance9.testcase                          |    0
 .../st_area10.testcase                             |    0
 .../st_area11.testcase                             |    0
 .../st_area12.testcase                             |    0
 .../st_area13.testcase                             |    0
 .../st_area14.testcase                             |    0
 .../st_area15.testcase                             |    0
 .../st_area16.testcase                             |    0
 .../st_area17.testcase                             |    0
 .../st_area18.testcase                             |    0
 .../st_asx3d1.testcase                             |    0
 .../st_asx3d10.testcase                            |    0
 .../st_asx3d11.testcase                            |    0
 .../st_asx3d12.testcase                            |    0
 .../st_asx3d13.testcase                            |    0
 test/sql_stmt_rtgeom_tests/st_asx3d14.testcase     |    8 +
 test/sql_stmt_rtgeom_tests/st_asx3d15.testcase     |    8 +
 .../st_asx3d16.testcase                            |    0
 .../st_asx3d17.testcase                            |    0
 .../st_asx3d18.testcase                            |    0
 .../st_asx3d19.testcase                            |    0
 .../st_asx3d2.testcase                             |    0
 .../st_asx3d20.testcase                            |    0
 .../st_asx3d21.testcase                            |    0
 .../st_asx3d22.testcase                            |    0
 .../st_asx3d23.testcase                            |    0
 .../st_asx3d24.testcase                            |    0
 .../st_asx3d25.testcase                            |    0
 .../st_asx3d26.testcase                            |    0
 .../st_asx3d27.testcase                            |    0
 .../st_asx3d28.testcase                            |    0
 .../st_asx3d29.testcase                            |    0
 .../st_asx3d3.testcase                             |    0
 .../st_asx3d30.testcase                            |    0
 .../st_asx3d4.testcase                             |    0
 .../st_asx3d5.testcase                             |    0
 .../st_asx3d6.testcase                             |    0
 .../st_asx3d7.testcase                             |    0
 test/sql_stmt_rtgeom_tests/st_asx3d8.testcase      |    8 +
 test/sql_stmt_rtgeom_tests/st_asx3d9.testcase      |    8 +
 .../st_azimuth1.testcase                           |    0
 test/sql_stmt_rtgeom_tests/st_azimuth10.testcase   |    7 +
 .../st_azimuth11.testcase                          |    0
 .../st_azimuth12.testcase                          |    0
 .../st_azimuth13.testcase                          |    0
 .../st_azimuth14.testcase                          |    0
 .../st_azimuth15.testcase                          |    0
 .../st_azimuth16.testcase                          |    0
 .../st_azimuth17.testcase                          |    0
 .../st_azimuth2.testcase                           |    0
 .../st_azimuth3.testcase                           |    0
 .../st_azimuth4.testcase                           |    0
 .../st_azimuth5.testcase                           |    0
 .../st_azimuth6.testcase                           |    0
 .../st_azimuth7.testcase                           |    0
 .../st_azimuth8.testcase                           |    0
 .../st_azimuth9.testcase                           |    0
 .../st_geohash1.testcase                           |    0
 .../st_geohash10.testcase                          |    0
 .../st_geohash2.testcase                           |    0
 .../st_geohash3.testcase                           |    0
 .../st_geohash4.testcase                           |    0
 .../st_geohash5.testcase                           |    0
 .../st_geohash6.testcase                           |    0
 .../st_geohash7.testcase                           |    0
 .../st_geohash8.testcase                           |    0
 .../st_geohash9.testcase                           |    0
 .../st_makevalid1.testcase                         |    0
 .../st_makevalid2.testcase                         |    0
 .../st_makevalid3.testcase                         |    0
 .../st_makevalid4.testcase                         |    0
 .../st_makevalid5.testcase                         |    0
 .../st_makevalid6.testcase                         |    0
 .../st_makevalid7.testcase                         |    0
 .../st_makevalid8.testcase                         |    0
 .../st_makevaliddiscarded1.testcase                |    0
 .../st_makevaliddiscarded2.testcase                |    0
 .../st_makevaliddiscarded3.testcase                |    0
 .../st_makevaliddiscarded4.testcase                |    0
 .../st_makevaliddiscarded5.testcase                |    0
 .../st_makevaliddiscarded6.testcase                |    0
 .../st_makevaliddiscarded7.testcase                |    0
 .../st_makevaliddiscarded8.testcase                |    0
 .../st_node1.testcase                              |    0
 .../st_node2.testcase                              |    0
 .../st_node3.testcase                              |    0
 .../st_node4.testcase                              |    0
 .../st_node5.testcase                              |    0
 .../st_node6.testcase                              |    0
 .../st_node7.testcase                              |    0
 .../st_node8.testcase                              |    0
 .../st_node9.testcase                              |    0
 .../st_project1.testcase                           |    0
 .../st_project10.testcase                          |    0
 .../st_project11.testcase                          |    0
 .../st_project12.testcase                          |    0
 .../st_project13.testcase                          |    0
 .../st_project14.testcase                          |    0
 .../st_project2.testcase                           |    0
 .../st_project3.testcase                           |    0
 .../st_project4.testcase                           |    0
 .../st_project5.testcase                           |    0
 .../st_project6.testcase                           |    0
 .../st_project7.testcase                           |    0
 .../st_project8.testcase                           |    0
 .../st_project9.testcase                           |    0
 .../st_segmentize1.testcase                        |    0
 .../st_segmentize10.testcase                       |    0
 .../st_segmentize11.testcase                       |    0
 .../st_segmentize12.testcase                       |    0
 .../st_segmentize13.testcase                       |    0
 .../st_segmentize14.testcase                       |    0
 .../st_segmentize15.testcase                       |    0
 .../st_segmentize16.testcase                       |    0
 .../st_segmentize17.testcase                       |    0
 .../st_segmentize18.testcase                       |    0
 .../st_segmentize19.testcase                       |    0
 .../st_segmentize2.testcase                        |    0
 .../st_segmentize20.testcase                       |    0
 .../st_segmentize21.testcase                       |    0
 .../st_segmentize22.testcase                       |    0
 .../st_segmentize23.testcase                       |    0
 .../st_segmentize24.testcase                       |    0
 .../st_segmentize25.testcase                       |    0
 .../st_segmentize26.testcase                       |    0
 .../st_segmentize27.testcase                       |    0
 .../st_segmentize28.testcase                       |    0
 .../st_segmentize29.testcase                       |    0
 .../st_segmentize3.testcase                        |    0
 .../st_segmentize30.testcase                       |    0
 .../st_segmentize31.testcase                       |    0
 .../st_segmentize4.testcase                        |    0
 .../st_segmentize5.testcase                        |    0
 .../st_segmentize6.testcase                        |    0
 .../st_segmentize7.testcase                        |    0
 .../st_segmentize8.testcase                        |    0
 .../st_segmentize9.testcase                        |    0
 .../st_self1.testcase                              |    0
 .../st_self2.testcase                              |    0
 .../st_self3.testcase                              |    0
 .../st_self4.testcase                              |    0
 .../st_self5.testcase                              |    0
 .../st_self6.testcase                              |    0
 .../st_self7.testcase                              |    0
 .../st_self8.testcase                              |    0
 .../st_self9.testcase                              |    0
 .../st_snaptogrid1.testcase                        |    0
 .../st_snaptogrid10.testcase                       |    0
 .../st_snaptogrid11.testcase                       |    0
 .../st_snaptogrid12.testcase                       |    0
 .../st_snaptogrid13.testcase                       |    0
 .../st_snaptogrid14.testcase                       |    0
 .../st_snaptogrid15.testcase                       |    0
 .../st_snaptogrid16.testcase                       |    0
 .../st_snaptogrid17.testcase                       |    0
 .../st_snaptogrid18.testcase                       |    0
 .../st_snaptogrid19.testcase                       |    0
 .../st_snaptogrid2.testcase                        |    0
 .../st_snaptogrid20.testcase                       |    0
 .../st_snaptogrid21.testcase                       |    0
 .../st_snaptogrid22.testcase                       |    0
 .../st_snaptogrid23.testcase                       |    0
 .../st_snaptogrid24.testcase                       |    0
 .../st_snaptogrid25.testcase                       |    0
 .../st_snaptogrid26.testcase                       |    0
 .../st_snaptogrid27.testcase                       |    0
 .../st_snaptogrid28.testcase                       |    0
 .../st_snaptogrid29.testcase                       |    0
 .../st_snaptogrid3.testcase                        |    0
 .../st_snaptogrid30.testcase                       |    0
 .../st_snaptogrid31.testcase                       |    0
 .../st_snaptogrid32.testcase                       |    0
 .../st_snaptogrid33.testcase                       |    0
 .../st_snaptogrid34.testcase                       |    0
 .../st_snaptogrid35.testcase                       |    0
 .../st_snaptogrid36.testcase                       |    0
 .../st_snaptogrid37.testcase                       |    0
 .../st_snaptogrid38.testcase                       |    0
 .../st_snaptogrid39.testcase                       |    0
 .../st_snaptogrid4.testcase                        |    0
 .../st_snaptogrid40.testcase                       |    0
 .../st_snaptogrid41.testcase                       |    0
 .../st_snaptogrid42.testcase                       |    0
 .../st_snaptogrid43.testcase                       |    0
 .../st_snaptogrid44.testcase                       |    0
 .../st_snaptogrid45.testcase                       |    0
 .../st_snaptogrid46.testcase                       |    0
 .../st_snaptogrid47.testcase                       |    0
 .../st_snaptogrid48.testcase                       |    0
 .../st_snaptogrid49.testcase                       |    0
 .../st_snaptogrid5.testcase                        |    0
 .../st_snaptogrid50.testcase                       |    0
 .../st_snaptogrid51.testcase                       |    0
 .../st_snaptogrid52.testcase                       |    0
 .../st_snaptogrid53.testcase                       |    0
 .../st_snaptogrid54.testcase                       |    0
 .../st_snaptogrid55.testcase                       |    0
 .../st_snaptogrid56.testcase                       |    0
 .../st_snaptogrid57.testcase                       |    0
 .../st_snaptogrid58.testcase                       |    0
 .../st_snaptogrid59.testcase                       |    0
 .../st_snaptogrid6.testcase                        |    0
 .../st_snaptogrid60.testcase                       |    0
 .../st_snaptogrid61.testcase                       |    0
 .../st_snaptogrid62.testcase                       |    0
 .../st_snaptogrid63.testcase                       |    0
 .../st_snaptogrid64.testcase                       |    0
 .../st_snaptogrid65.testcase                       |    0
 .../st_snaptogrid7.testcase                        |    0
 .../st_snaptogrid8.testcase                        |    0
 .../st_snaptogrid9.testcase                        |    0
 .../st_split1.testcase                             |    0
 .../st_split10.testcase                            |    0
 .../st_split11.testcase                            |    0
 .../st_split12.testcase                            |    0
 .../st_split13.testcase                            |    0
 .../st_split14.testcase                            |    0
 .../st_split15.testcase                            |    0
 .../st_split16.testcase                            |    0
 .../st_split17.testcase                            |    0
 .../st_split18.testcase                            |    0
 .../st_split19.testcase                            |    0
 .../st_split2.testcase                             |    0
 .../st_split20.testcase                            |    0
 .../st_split21.testcase                            |    0
 .../st_split22.testcase                            |    0
 .../st_split23.testcase                            |    0
 .../st_split24.testcase                            |    0
 .../st_split25.testcase                            |    0
 .../st_split26.testcase                            |    0
 .../st_split27.testcase                            |    0
 .../st_split28.testcase                            |    0
 .../st_split29.testcase                            |    0
 .../st_split3.testcase                             |    0
 .../st_split30.testcase                            |    0
 .../st_split31.testcase                            |    0
 .../st_split32.testcase                            |    0
 .../st_split33.testcase                            |    0
 .../st_split34.testcase                            |    0
 .../st_split35.testcase                            |    0
 .../st_split36.testcase                            |    0
 .../st_split37.testcase                            |    0
 .../st_split38.testcase                            |    0
 .../st_split39.testcase                            |    0
 .../st_split4.testcase                             |    0
 .../st_split40.testcase                            |    0
 .../st_split41.testcase                            |    0
 .../st_split42.testcase                            |    0
 .../st_split43.testcase                            |    0
 .../st_split44.testcase                            |    0
 .../st_split45.testcase                            |    0
 .../st_split46.testcase                            |    0
 .../st_split47.testcase                            |    0
 .../st_split48.testcase                            |    0
 .../st_split49.testcase                            |    0
 .../st_split5.testcase                             |    0
 .../st_split6.testcase                             |    0
 .../st_split7.testcase                             |    0
 .../st_split8.testcase                             |    0
 .../st_split9.testcase                             |    0
 test/sql_stmt_rttopo_tests/Makefile.am             | 1019 ++++++++
 test/sql_stmt_rttopo_tests/Makefile.in             | 1466 +++++++++++
 .../sql_stmt_rttopo_tests/addedgemodface1.testcase |    7 +
 .../addedgemodface10.testcase                      |    7 +
 .../addedgemodface11.testcase                      |    7 +
 .../addedgemodface12.testcase                      |    7 +
 .../addedgemodface13.testcase                      |    7 +
 .../addedgemodface14.testcase                      |    7 +
 .../addedgemodface15.testcase                      |    7 +
 .../addedgemodface16.testcase                      |    7 +
 .../addedgemodface17.testcase                      |    7 +
 .../addedgemodface18.testcase                      |    7 +
 .../addedgemodface19.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface2.testcase |    7 +
 .../addedgemodface20.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface3.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface4.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface5.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface6.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface7.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface8.testcase |    7 +
 .../sql_stmt_rttopo_tests/addedgemodface9.testcase |    7 +
 .../addedgenewfaces1.testcase                      |    7 +
 .../addedgenewfaces10.testcase                     |    7 +
 .../addedgenewfaces11.testcase                     |    7 +
 .../addedgenewfaces12.testcase                     |    7 +
 .../addedgenewfaces13.testcase                     |    7 +
 .../addedgenewfaces14.testcase                     |    7 +
 .../addedgenewfaces15.testcase                     |    7 +
 .../addedgenewfaces16.testcase                     |    7 +
 .../addedgenewfaces17.testcase                     |    7 +
 .../addedgenewfaces18.testcase                     |    7 +
 .../addedgenewfaces19.testcase                     |    7 +
 .../addedgenewfaces2.testcase                      |    7 +
 .../addedgenewfaces20.testcase                     |    7 +
 .../addedgenewfaces3.testcase                      |    7 +
 .../addedgenewfaces4.testcase                      |    7 +
 .../addedgenewfaces5.testcase                      |    7 +
 .../addedgenewfaces6.testcase                      |    7 +
 .../addedgenewfaces7.testcase                      |    7 +
 .../addedgenewfaces8.testcase                      |    7 +
 .../addedgenewfaces9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/addisoedge1.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge10.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge11.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge12.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge13.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge14.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge15.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge16.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge17.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge18.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge19.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge2.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge20.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisoedge3.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge4.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge5.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge6.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge7.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge8.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisoedge9.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonetnode1.testcase |    7 +
 test/sql_stmt_rttopo_tests/addisonetnode2.testcase |    7 +
 test/sql_stmt_rttopo_tests/addisonetnode3.testcase |    7 +
 test/sql_stmt_rttopo_tests/addisonetnode4.testcase |    7 +
 test/sql_stmt_rttopo_tests/addisonetnode5.testcase |    7 +
 test/sql_stmt_rttopo_tests/addisonode1.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode10.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode11.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode12.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode13.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode14.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode15.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode16.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode17.testcase   |    7 +
 test/sql_stmt_rttopo_tests/addisonode2.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode3.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode4.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode5.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode6.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode7.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode8.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addisonode9.testcase    |    7 +
 test/sql_stmt_rttopo_tests/addlink1.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink10.testcase      |    7 +
 test/sql_stmt_rttopo_tests/addlink11.testcase      |    7 +
 test/sql_stmt_rttopo_tests/addlink12.testcase      |    7 +
 test/sql_stmt_rttopo_tests/addlink13.testcase      |    7 +
 test/sql_stmt_rttopo_tests/addlink2.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink3.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink4.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink5.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink6.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink7.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink8.testcase       |    7 +
 test/sql_stmt_rttopo_tests/addlink9.testcase       |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom1.testcase |    7 +
 .../changeedgegeom10.testcase                      |    7 +
 .../changeedgegeom11.testcase                      |    7 +
 .../changeedgegeom12.testcase                      |    7 +
 .../changeedgegeom13.testcase                      |    7 +
 .../changeedgegeom14.testcase                      |    7 +
 .../changeedgegeom15.testcase                      |    7 +
 .../changeedgegeom16.testcase                      |    7 +
 .../changeedgegeom17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom2.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom3.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom4.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom5.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom6.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom7.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom8.testcase |    7 +
 .../sql_stmt_rttopo_tests/changeedgegeom9.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom1.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom2.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom3.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom4.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom5.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom6.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom7.testcase |    7 +
 .../sql_stmt_rttopo_tests/changelinkgeom8.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork1.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork10.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork11.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork12.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork13.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork14.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork15.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork16.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork17.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork18.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork19.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork2.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork20.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork21.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork22.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork23.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork24.testcase |    7 +
 .../sql_stmt_rttopo_tests/createnetwork25.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork3.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork4.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork5.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork6.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork7.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork8.testcase |    7 +
 test/sql_stmt_rttopo_tests/createnetwork9.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo1.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopogeo10.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo2.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo3.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo4.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo5.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo6.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo7.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo8.testcase |    7 +
 test/sql_stmt_rttopo_tests/createtopogeo9.testcase |    7 +
 .../createtopolayer1.testcase                      |    7 +
 .../createtopolayer10.testcase                     |    7 +
 .../createtopolayer11.testcase                     |    7 +
 .../createtopolayer12.testcase                     |    7 +
 .../createtopolayer13.testcase                     |    7 +
 .../createtopolayer14.testcase                     |    7 +
 .../createtopolayer15.testcase                     |    7 +
 .../createtopolayer16.testcase                     |    7 +
 .../createtopolayer17.testcase                     |    7 +
 .../createtopolayer18.testcase                     |    7 +
 .../createtopolayer19.testcase                     |    7 +
 .../createtopolayer2.testcase                      |    7 +
 .../createtopolayer20.testcase                     |    7 +
 .../createtopolayer21.testcase                     |    7 +
 .../createtopolayer22.testcase                     |    7 +
 .../createtopolayer23.testcase                     |    7 +
 .../createtopolayer24.testcase                     |    7 +
 .../createtopolayer25.testcase                     |    7 +
 .../createtopolayer26.testcase                     |    7 +
 .../createtopolayer3.testcase                      |    7 +
 .../createtopolayer4.testcase                      |    7 +
 .../createtopolayer5.testcase                      |    7 +
 .../createtopolayer6.testcase                      |    7 +
 .../createtopolayer7.testcase                      |    7 +
 .../createtopolayer8.testcase                      |    7 +
 .../createtopolayer9.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/createtopology1.testcase |    7 +
 .../createtopology10.testcase                      |    7 +
 .../createtopology11.testcase                      |    7 +
 .../createtopology12.testcase                      |    7 +
 .../createtopology13.testcase                      |    7 +
 .../createtopology14.testcase                      |    7 +
 .../createtopology15.testcase                      |    7 +
 .../createtopology16.testcase                      |    7 +
 .../createtopology17.testcase                      |    7 +
 .../createtopology18.testcase                      |    7 +
 .../createtopology19.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/createtopology2.testcase |    7 +
 .../createtopology20.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/createtopology3.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology4.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology5.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology6.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology7.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology8.testcase |    7 +
 .../sql_stmt_rttopo_tests/createtopology9.testcase |    7 +
 test/sql_stmt_rttopo_tests/dropnetwork1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/dropnetwork2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/dropnetwork3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/dropnetwork4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/dropnetwork5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/droptopology1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/droptopology2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/droptopology3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/droptopology4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/droptopology5.testcase  |    7 +
 .../exporttopolayer1.testcase                      |    7 +
 .../exporttopolayer10.testcase                     |    7 +
 .../exporttopolayer11.testcase                     |    7 +
 .../exporttopolayer12.testcase                     |    7 +
 .../exporttopolayer13.testcase                     |    7 +
 .../exporttopolayer14.testcase                     |    7 +
 .../exporttopolayer15.testcase                     |    7 +
 .../exporttopolayer16.testcase                     |    7 +
 .../exporttopolayer17.testcase                     |    7 +
 .../exporttopolayer18.testcase                     |    7 +
 .../exporttopolayer19.testcase                     |    7 +
 .../exporttopolayer2.testcase                      |    7 +
 .../exporttopolayer20.testcase                     |    7 +
 .../exporttopolayer21.testcase                     |    7 +
 .../exporttopolayer22.testcase                     |    7 +
 .../exporttopolayer23.testcase                     |    7 +
 .../exporttopolayer3.testcase                      |    7 +
 .../exporttopolayer4.testcase                      |    7 +
 .../exporttopolayer5.testcase                      |    7 +
 .../exporttopolayer6.testcase                      |    7 +
 .../exporttopolayer7.testcase                      |    7 +
 .../exporttopolayer8.testcase                      |    7 +
 .../exporttopolayer9.testcase                      |    7 +
 .../featuretopolayer1.testcase                     |    7 +
 .../featuretopolayer10.testcase                    |    7 +
 .../featuretopolayer11.testcase                    |    7 +
 .../featuretopolayer12.testcase                    |    7 +
 .../featuretopolayer13.testcase                    |    7 +
 .../featuretopolayer14.testcase                    |    7 +
 .../featuretopolayer15.testcase                    |    7 +
 .../featuretopolayer16.testcase                    |    7 +
 .../featuretopolayer17.testcase                    |    7 +
 .../featuretopolayer2.testcase                     |    7 +
 .../featuretopolayer3.testcase                     |    7 +
 .../featuretopolayer4.testcase                     |    7 +
 .../featuretopolayer5.testcase                     |    7 +
 .../featuretopolayer6.testcase                     |    7 +
 .../featuretopolayer7.testcase                     |    7 +
 .../featuretopolayer8.testcase                     |    7 +
 .../featuretopolayer9.testcase                     |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint1.testcase |    7 +
 .../getedgebypoint10.testcase                      |    7 +
 .../getedgebypoint11.testcase                      |    7 +
 .../getedgebypoint12.testcase                      |    7 +
 .../getedgebypoint13.testcase                      |    7 +
 .../getedgebypoint14.testcase                      |    7 +
 .../getedgebypoint15.testcase                      |    7 +
 .../getedgebypoint16.testcase                      |    7 +
 .../getedgebypoint17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint2.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint3.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint4.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint5.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint6.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint7.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint8.testcase |    7 +
 .../sql_stmt_rttopo_tests/getedgebypoint9.testcase |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getedgeseed9.testcase   |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint1.testcase |    7 +
 .../getfacebypoint10.testcase                      |    7 +
 .../getfacebypoint11.testcase                      |    7 +
 .../getfacebypoint12.testcase                      |    7 +
 .../getfacebypoint13.testcase                      |    7 +
 .../getfacebypoint14.testcase                      |    7 +
 .../getfacebypoint15.testcase                      |    7 +
 .../getfacebypoint16.testcase                      |    7 +
 .../getfacebypoint17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint2.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint3.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint4.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint5.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint6.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint7.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint8.testcase |    7 +
 .../sql_stmt_rttopo_tests/getfacebypoint9.testcase |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges5.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges6.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges7.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges8.testcase  |    7 +
 test/sql_stmt_rttopo_tests/getfaceedges9.testcase  |    7 +
 .../getfacegeometry1.testcase                      |    7 +
 .../getfacegeometry2.testcase                      |    7 +
 .../getfacegeometry3.testcase                      |    7 +
 .../getfacegeometry4.testcase                      |    7 +
 .../getfacegeometry5.testcase                      |    7 +
 .../getfacegeometry6.testcase                      |    7 +
 .../getfacegeometry7.testcase                      |    7 +
 .../getfacegeometry8.testcase                      |    7 +
 .../getfacegeometry9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getfaceseed9.testcase   |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint1.testcase |    7 +
 .../getlinkbypoint10.testcase                      |    7 +
 .../getlinkbypoint11.testcase                      |    7 +
 .../getlinkbypoint12.testcase                      |    7 +
 .../getlinkbypoint13.testcase                      |    7 +
 .../getlinkbypoint14.testcase                      |    7 +
 .../getlinkbypoint15.testcase                      |    7 +
 .../getlinkbypoint16.testcase                      |    7 +
 .../getlinkbypoint17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint2.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint3.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint4.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint5.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint6.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint7.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint8.testcase |    7 +
 .../sql_stmt_rttopo_tests/getlinkbypoint9.testcase |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/getlinkseed9.testcase   |    7 +
 .../getnetnodebypoint1.testcase                    |    7 +
 .../getnetnodebypoint10.testcase                   |    7 +
 .../getnetnodebypoint11.testcase                   |    7 +
 .../getnetnodebypoint12.testcase                   |    7 +
 .../getnetnodebypoint13.testcase                   |    7 +
 .../getnetnodebypoint14.testcase                   |    7 +
 .../getnetnodebypoint15.testcase                   |    7 +
 .../getnetnodebypoint16.testcase                   |    7 +
 .../getnetnodebypoint17.testcase                   |    7 +
 .../getnetnodebypoint2.testcase                    |    7 +
 .../getnetnodebypoint3.testcase                    |    7 +
 .../getnetnodebypoint4.testcase                    |    7 +
 .../getnetnodebypoint5.testcase                    |    7 +
 .../getnetnodebypoint6.testcase                    |    7 +
 .../getnetnodebypoint7.testcase                    |    7 +
 .../getnetnodebypoint8.testcase                    |    7 +
 .../getnetnodebypoint9.testcase                    |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint1.testcase |    7 +
 .../getnodebypoint10.testcase                      |    7 +
 .../getnodebypoint11.testcase                      |    7 +
 .../getnodebypoint12.testcase                      |    7 +
 .../getnodebypoint13.testcase                      |    7 +
 .../getnodebypoint14.testcase                      |    7 +
 .../getnodebypoint15.testcase                      |    7 +
 .../getnodebypoint16.testcase                      |    7 +
 .../getnodebypoint17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint2.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint3.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint4.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint5.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint6.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint7.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint8.testcase |    7 +
 .../sql_stmt_rttopo_tests/getnodebypoint9.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer1.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer10.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer11.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer12.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer13.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer14.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer15.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer16.testcase |    7 +
 .../sql_stmt_rttopo_tests/inittopolayer17.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer2.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer3.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer4.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer5.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer6.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer7.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer8.testcase |    7 +
 test/sql_stmt_rttopo_tests/inittopolayer9.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed10.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed11.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed12.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed13.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed14.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed15.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed16.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed17.testcase |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed5.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed6.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed7.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed8.testcase  |    7 +
 test/sql_stmt_rttopo_tests/linesnapseed9.testcase  |    7 +
 .../loginetfromtgeo1.testcase                      |    7 +
 .../loginetfromtgeo2.testcase                      |    7 +
 .../loginetfromtgeo3.testcase                      |    7 +
 .../loginetfromtgeo4.testcase                      |    7 +
 .../loginetfromtgeo5.testcase                      |    7 +
 .../loginetfromtgeo6.testcase                      |    7 +
 .../loginetfromtgeo7.testcase                      |    7 +
 .../loginetfromtgeo8.testcase                      |    7 +
 .../loginetfromtgeo9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal10.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal11.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal12.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal13.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgeheal9.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit10.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit11.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit12.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit13.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit14.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit15.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit16.testcase |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit5.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit6.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit7.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit8.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modedgesplit9.testcase  |    7 +
 .../modgeolinksplit1.testcase                      |    7 +
 .../modgeolinksplit2.testcase                      |    7 +
 .../modgeolinksplit3.testcase                      |    7 +
 .../modgeolinksplit4.testcase                      |    7 +
 .../modgeolinksplit5.testcase                      |    7 +
 .../modgeolinksplit6.testcase                      |    7 +
 .../modgeolinksplit7.testcase                      |    7 +
 .../modgeolinksplit8.testcase                      |    7 +
 .../modgeolinksplit9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal10.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal11.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal12.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal13.testcase  |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/modlinkheal9.testcase   |    7 +
 .../modloglinksplit1.testcase                      |    7 +
 .../modloglinksplit2.testcase                      |    7 +
 .../modloglinksplit3.testcase                      |    7 +
 .../modloglinksplit4.testcase                      |    7 +
 .../modloglinksplit5.testcase                      |    7 +
 .../modloglinksplit6.testcase                      |    7 +
 .../modloglinksplit7.testcase                      |    7 +
 .../modloglinksplit8.testcase                      |    7 +
 .../modloglinksplit9.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode1.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode2.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode3.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode4.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode5.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode6.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode7.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode8.testcase |    7 +
 .../sql_stmt_rttopo_tests/moveisonetnode9.testcase |    7 +
 test/sql_stmt_rttopo_tests/moveisonode1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode10.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode11.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode12.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode13.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode14.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode15.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode16.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode17.testcase  |    7 +
 test/sql_stmt_rttopo_tests/moveisonode2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/moveisonode9.testcase   |    7 +
 test/sql_stmt_rttopo_tests/netexception1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/netexception2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal10.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal11.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal12.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal13.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgeheal9.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit1.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit10.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit11.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit12.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit13.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit14.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit15.testcase |    7 +
 .../sql_stmt_rttopo_tests/newedgessplit16.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit2.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit3.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit4.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit5.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit6.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit7.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit8.testcase |    7 +
 test/sql_stmt_rttopo_tests/newedgessplit9.testcase |    7 +
 .../newgeolinksplit1.testcase                      |    7 +
 .../newgeolinksplit2.testcase                      |    7 +
 .../newgeolinksplit3.testcase                      |    7 +
 .../newgeolinksplit4.testcase                      |    7 +
 .../newgeolinksplit5.testcase                      |    7 +
 .../newgeolinksplit6.testcase                      |    7 +
 .../newgeolinksplit7.testcase                      |    7 +
 .../newgeolinksplit8.testcase                      |    7 +
 .../newgeolinksplit9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal1.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal10.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal11.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal12.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal13.testcase  |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal2.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal3.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal4.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal5.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal6.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal7.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal8.testcase   |    7 +
 test/sql_stmt_rttopo_tests/newlinkheal9.testcase   |    7 +
 .../newloglinksplit1.testcase                      |    7 +
 .../newloglinksplit2.testcase                      |    7 +
 .../newloglinksplit3.testcase                      |    7 +
 .../newloglinksplit4.testcase                      |    7 +
 .../newloglinksplit5.testcase                      |    7 +
 .../newloglinksplit6.testcase                      |    7 +
 .../newloglinksplit7.testcase                      |    7 +
 .../newloglinksplit8.testcase                      |    7 +
 .../newloglinksplit9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed1.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed10.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed11.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed12.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed13.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed14.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed15.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed16.testcase |    7 +
 .../sql_stmt_rttopo_tests/pointsnapseed17.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed2.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed3.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed4.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed5.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed6.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed7.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed8.testcase |    7 +
 test/sql_stmt_rttopo_tests/pointsnapseed9.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface1.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface2.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface3.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface4.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface5.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface6.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface7.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface8.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgemodface9.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface1.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface2.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface3.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface4.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface5.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface6.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface7.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface8.testcase |    7 +
 .../sql_stmt_rttopo_tests/remedgenewface9.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisoedge1.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge2.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge3.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge4.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge5.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge6.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge7.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge8.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisoedge9.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode1.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode2.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode3.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode4.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode5.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode6.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode7.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode8.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonetnode9.testcase |    7 +
 test/sql_stmt_rttopo_tests/remisonode1.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode2.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode3.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode4.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode5.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode6.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode7.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode8.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remisonode9.testcase    |    7 +
 test/sql_stmt_rttopo_tests/remlink1.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink2.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink3.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink4.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink5.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink6.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink7.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink8.testcase       |    7 +
 test/sql_stmt_rttopo_tests/remlink9.testcase       |    7 +
 .../removetopolayer1.testcase                      |    7 +
 .../removetopolayer2.testcase                      |    7 +
 .../removetopolayer3.testcase                      |    7 +
 .../removetopolayer4.testcase                      |    7 +
 .../removetopolayer5.testcase                      |    7 +
 .../removetopolayer6.testcase                      |    7 +
 .../removetopolayer7.testcase                      |    7 +
 .../removetopolayer8.testcase                      |    7 +
 .../removetopolayer9.testcase                      |    7 +
 .../spatnetfromgeom1.testcase                      |    7 +
 .../spatnetfromgeom10.testcase                     |    7 +
 .../spatnetfromgeom2.testcase                      |    7 +
 .../spatnetfromgeom3.testcase                      |    7 +
 .../spatnetfromgeom4.testcase                      |    7 +
 .../spatnetfromgeom5.testcase                      |    7 +
 .../spatnetfromgeom6.testcase                      |    7 +
 .../spatnetfromgeom7.testcase                      |    7 +
 .../spatnetfromgeom8.testcase                      |    7 +
 .../spatnetfromgeom9.testcase                      |    7 +
 .../spatnetfromtgeo1.testcase                      |    7 +
 .../spatnetfromtgeo2.testcase                      |    7 +
 .../spatnetfromtgeo3.testcase                      |    7 +
 .../spatnetfromtgeo4.testcase                      |    7 +
 .../spatnetfromtgeo5.testcase                      |    7 +
 .../spatnetfromtgeo6.testcase                      |    7 +
 .../spatnetfromtgeo7.testcase                      |    7 +
 .../spatnetfromtgeo8.testcase                      |    7 +
 .../spatnetfromtgeo9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/topoexception1.testcase |    7 +
 test/sql_stmt_rttopo_tests/topoexception2.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline1.testcase |    7 +
 .../topogeoaddline10.testcase                      |    7 +
 .../topogeoaddline11.testcase                      |    7 +
 .../topogeoaddline12.testcase                      |    7 +
 .../topogeoaddline13.testcase                      |    7 +
 .../topogeoaddline14.testcase                      |    7 +
 .../topogeoaddline15.testcase                      |    7 +
 .../topogeoaddline16.testcase                      |    7 +
 .../topogeoaddline17.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline2.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline3.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline4.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline5.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline6.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline7.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline8.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeoaddline9.testcase |    7 +
 .../topogeoaddpoint1.testcase                      |    7 +
 .../topogeoaddpoint10.testcase                     |    7 +
 .../topogeoaddpoint11.testcase                     |    7 +
 .../topogeoaddpoint12.testcase                     |    7 +
 .../topogeoaddpoint13.testcase                     |    7 +
 .../topogeoaddpoint14.testcase                     |    7 +
 .../topogeoaddpoint15.testcase                     |    7 +
 .../topogeoaddpoint16.testcase                     |    7 +
 .../topogeoaddpoint17.testcase                     |    7 +
 .../topogeoaddpoint2.testcase                      |    7 +
 .../topogeoaddpoint3.testcase                      |    7 +
 .../topogeoaddpoint4.testcase                      |    7 +
 .../topogeoaddpoint5.testcase                      |    7 +
 .../topogeoaddpoint6.testcase                      |    7 +
 .../topogeoaddpoint7.testcase                      |    7 +
 .../topogeoaddpoint8.testcase                      |    7 +
 .../topogeoaddpoint9.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone10.testcase |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone11.testcase |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone12.testcase |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone5.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone6.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone7.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone8.testcase  |    7 +
 test/sql_stmt_rttopo_tests/topogeoclone9.testcase  |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext1.testcase |    7 +
 .../topogeofromext10.testcase                      |    7 +
 .../topogeofromext11.testcase                      |    7 +
 .../topogeofromext12.testcase                      |    7 +
 .../topogeofromext13.testcase                      |    7 +
 .../topogeofromext14.testcase                      |    7 +
 .../topogeofromext15.testcase                      |    7 +
 .../topogeofromext16.testcase                      |    7 +
 .../topogeofromext17.testcase                      |    7 +
 .../topogeofromext18.testcase                      |    7 +
 .../topogeofromext19.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext2.testcase |    7 +
 .../topogeofromext20.testcase                      |    7 +
 .../topogeofromext21.testcase                      |    7 +
 .../topogeofromext22.testcase                      |    7 +
 .../topogeofromext23.testcase                      |    7 +
 .../topogeofromext24.testcase                      |    7 +
 .../topogeofromext25.testcase                      |    7 +
 .../topogeofromext26.testcase                      |    7 +
 .../topogeofromext27.testcase                      |    7 +
 .../topogeofromext28.testcase                      |    7 +
 .../topogeofromext29.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext3.testcase |    7 +
 .../topogeofromext30.testcase                      |    7 +
 .../topogeofromext31.testcase                      |    7 +
 .../topogeofromext32.testcase                      |    7 +
 .../topogeofromext33.testcase                      |    7 +
 .../topogeofromext34.testcase                      |    7 +
 .../topogeofromext35.testcase                      |    7 +
 .../topogeofromext36.testcase                      |    7 +
 .../topogeofromext37.testcase                      |    7 +
 .../topogeofromext38.testcase                      |    7 +
 .../topogeofromext39.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext4.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext5.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext6.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext7.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext8.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeofromext9.testcase |    7 +
 .../topogeofromtable1.testcase                     |    7 +
 .../topogeofromtable10.testcase                    |    7 +
 .../topogeofromtable11.testcase                    |    7 +
 .../topogeofromtable12.testcase                    |    7 +
 .../topogeofromtable13.testcase                    |    7 +
 .../topogeofromtable14.testcase                    |    7 +
 .../topogeofromtable15.testcase                    |    7 +
 .../topogeofromtable16.testcase                    |    7 +
 .../topogeofromtable17.testcase                    |    7 +
 .../topogeofromtable18.testcase                    |    7 +
 .../topogeofromtable19.testcase                    |    7 +
 .../topogeofromtable2.testcase                     |    7 +
 .../topogeofromtable20.testcase                    |    7 +
 .../topogeofromtable21.testcase                    |    7 +
 .../topogeofromtable22.testcase                    |    7 +
 .../topogeofromtable23.testcase                    |    7 +
 .../topogeofromtable24.testcase                    |    7 +
 .../topogeofromtable25.testcase                    |    7 +
 .../topogeofromtable26.testcase                    |    7 +
 .../topogeofromtable27.testcase                    |    7 +
 .../topogeofromtable28.testcase                    |    7 +
 .../topogeofromtable29.testcase                    |    7 +
 .../topogeofromtable3.testcase                     |    7 +
 .../topogeofromtable30.testcase                    |    7 +
 .../topogeofromtable4.testcase                     |    7 +
 .../topogeofromtable5.testcase                     |    7 +
 .../topogeofromtable6.testcase                     |    7 +
 .../topogeofromtable7.testcase                     |    7 +
 .../topogeofromtable8.testcase                     |    7 +
 .../topogeofromtable9.testcase                     |    7 +
 .../topogeoremoveedges1.testcase                   |    7 +
 .../topogeoremoveedges2.testcase                   |    7 +
 .../topogeoremoveedges3.testcase                   |    7 +
 .../topogeoremoveedges4.testcase                   |    7 +
 .../topogeoremoveedges5.testcase                   |    7 +
 .../topogeoremovenodes1.testcase                   |    7 +
 .../topogeoremovenodes2.testcase                   |    7 +
 .../topogeoremovenodes3.testcase                   |    7 +
 .../topogeoremovenodes4.testcase                   |    7 +
 .../topogeoremovenodes5.testcase                   |    7 +
 .../topogeoremovesmall1.testcase                   |    7 +
 .../topogeoremovesmall2.testcase                   |    7 +
 .../topogeoremovesmall3.testcase                   |    7 +
 .../topogeoremovesmall4.testcase                   |    7 +
 .../topogeoremovesmall5.testcase                   |    7 +
 .../topogeoremovesmall6.testcase                   |    7 +
 .../topogeoremovesmall7.testcase                   |    7 +
 .../topogeoremovesmall8.testcase                   |    7 +
 .../topogeoremovesmall9.testcase                   |    7 +
 .../topogeosplitline1.testcase                     |    7 +
 .../topogeosplitline10.testcase                    |    7 +
 .../topogeosplitline11.testcase                    |    7 +
 .../topogeosplitline12.testcase                    |    7 +
 .../topogeosplitline13.testcase                    |    7 +
 .../topogeosplitline14.testcase                    |    7 +
 .../topogeosplitline15.testcase                    |    7 +
 .../topogeosplitline16.testcase                    |    7 +
 .../topogeosplitline2.testcase                     |    7 +
 .../topogeosplitline3.testcase                     |    7 +
 .../topogeosplitline4.testcase                     |    7 +
 .../topogeosplitline5.testcase                     |    7 +
 .../topogeosplitline6.testcase                     |    7 +
 .../topogeosplitline7.testcase                     |    7 +
 .../topogeosplitline8.testcase                     |    7 +
 .../topogeosplitline9.testcase                     |    7 +
 .../sql_stmt_rttopo_tests/topogeototable1.testcase |    7 +
 .../topogeototable10.testcase                      |    7 +
 .../topogeototable11.testcase                      |    7 +
 .../topogeototable12.testcase                      |    7 +
 .../topogeototable13.testcase                      |    7 +
 .../topogeototable14.testcase                      |    7 +
 .../topogeototable15.testcase                      |    7 +
 .../topogeototable16.testcase                      |    7 +
 .../topogeototable17.testcase                      |    7 +
 .../topogeototable18.testcase                      |    7 +
 .../topogeototable19.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeototable2.testcase |    7 +
 .../topogeototable20.testcase                      |    7 +
 .../topogeototable21.testcase                      |    7 +
 .../topogeototable22.testcase                      |    7 +
 .../topogeototable23.testcase                      |    7 +
 .../topogeototable24.testcase                      |    7 +
 .../topogeototable25.testcase                      |    7 +
 .../topogeototable26.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/topogeototable3.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable4.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable5.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable6.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable7.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable8.testcase |    7 +
 .../sql_stmt_rttopo_tests/topogeototable9.testcase |    7 +
 .../topogeototablegen1.testcase                    |    7 +
 .../topogeototablegen10.testcase                   |    7 +
 .../topogeototablegen11.testcase                   |    7 +
 .../topogeototablegen12.testcase                   |    7 +
 .../topogeototablegen13.testcase                   |    7 +
 .../topogeototablegen14.testcase                   |    7 +
 .../topogeototablegen15.testcase                   |    7 +
 .../topogeototablegen16.testcase                   |    7 +
 .../topogeototablegen17.testcase                   |    7 +
 .../topogeototablegen18.testcase                   |    7 +
 .../topogeototablegen19.testcase                   |    7 +
 .../topogeototablegen2.testcase                    |    7 +
 .../topogeototablegen20.testcase                   |    7 +
 .../topogeototablegen21.testcase                   |    7 +
 .../topogeototablegen22.testcase                   |    7 +
 .../topogeototablegen23.testcase                   |    7 +
 .../topogeototablegen24.testcase                   |    7 +
 .../topogeototablegen25.testcase                   |    7 +
 .../topogeototablegen26.testcase                   |    7 +
 .../topogeototablegen27.testcase                   |    7 +
 .../topogeototablegen28.testcase                   |    7 +
 .../topogeototablegen29.testcase                   |    7 +
 .../topogeototablegen3.testcase                    |    7 +
 .../topogeototablegen30.testcase                   |    7 +
 .../topogeototablegen31.testcase                   |    7 +
 .../topogeototablegen4.testcase                    |    7 +
 .../topogeototablegen5.testcase                    |    7 +
 .../topogeototablegen6.testcase                    |    7 +
 .../topogeototablegen7.testcase                    |    7 +
 .../topogeototablegen8.testcase                    |    7 +
 .../topogeototablegen9.testcase                    |    7 +
 .../topogeoupdateseeds1.testcase                   |    7 +
 .../topogeoupdateseeds10.testcase                  |    7 +
 .../topogeoupdateseeds2.testcase                   |    7 +
 .../topogeoupdateseeds3.testcase                   |    7 +
 .../topogeoupdateseeds4.testcase                   |    7 +
 .../topogeoupdateseeds5.testcase                   |    7 +
 .../topogeoupdateseeds6.testcase                   |    7 +
 .../topogeoupdateseeds7.testcase                   |    7 +
 .../topogeoupdateseeds8.testcase                   |    7 +
 .../topogeoupdateseeds9.testcase                   |    7 +
 .../topomettotable25.testcase                      |    7 +
 test/sql_stmt_rttopo_tests/toponetclone1.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone10.testcase |    7 +
 test/sql_stmt_rttopo_tests/toponetclone11.testcase |    7 +
 test/sql_stmt_rttopo_tests/toponetclone12.testcase |    7 +
 test/sql_stmt_rttopo_tests/toponetclone2.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone3.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone4.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone5.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone6.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone7.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone8.testcase  |    7 +
 test/sql_stmt_rttopo_tests/toponetclone9.testcase  |    7 +
 .../toponetfromtable1.testcase                     |    7 +
 .../toponetfromtable10.testcase                    |    7 +
 .../toponetfromtable11.testcase                    |    7 +
 .../toponetfromtable12.testcase                    |    7 +
 .../toponetfromtable13.testcase                    |    7 +
 .../toponetfromtable14.testcase                    |    7 +
 .../toponetfromtable15.testcase                    |    7 +
 .../toponetfromtable16.testcase                    |    7 +
 .../toponetfromtable17.testcase                    |    7 +
 .../toponetfromtable2.testcase                     |    7 +
 .../toponetfromtable3.testcase                     |    7 +
 .../toponetfromtable4.testcase                     |    7 +
 .../toponetfromtable5.testcase                     |    7 +
 .../toponetfromtable6.testcase                     |    7 +
 .../toponetfromtable7.testcase                     |    7 +
 .../toponetfromtable8.testcase                     |    7 +
 .../toponetfromtable9.testcase                     |    7 +
 .../sql_stmt_rttopo_tests/toponettotable1.testcase |    7 +
 .../toponettotable10.testcase                      |    7 +
 .../toponettotable11.testcase                      |    7 +
 .../toponettotable12.testcase                      |    7 +
 .../toponettotable13.testcase                      |    7 +
 .../toponettotable14.testcase                      |    7 +
 .../toponettotable15.testcase                      |    7 +
 .../toponettotable16.testcase                      |    7 +
 .../toponettotable17.testcase                      |    7 +
 .../toponettotable18.testcase                      |    7 +
 .../toponettotable19.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/toponettotable2.testcase |    7 +
 .../toponettotable20.testcase                      |    7 +
 .../toponettotable21.testcase                      |    7 +
 .../toponettotable22.testcase                      |    7 +
 .../toponettotable23.testcase                      |    7 +
 .../toponettotable24.testcase                      |    7 +
 .../toponettotable25.testcase                      |    7 +
 .../toponettotable26.testcase                      |    7 +
 .../sql_stmt_rttopo_tests/toponettotable3.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable4.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable5.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable6.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable7.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable8.testcase |    7 +
 .../sql_stmt_rttopo_tests/toponettotable9.testcase |    7 +
 .../toponettotablegen1.testcase                    |    7 +
 .../toponettotablegen10.testcase                   |    7 +
 .../toponettotablegen11.testcase                   |    7 +
 .../toponettotablegen12.testcase                   |    7 +
 .../toponettotablegen13.testcase                   |    7 +
 .../toponettotablegen14.testcase                   |    7 +
 .../toponettotablegen15.testcase                   |    7 +
 .../toponettotablegen16.testcase                   |    7 +
 .../toponettotablegen17.testcase                   |    7 +
 .../toponettotablegen18.testcase                   |    7 +
 .../toponettotablegen19.testcase                   |    7 +
 .../toponettotablegen2.testcase                    |    7 +
 .../toponettotablegen20.testcase                   |    7 +
 .../toponettotablegen21.testcase                   |    7 +
 .../toponettotablegen22.testcase                   |    7 +
 .../toponettotablegen23.testcase                   |    7 +
 .../toponettotablegen24.testcase                   |    7 +
 .../toponettotablegen25.testcase                   |    7 +
 .../toponettotablegen26.testcase                   |    7 +
 .../toponettotablegen27.testcase                   |    7 +
 .../toponettotablegen28.testcase                   |    7 +
 .../toponettotablegen29.testcase                   |    7 +
 .../toponettotablegen3.testcase                    |    7 +
 .../toponettotablegen30.testcase                   |    7 +
 .../toponettotablegen31.testcase                   |    7 +
 .../toponettotablegen4.testcase                    |    7 +
 .../toponettotablegen5.testcase                    |    7 +
 .../toponettotablegen6.testcase                    |    7 +
 .../toponettotablegen7.testcase                    |    7 +
 .../toponettotablegen8.testcase                    |    7 +
 .../toponettotablegen9.testcase                    |    7 +
 .../toponetupdateseeds1.testcase                   |    7 +
 .../toponetupdateseeds10.testcase                  |    7 +
 .../toponetupdateseeds2.testcase                   |    7 +
 .../toponetupdateseeds3.testcase                   |    7 +
 .../toponetupdateseeds4.testcase                   |    7 +
 .../toponetupdateseeds5.testcase                   |    7 +
 .../toponetupdateseeds6.testcase                   |    7 +
 .../toponetupdateseeds7.testcase                   |    7 +
 .../toponetupdateseeds8.testcase                   |    7 +
 .../toponetupdateseeds9.testcase                   |    7 +
 .../validatetopogeo1.testcase                      |    7 +
 .../validatetopogeo2.testcase                      |    7 +
 .../validatetopogeo3.testcase                      |    7 +
 .../validatetopogeo4.testcase                      |    7 +
 .../validatetopogeo5.testcase                      |    7 +
 .../validlogicalnet1.testcase                      |    7 +
 .../validlogicalnet2.testcase                      |    7 +
 .../validlogicalnet3.testcase                      |    7 +
 .../validlogicalnet4.testcase                      |    7 +
 .../validlogicalnet5.testcase                      |    7 +
 .../validspatialnet1.testcase                      |    7 +
 .../validspatialnet2.testcase                      |    7 +
 .../validspatialnet3.testcase                      |    7 +
 .../validspatialnet4.testcase                      |    7 +
 .../validspatialnet5.testcase                      |    7 +
 test/sql_stmt_tests/Makefile.am                    |   45 +
 test/sql_stmt_tests/Makefile.in                    |   45 +
 test/sql_stmt_tests/atmtransform10.testcase        |    7 +
 test/sql_stmt_tests/atmtransform9.testcase         |    7 +
 test/sql_stmt_tests/fromewktexp1.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp2.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp3.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp4.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp5.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp6.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp7.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp8.testcase          |    7 +
 test/sql_stmt_tests/fromewktexp9.testcase          |    7 +
 test/sql_stmt_tests/fromgeojsonexp1.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp2.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp3.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp4.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp5.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp6.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp7.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp8.testcase       |    7 +
 test/sql_stmt_tests/fromgeojsonexp9.testcase       |    7 +
 test/sql_stmt_tests/fromgmlexp1.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp2.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp3.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp4.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp5.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp6.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp7.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp8.testcase           |    7 +
 test/sql_stmt_tests/fromgmlexp9.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp1.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp2.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp3.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp4.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp5.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp6.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp7.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp8.testcase           |    7 +
 test/sql_stmt_tests/fromwktexp9.testcase           |    7 +
 test/sql_stmt_tests/geomfromkmlexp1.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp2.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp3.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp4.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp5.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp6.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp7.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp8.testcase       |    7 +
 test/sql_stmt_tests/geomfromkmlexp9.testcase       |    7 +
 test/sql_stmt_voronoj1_tests/Makefile              |  468 ++++
 test/sql_stmt_voronoj2_tests/Makefile              |  468 ++++
 test/test-legacy-3.0.1.sqlite                      |  Bin 32768 -> 32768 bytes
 1599 files changed, 29649 insertions(+), 8618 deletions(-)

diff --git a/.fslckout b/.fslckout
new file mode 100644
index 0000000..7590e98
Binary files /dev/null and b/.fslckout differ
diff --git a/Android_4.4.0.mk b/Android_4.4.0.mk
new file mode 100644
index 0000000..6d21358
--- /dev/null
+++ b/Android_4.4.0.mk
@@ -0,0 +1,37 @@
+# -------------------
+# Android_4.4.0.mk
+# [from 'jni/' directory]
+# ndk-build clean
+# ndk-build
+# -------------------
+# As of 2016-02-28
+# -------------------
+# changes:
+# - geos-3.5.0
+# - liblwgeom
+# - json-c-0.12
+# - spatialite [4.4.0-20160228]
+# -------------------
+LOCAL_PATH := $(call my-dir)
+JSQLITE_PATH := javasqlite-20120209
+SPATIALITE_PATH := libspatialite-4.4.0
+GEOS_PATH := geos-3.5.0
+JSONC_PATH := json-c-0.12
+LWGEOM_PATH := postgis-2.2.svn/liblwgeom
+PROJ4_PATH := proj-4.9.1
+SQLITE_PATH := sqlite-amalgamation-3081002
+ICONV_PATH := libiconv-1.13.1
+XML2_PATH := libxml2-2.9.1
+LZMA_PATH := xz-5.2.1
+
+include $(LOCAL_PATH)/iconv-1.13.1.mk
+include $(LOCAL_PATH)/sqlite-3081002.mk
+include $(LOCAL_PATH)/proj4-4.9.1.mk
+include $(LOCAL_PATH)/geos-3.5.0.mk
+include $(LOCAL_PATH)/json-c-0.12.mk
+include $(LOCAL_PATH)/liblwgeom-2.2.0.mk
+include $(LOCAL_PATH)/libxml2-2.9.1.mk
+include $(LOCAL_PATH)/lzma-xz-5.2.1.mk
+include $(LOCAL_PATH)/spatialite-4.4.0.mk
+include $(LOCAL_PATH)/jsqlite-20120209.mk
+$(call import-module,android/cpufeatures)
diff --git a/Makefile.am b/Makefile.am
index 96fef63..8a21e66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,9 +2,12 @@ ACLOCAL_AMFLAGS = -I m4
 
 AUTOMAKE_OPTIONS = dist-zip foreign
 
-EXTRA_DIST = makefile.vc nmake.opt Android_3.0.2.mk Android_4.3.0.mk \
-	spatialite-4.3.0.mk mainpage.doxy README.coverage \
-	spatialite-sql-latest.html config-msvc.h
+EXTRA_DIST = makefile.vc nmake.opt \
+	makefile_mod.vc nmake_mod.opt \
+	Android_3.0.2.mk Android_4.3.0.mk \
+	spatialite-4.3.0.mk Android_4.4.0.mk spatialite-4.4.0.mk \
+	mainpage.doxy README.coverage spatialite-sql-latest.html \
+	config-msvc.h
 
 if ENABLE_EXAMPLES
 EXAMPLES = examples
@@ -18,8 +21,10 @@ pkgconfig_DATA = spatialite.pc
 coverage-init:
 	lcov --directory src --capture --initial --output-file libspatialite_cov.info
 
+
 coverage::
 	lcov --rc lcov_branch_coverage=1 --directory src --output-file libspatialite_cov.info --capture
+	lcov --rc lcov_branch_coverage=1 --remove libspatialite_cov.info "*/src/gaiageo/*Lexer.l" --output-file libspatialite_cov.info
 	genhtml --rc lcov_branch_coverage=1 -o covresults libspatialite_cov.info
 
 MOSTLYCLEANFILES = libspatialite_cov.info
diff --git a/Makefile.in b/Makefile.in
index 4a71707..913a2d0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -367,9 +367,12 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = dist-zip foreign
-EXTRA_DIST = makefile.vc nmake.opt Android_3.0.2.mk Android_4.3.0.mk \
-	spatialite-4.3.0.mk mainpage.doxy README.coverage \
-	spatialite-sql-latest.html config-msvc.h
+EXTRA_DIST = makefile.vc nmake.opt \
+	makefile_mod.vc nmake_mod.opt \
+	Android_3.0.2.mk Android_4.3.0.mk \
+	spatialite-4.3.0.mk Android_4.4.0.mk spatialite-4.4.0.mk \
+	mainpage.doxy README.coverage spatialite-sql-latest.html \
+	config-msvc.h
 
 @ENABLE_EXAMPLES_TRUE at EXAMPLES = examples
 SUBDIRS = src test $(EXAMPLES)
@@ -892,6 +895,7 @@ coverage-init:
 
 coverage::
 	lcov --rc lcov_branch_coverage=1 --directory src --output-file libspatialite_cov.info --capture
+	lcov --rc lcov_branch_coverage=1 --remove libspatialite_cov.info "*/src/gaiageo/*Lexer.l" --output-file libspatialite_cov.info
 	genhtml --rc lcov_branch_coverage=1 -o covresults libspatialite_cov.info
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/amalgamate.c b/amalgamate.c
new file mode 100644
index 0000000..bec0d0e
--- /dev/null
+++ b/amalgamate.c
@@ -0,0 +1,1140 @@
+/* 
+**
+** amalgamate.c
+**
+** produces the SpatiaLite's AMALGAMATION
+**
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#define PREFIX	"./src"
+
+/* globals: autogenerated snippet paths */
+const char *vanuatuWkt_h = "/gaiageo/vanuatuWkt.h";
+const char *vanuatuWkt_c = "/gaiageo/vanuatuWkt.c";
+const char *Ewkt_h = "/gaiageo/Ewkt.h";
+const char *Ewkt_c = "/gaiageo/Ewkt.c";
+const char *geoJSON_h = "/gaiageo/geoJSON.h";
+const char *geoJSON_c = "/gaiageo/geoJSON.c";
+const char *Kml_h = "/gaiageo/Kml.h";
+const char *Kml_c = "/gaiageo/Kml.c";
+const char *Gml_h = "/gaiageo/Gml.h";
+const char *Gml_c = "/gaiageo/Gml.c";
+const char *lex_VanuatuWkt_c = "/gaiageo/lex.VanuatuWkt.c";
+const char *lex_Ewkt_c = "/gaiageo/lex.Ewkt.c";
+const char *lex_GeoJson_c = "/gaiageo/lex.GeoJson.c";
+const char *lex_Kml_c = "/gaiageo/lex.Kml.c";
+const char *lex_Gml_c = "/gaiageo/lex.Gml.c";
+const char *epsg_inlined_c = "/srsinit/epsg_inlined.c";
+
+struct masked_keyword
+{
+    char *keyword;
+    struct masked_keyword *next;
+};
+
+static void
+do_auto_sh (FILE * out)
+{
+/* producing the auto-sh script [automake chain] */
+    fprintf (out, "cd ./amalgamation\n");
+    fprintf (out, "echo aclocal\n");
+    fprintf (out, "aclocal\n");
+    fprintf (out, "echo autoheader\n");
+    fprintf (out, "autoheader\n");
+    fprintf (out, "echo autoconf\n");
+    fprintf (out, "autoconf\n");
+    fprintf (out, "echo libtoolize\n");
+    fprintf (out, "libtoolize\n");
+    fprintf (out, "echo automake --add-missing --foreign\n");
+    fprintf (out, "automake --add-missing --foreign\n\n");
+}
+
+static void
+do_headers (FILE * out, struct masked_keyword *first)
+{
+/* prepares the headers for SpatiaLite-Amalgamation */
+    struct masked_keyword *p;
+    char now[64];
+    time_t now_time;
+    struct tm *tmp;
+    now_time = time (NULL);
+    tmp = localtime (&now_time);
+    strftime (now, 64, "%Y-%m-%d %H:%M:%S %z", tmp);
+    fprintf (out,
+	     "/******************************************************************************\n");
+    fprintf (out,
+	     "** This file is an amalgamation of many separate C source files from SpatiaLite\n");
+    fprintf (out,
+	     "** version 3.0.0-beta1.  By combining all the individual C code files into this\n");
+    fprintf (out,
+	     "** single large file, the entire code can be compiled as a one translation\n");
+    fprintf (out,
+	     "** unit.  This allows many compilers to do optimizations that would not be\n");
+    fprintf (out,
+	     "** possible if the files were compiled separately.  Performance improvements\n");
+    fprintf (out,
+	     "** of 5%% are more are commonly seen when SQLite is compiled as a single\n");
+    fprintf (out, "** translation unit.\n");
+    fprintf (out, "**\n** This amalgamation was generated on %s.\n\n", now);
+    fprintf (out, "Author: Alessandro (Sandro) Furieri <a.furieri at lqt.it>\n\n");
+    fprintf (out,
+	     "------------------------------------------------------------------------------\n\n");
+    fprintf (out, "Version: MPL 1.1/GPL 2.0/LGPL 2.1\n\n");
+    fprintf (out,
+	     "The contents of this file are subject to the Mozilla Public License Version\n");
+    fprintf (out,
+	     "1.1 (the \"License\"); you may not use this file except in compliance with\n");
+    fprintf (out, "the License. You may obtain a copy of the License at\n");
+    fprintf (out, "http://www.mozilla.org/MPL/\n\n");
+    fprintf (out,
+	     "Software distributed under the License is distributed on an \"AS IS\" basis,\n");
+    fprintf (out,
+	     "WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n");
+    fprintf (out,
+	     "for the specific language governing rights and limitations under the\n");
+    fprintf (out, "License.\n\n");
+    fprintf (out, "The Original Code is the SpatiaLite library\n\n");
+    fprintf (out,
+	     "The Initial Developer of the Original Code is Alessandro Furieri\n\n");
+    fprintf (out,
+	     "Portions created by the Initial Developer are Copyright (C) 2008\n");
+    fprintf (out, "the Initial Developer. All Rights Reserved.\n\n");
+    fprintf (out, "Contributor(s):\n");
+    fprintf (out, "Klaus Foerster klaus.foerster at svg.cc\n");
+    fprintf (out, "Luigi Costalli luigi.costalli at gmail.com\n");
+    fprintf (out, "The Vanuatu Team - University of Toronto\n");
+    fprintf (out, "\tSupervisor: Greg Wilson gwilson at cs.toronto.ca\n");
+    fprintf (out, "\n");
+    fprintf (out,
+	     "Alternatively, the contents of this file may be used under the terms of\n");
+    fprintf (out,
+	     "either the GNU General Public License Version 2 or later (the \"GPL\"), or\n");
+    fprintf (out,
+	     "the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n");
+    fprintf (out,
+	     "in which case the provisions of the GPL or the LGPL are applicable instead\n");
+    fprintf (out,
+	     "of those above. If you wish to allow use of your version of this file only\n");
+    fprintf (out,
+	     "under the terms of either the GPL or the LGPL, and not to allow others to\n");
+    fprintf (out,
+	     "use your version of this file under the terms of the MPL, indicate your\n");
+    fprintf (out,
+	     "decision by deleting the provisions above and replace them with the notice\n");
+    fprintf (out,
+	     "and other provisions required by the GPL or the LGPL. If you do not delete\n");
+    fprintf (out,
+	     "the provisions above, a recipient may use your version of this file under\n");
+    fprintf (out,
+	     "the terms of any one of the MPL, the GPL or the LGPL.\n\n*/\n\n");
+    fprintf (out, "#if defined(_WIN32) && !defined(__MINGW32__)\n");
+    fprintf (out, "/* MSVC strictly requires this include [off_t] */\n");
+    fprintf (out, "#include <sys/types.h>\n");
+    fprintf (out, "#endif\n\n");
+    fprintf (out, "#include <stdio.h>\n");
+    fprintf (out, "#include <stdlib.h>\n");
+    fprintf (out, "#include <string.h>\n");
+    fprintf (out, "#include <memory.h>\n");
+    fprintf (out, "#include <limits.h>\n");
+    fprintf (out, "#include <math.h>\n");
+    fprintf (out, "#include <float.h>\n");
+    fprintf (out, "#include <locale.h>\n");
+    fprintf (out, "#include <errno.h>\n\n");
+    fprintf (out, "#include <assert.h>\n\n");
+    fprintf (out, "#include \"config.h\"\n\n");
+    fprintf (out, "#if defined(__MINGW32__) || defined(_WIN32)\n");
+    fprintf (out, "#define LIBICONV_STATIC\n");
+    fprintf (out, "#include <iconv.h>\n");
+    fprintf (out, "#define LIBCHARSET_STATIC\n");
+    fprintf (out, "#ifdef _MSC_VER\n");
+    fprintf (out, "/* <localcharset.h> isn't supported on OSGeo4W */\n");
+    fprintf (out, "/* applying a tricky workaround to fix this issue */\n");
+    fprintf (out, "extern const char * locale_charset (void);\n");
+    fprintf (out, "#else /* sane Windows - not OSGeo4W */\n");
+    fprintf (out, "#include <localcharset.h>\n");
+    fprintf (out, "#endif /* end localcharset */\n");
+    fprintf (out, "#else /* not WINDOWS */\n");
+    fprintf (out, "#if defined(__APPLE__) || defined(__ANDROID__)\n");
+    fprintf (out, "#include <iconv.h>\n");
+    fprintf (out, "#include <localcharset.h>\n");
+    fprintf (out, "#else /* not Mac OsX */\n");
+    fprintf (out, "#include <iconv.h>\n");
+    fprintf (out, "#include <langinfo.h>\n");
+    fprintf (out, "#endif\n#endif\n\n");
+    fprintf (out, "#if defined(_WIN32) || defined(WIN32)\n");
+    fprintf (out, "#include <io.h>\n");
+    fprintf (out, "#ifndef isatty\n");
+    fprintf (out, "#define isatty	_isatty\n");
+    fprintf (out, "#endif\n");
+    fprintf (out, "#ifndef fileno\n");
+    fprintf (out, "#define fileno	_fileno\n");
+    fprintf (out, "#endif\n");
+    fprintf (out, "#else\n");
+    fprintf (out, "#include <unistd.h>\n");
+    fprintf (out, "#endif\n\n");
+    fprintf (out, "#ifndef OMIT_GEOS	/* including GEOS */\n");
+    fprintf (out, "#include <geos_c.h>\n");
+    fprintf (out, "#endif\n\n");
+    fprintf (out, "#ifndef OMIT_PROJ	/* including PROJ.4 */\n");
+    fprintf (out, "#include <proj_api.h>\n");
+    fprintf (out, "#endif\n\n");
+    fprintf (out, "#ifndef OMIT_FREEXL	/* including FreeXL */\n");
+    fprintf (out, "#include <freexl.h>\n");
+    fprintf (out, "#endif\n\n");
+    fprintf (out, "#ifdef _WIN32\n");
+    fprintf (out, "#define strcasecmp\t_stricmp\n");
+    fprintf (out, "#define strncasecmp\t_strnicmp\n");
+    fprintf (out, "#define atoll\t_atoi64\n");
+    fprintf (out, "#endif /* not WIN32 */\n\n");
+    fprintf (out, "/*\n** alias MACROs to avoid any potential collision\n");
+    fprintf (out, "** for linker symbols declared into the sqlite3 code\n");
+    fprintf (out, "** internally embedded into SpatiaLite\n*/\n");
+    p = first;
+    while (p)
+      {
+	  char alias[1024];
+	  strcpy (alias, p->keyword);
+	  alias[0] = 'S';
+	  alias[1] = 'P';
+	  alias[2] = 'L';
+	  fprintf (out, "#define %s %s\n", p->keyword, alias);
+	  p = p->next;
+      }
+    fprintf (out, "/* end SpatiaLite/sqlite3 alias macros */\n\n");
+}
+
+static void
+do_note (FILE * out, const char *file, int mode)
+{
+/* begin/end file markerts */
+    if (mode)
+	fprintf (out, "/**************** End file: %s **********/\n\n", file);
+    else
+	fprintf (out, "\n/**************** Begin file: %s **********/\n", file);
+}
+
+static void
+do_sqlite3_dll (FILE * out, struct masked_keyword *first)
+{
+/* inserting #ifdef to build a Windows DLL */
+    struct masked_keyword *p;
+    fprintf (out, "#ifdef DLL_EXPORT\n");
+    fprintf (out, "#define SQLITE_API __declspec(dllexport)\n");
+    fprintf (out, "#else\n#define SQLITE_API\n#endif\n\n");
+    fprintf (out, "/*\n** the following macros ensure that the sqlite3\n");
+    fprintf (out, "** code internally embedded in SpatiaLite never defines\n");
+    fprintf (out, "** any linker symbol potentially conflicting with\n");
+    fprintf (out, "** an external sqlite3 library\n*/\n");
+    p = first;
+    while (p)
+      {
+	  char alias[1024];
+	  strcpy (alias, p->keyword);
+	  if (strcmp (alias, "sqlite3_column_database_name") == 0 ||
+	      strcmp (alias, "sqlite3_column_database_name16") == 0 ||
+	      strcmp (alias, "sqlite3_column_table_name") == 0 ||
+	      strcmp (alias, "sqlite3_column_table_name16") == 0 ||
+	      strcmp (alias, "sqlite3_column_origin_name") == 0 ||
+	      strcmp (alias, "sqlite3_column_origin_name16") == 0 ||
+	      strcmp (alias, "sqlite3_table_column_metadata") == 0)
+	    {
+/* avoiding to define METADATA symbols (usually disabled) */
+		p = p->next;
+		continue;
+	    }
+	  alias[0] = 'S';
+	  alias[1] = 'P';
+	  alias[2] = 'L';
+	  fprintf (out, "#define %s %s\n", p->keyword, alias);
+	  p = p->next;
+      }
+    fprintf (out, "/* End SpatiaLite alias-MACROs */\n\n");
+}
+
+static int
+is_header (const char *row)
+{
+/* checks for #include */
+    if (strncmp (row, "#include <inttypes.h>", 21) == 0)
+      {
+	  /* note well: inttypes.h must not be commented */
+	  return 0;
+      }
+    if (strlen (row) >= 8 && strncmp (row, "#include", 8) == 0)
+	return 1;
+    return 0;
+}
+
+static const char *
+check_autogenerated_path (const char *row)
+{
+/* checks for #include (autogenerated code) */
+    if (strncmp (row, "#include \"vanuatuWkt.h\"", 23) == 0)
+	return vanuatuWkt_h;
+    if (strncmp (row, "#include \"vanuatuWkt.c\"", 23) == 0)
+	return vanuatuWkt_c;
+    if (strncmp (row, "#include \"Ewkt.h\"", 17) == 0)
+	return Ewkt_h;
+    if (strncmp (row, "#include \"Ewkt.c\"", 17) == 0)
+	return Ewkt_c;
+    if (strncmp (row, "#include \"geoJSON.h\"", 20) == 0)
+	return geoJSON_h;
+    if (strncmp (row, "#include \"geoJSON.c\"", 20) == 0)
+	return geoJSON_c;
+    if (strncmp (row, "#include \"Kml.h\"", 16) == 0)
+	return Kml_h;
+    if (strncmp (row, "#include \"Kml.c\"", 16) == 0)
+	return Kml_c;
+    if (strncmp (row, "#include \"Gml.h\"", 16) == 0)
+	return Gml_h;
+    if (strncmp (row, "#include \"Gml.c\"", 16) == 0)
+	return Gml_c;
+    if (strncmp (row, "#include \"lex.VanuatuWkt.c\"", 27) == 0)
+	return lex_VanuatuWkt_c;
+    if (strncmp (row, "#include \"lex.Ewkt.c\"", 21) == 0)
+	return lex_Ewkt_c;
+    if (strncmp (row, "#include \"lex.GeoJson.c\"", 24) == 0)
+	return lex_GeoJson_c;
+    if (strncmp (row, "#include \"lex.Kml.c\"", 20) == 0)
+	return lex_Kml_c;
+    if (strncmp (row, "#include \"lex.Gml.c\"", 20) == 0)
+	return lex_Gml_c;
+    if (strncmp (row, "#include \"epsg_inlined.c\"", 25) == 0)
+	return epsg_inlined_c;
+    return NULL;
+}
+
+static void
+do_copy_sqlite (FILE * out, const char *basedir, const char *file)
+{
+/* copy the sqlite3.h header */
+    char input[1024];
+    char row[256];
+    char *p = row;
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, basedir);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    do_note (out, file, 0);
+    while ((c = getc (in)) != EOF)
+      {
+	  *p++ = c;
+	  if (c == '\n')
+	    {
+		*p = '\0';
+		p = row;
+		fprintf (out, "%s", row);
+	    }
+      }
+    fclose (in);
+    do_note (out, file, 1);
+}
+
+static void
+do_copy_plain (FILE * out, const char *file)
+{
+/* copy a source AS IS */
+    char input[1024];
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    while ((c = getc (in)) != EOF)
+	putc (c, out);
+    fclose (in);
+}
+
+static void
+do_copy (FILE * out, const char *basedir, const char *file)
+{
+
+/* copy a source file suppressing the boiler-plate and headers */
+    char input[1024];
+    char row[256];
+    char *p = row;
+    int c;
+    int boiler_plate = 0;
+    int boiler_plate_found = 0;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, basedir);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    do_note (out, file, 0);
+    while ((c = getc (in)) != EOF)
+      {
+	  *p++ = c;
+	  if (c == '\n')
+	    {
+		*p = '\0';
+		p = row;
+		if (!boiler_plate_found && strlen (row) >= 2
+		    && strncmp (row, "/*", 2) == 0)
+		  {
+		      boiler_plate_found = 1;
+		      boiler_plate = 1;
+		      continue;
+		  }
+		if (boiler_plate)
+		  {
+		      if (strlen (row) >= 2 && strncmp (row, "*/", 2) == 0)
+			  boiler_plate = 0;
+		      continue;
+		  }
+		if (is_header (row))
+		  {
+		      const char *auto_path = check_autogenerated_path (row);
+		      row[strlen (row) - 1] = '\0';
+		      fprintf (out, "/* %s */\n", row);
+		      if (auto_path != NULL)
+			  do_copy_plain (out, auto_path);
+		      continue;
+		  }
+		fprintf (out, "%s", row);
+	    }
+      }
+    fclose (in);
+    do_note (out, file, 1);
+}
+
+static void
+feed_export_keywords (char *row, struct masked_keyword **first,
+		      struct masked_keyword **last)
+{
+    struct masked_keyword *p;
+    char kw[1024];
+    int len;
+    int i;
+    int skip = 0;
+    int pos;
+    int end = (int) strlen (row);
+    for (i = 0; i < end; i++)
+      {
+	  if (row[i] == ' ' || row[i] == '\t')
+	      skip++;
+	  else
+	      break;
+      }
+    if (strncmp (row + skip, "SPATIALITE_DECLARE ", 19) == 0)
+	skip += 19;
+    else if (strncmp (row + skip, "GAIAAUX_DECLARE ", 16) == 0)
+	skip += 16;
+    else if (strncmp (row + skip, "GAIAEXIF_DECLARE ", 17) == 0)
+	skip += 17;
+    else if (strncmp (row + skip, "GAIAGEO_DECLARE ", 16) == 0)
+	skip += 16;
+    else
+	return;
+
+    if (strncmp (row + skip, "const char *", 12) == 0)
+	pos = skip + 12;
+    else if (strncmp (row + skip, "unsigned char ", 14) == 0)
+	pos = skip + 14;
+    else if (strncmp (row + skip, "unsigned short ", 15) == 0)
+	pos = skip + 15;
+    else if (strncmp (row + skip, "unsigned int ", 13) == 0)
+	pos = skip + 13;
+    else if (strncmp (row + skip, "char *", 6) == 0)
+	pos = skip + 6;
+    else if (strncmp (row + skip, "void *", 6) == 0)
+	pos = skip + 6;
+    else if (strncmp (row + skip, "void ", 5) == 0)
+	pos = skip + 5;
+    else if (strncmp (row + skip, "int ", 4) == 0)
+	pos = skip + 4;
+    else if (strncmp (row + skip, "double ", 7) == 0)
+	pos = skip + 7;
+    else if (strncmp (row + skip, "float ", 6) == 0)
+	pos = skip + 6;
+    else if (strncmp (row + skip, "short ", 6) == 0)
+	pos = skip + 6;
+    else if (strncmp (row + skip, "sqlite3_int64 ", 14) == 0)
+	pos = skip + 14;
+    else if (strncmp (row + skip, "gaiaPointPtr ", 13) == 0)
+	pos = skip + 13;
+    else if (strncmp (row + skip, "gaiaLinestringPtr ", 18) == 0)
+	pos = skip + 18;
+    else if (strncmp (row + skip, "gaiaPolygonPtr ", 15) == 0)
+	pos = skip + 15;
+    else if (strncmp (row + skip, "gaiaRingPtr ", 12) == 0)
+	pos = skip + 12;
+    else if (strncmp (row + skip, "gaiaGeomCollPtr ", 16) == 0)
+	pos = skip + 16;
+    else if (strncmp (row + skip, "gaiaDynamicLinePtr ", 19) == 0)
+	pos = skip + 19;
+    else if (strncmp (row + skip, "gaiaDbfFieldPtr ", 16) == 0)
+	pos = skip + 16;
+    else if (strncmp (row + skip, "gaiaValuePtr ", 13) == 0)
+	pos = skip + 13;
+    else if (strncmp (row + skip, "gaiaExifTagListPtr ", 19) == 0)
+	pos = skip + 19;
+    else if (strncmp (row + skip, "gaiaExifTagPtr ", 15) == 0)
+	pos = skip + 15;
+    else
+	return;
+
+    for (i = pos; i < end; i++)
+      {
+	  if (row[i] == ' ' || row[i] == '(' || row[i] == '[' || row[i] == ';')
+	    {
+		end = i;
+		break;
+	    }
+      }
+    len = end - pos;
+    memcpy (kw, row + pos, len);
+    kw[len] = '\0';
+    p = *first;
+    while (p)
+      {
+	  if (strcmp (p->keyword, kw) == 0)
+	      return;
+	  p = p->next;
+      }
+    p = malloc (sizeof (struct masked_keyword));
+    p->keyword = malloc (len + 1);
+    strcpy (p->keyword, kw);
+    p->next = NULL;
+    if (*first == NULL)
+	*first = p;
+    if (*last != NULL)
+	(*last)->next = p;
+    *last = p;
+}
+
+static void
+do_copy_export (FILE * out, const char *file, struct masked_keyword **first,
+		struct masked_keyword **last)
+{
+/* copy a source AS IS */
+    char input[1024];
+    char row[1024];
+    char *p = row;
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    while ((c = getc (in)) != EOF)
+      {
+	  if (c == '\n')
+	    {
+		*p = '\0';
+		feed_export_keywords (row, first, last);
+		fprintf (out, "%s\n", row);
+		p = row;
+		continue;
+	    }
+	  else
+	      *p++ = c;
+      }
+    fclose (in);
+}
+
+static void
+do_copy_header (FILE * out, const char *file, struct masked_keyword *first)
+{
+/* copy a source AS IS */
+    struct masked_keyword *p;
+    char input[1024];
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    fprintf (out, "/*\n** alias MACROs to avoid any potential collision\n");
+    fprintf (out, "** for linker symbols declared into the sqlite3 code\n");
+    fprintf (out, "** internally embedded into SpatiaLite\n*/\n");
+    p = first;
+    while (p)
+      {
+	  char alias[1024];
+	  strcpy (alias, p->keyword);
+	  alias[0] = 'S';
+	  alias[1] = 'P';
+	  alias[2] = 'L';
+	  fprintf (out, "#define %s %s\n", p->keyword, alias);
+	  p = p->next;
+      }
+    fprintf (out, "/* end SpatiaLite/sqlite3 alias macros */\n\n");
+    while ((c = getc (in)) != EOF)
+	putc (c, out);
+    fclose (in);
+}
+
+static void
+feed_masked_keywords (char *row, int pos, struct masked_keyword **first,
+		      struct masked_keyword **last)
+{
+    struct masked_keyword *p;
+    char kw[1024];
+    int len;
+    int i;
+    int end = (int) strlen (row);
+    for (i = pos; i < end; i++)
+      {
+	  if (row[i] == ' ' || row[i] == '(' || row[i] == '[' || row[i] == ';')
+	    {
+		end = i;
+		break;
+	    }
+      }
+    len = end - pos;
+    memcpy (kw, row + pos, len);
+    kw[len] = '\0';
+
+/*
+** caveat: this symbol is abdolutely required by loadable extension modules 
+** and must *never* be masked
+*/
+    if (strcmp (kw, "sqlite3_extension_init") == 0)
+	return;
+
+    p = *first;
+    while (p)
+      {
+	  if (strcmp (p->keyword, kw) == 0)
+	      return;
+	  p = p->next;
+      }
+    p = malloc (sizeof (struct masked_keyword));
+    p->keyword = malloc (len + 1);
+    strcpy (p->keyword, kw);
+    p->next = NULL;
+    if (*first == NULL)
+	*first = p;
+    if (*last != NULL)
+	(*last)->next = p;
+    *last = p;
+}
+
+static void
+prepare_masked (const char *file, struct masked_keyword **first,
+		struct masked_keyword **last)
+{
+/* feeding the ALIAS-macros */
+    char input[1024];
+    char row[1024];
+    char *p = row;
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    while ((c = getc (in)) != EOF)
+      {
+	  if (c == '\n')
+	    {
+		*p = '\0';
+		if (strncmp (row, "SQLITE_API int ", 15) == 0)
+		    feed_masked_keywords (row, 15, first, last);
+		else if (strncmp (row, "SQLITE_API double ", 18) == 0)
+		    feed_masked_keywords (row, 18, first, last);
+		else if (strncmp (row, "SQLITE_API void *", 17) == 0)
+		    feed_masked_keywords (row, 17, first, last);
+		else if (strncmp (row, "SQLITE_API void ", 16) == 0)
+		    feed_masked_keywords (row, 16, first, last);
+		else if (strncmp (row, "SQLITE_API char *", 17) == 0)
+		    feed_masked_keywords (row, 17, first, last);
+		else if (strncmp (row, "SQLITE_API const void *", 23) == 0)
+		    feed_masked_keywords (row, 23, first, last);
+		else if (strncmp (row, "SQLITE_API const char *", 23) == 0)
+		    feed_masked_keywords (row, 23, first, last);
+		else if (strncmp (row, "SQLITE_API const char ", 22) == 0)
+		    feed_masked_keywords (row, 22, first, last);
+		else if (strncmp (row, "SQLITE_API const unsigned char *", 32)
+			 == 0)
+		    feed_masked_keywords (row, 32, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_int64 ", 25) == 0)
+		    feed_masked_keywords (row, 25, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_value *", 26) == 0)
+		    feed_masked_keywords (row, 26, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_backup *", 27) == 0)
+		    feed_masked_keywords (row, 27, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_mutex *", 26) == 0)
+		    feed_masked_keywords (row, 26, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_stmt *", 25) == 0)
+		    feed_masked_keywords (row, 25, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3_vfs *", 24) == 0)
+		    feed_masked_keywords (row, 24, first, last);
+		else if (strncmp (row, "SQLITE_API sqlite3 *", 20) == 0)
+		    feed_masked_keywords (row, 20, first, last);
+		p = row;
+		continue;
+	    }
+	  else
+	      *p++ = c;
+      }
+    fclose (in);
+}
+
+static void
+do_copy_ext (FILE * out, const char *basedir, const char *file)
+{
+/* copy the sqlite3ext.h header */
+    char input[1024];
+    char row[1024];
+    char *p = row;
+    int c;
+    FILE *in;
+    strcpy (input, PREFIX);
+    strcat (input, basedir);
+    strcat (input, file);
+    in = fopen (input, "r");
+    if (!in)
+      {
+	  fprintf (stderr, "Error opening %s\n", input);
+	  return;
+      }
+    do_note (out, file, 0);
+    while ((c = getc (in)) != EOF)
+      {
+	  if (c == '\n')
+	    {
+		*p = '\0';
+		if (strlen (row) > 16)
+		  {
+		      if (strncmp (row, "#define sqlite3_", 16) == 0)
+			{
+			    row[8] = 'S';
+			    row[9] = 'P';
+			    row[10] = 'L';
+			}
+		  }
+		if (strcmp (row, "#include \"sqlite3.h\"") == 0)
+		    fprintf (out, "/* %s */\n", row);
+		else
+		    fprintf (out, "%s\n", row);
+		p = row;
+		continue;
+	    }
+	  else
+	      *p++ = c;
+      }
+    fclose (in);
+    do_note (out, file, 1);
+}
+
+static void
+do_makefile (FILE * out)
+{
+/* generating the Makefile.am for headers */
+    fprintf (out, "\nnobase_include_HEADERS = \\\n");
+    fprintf (out, "\tspatialite.h \\\n");
+    fprintf (out, "\tspatialite/gaiaexif.h \\\n");
+    fprintf (out, "\tspatialite/gaiaaux.h \\\n");
+    fprintf (out, "\tspatialite/gaiageo.h \\\n");
+    fprintf (out, "\tspatialite/gg_const.h \\\n");
+    fprintf (out, "\tspatialite/gg_structs.h \\\n");
+    fprintf (out, "\tspatialite/gg_core.h \\\n");
+    fprintf (out, "\tspatialite/gg_mbr.h \\\n");
+    fprintf (out, "\tspatialite/gg_formats.h \\\n");
+    fprintf (out, "\tspatialite/gg_dynamic.h \\\n");
+    fprintf (out, "\tspatialite/gg_advanced.h \\\n");
+    fprintf (out, "\tspatialite/sqlite3.h \\\n");
+    fprintf (out, "\tspatialite/sqlite3ext.h \\\n");
+    fprintf (out, "\tspatialite/spatialite.h \\\n");
+    fprintf (out, "\tspatialite/sqlite.h \\\n");
+    fprintf (out, "\tspatialite/debug.h\n");
+}
+
+static void
+free_masked_keywords (struct masked_keyword *first,
+		      struct masked_keyword *first_defn)
+{
+    struct masked_keyword *p = first;
+    struct masked_keyword *pn;
+    while (p)
+      {
+/* freeing masked keywords */
+	  pn = p->next;
+	  free (p->keyword);
+	  free (p);
+	  p = pn;
+      }
+    p = first_defn;
+    while (p)
+      {
+/* freeing export keyworks */
+	  pn = p->next;
+	  free (p->keyword);
+	  free (p);
+	  p = pn;
+      }
+}
+
+int
+main ()
+{
+    struct masked_keyword *first = NULL;
+    struct masked_keyword *last = NULL;
+    struct masked_keyword *first_def = NULL;
+    struct masked_keyword *last_def = NULL;
+    FILE *out;
+
+/* produces the AMALGAMATION */
+    mkdir ("amalgamation", 0777);
+    mkdir ("amalgamation/headers", 0777);
+    mkdir ("amalgamation/headers/spatialite", 0777);
+/* amalgamating SpatiaLite */
+    prepare_masked ("/sqlite3/sqlite3.c", &first, &last);
+    out = fopen ("amalgamation/spatialite.c", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/amalgamation.c\n");
+	  return 1;
+      }
+    do_headers (out, first);
+    do_copy_sqlite (out, "/headers/spatialite/", "sqlite3.h");
+    do_copy_ext (out, "/headers/spatialite/", "sqlite3ext.h");
+    do_copy (out, "/headers/", "spatialite.h");
+    do_copy (out, "/headers/spatialite/", "gaiaaux.h");
+    do_copy (out, "/headers/spatialite/", "gaiaexif.h");
+    do_copy (out, "/headers/spatialite/", "gaiageo.h");
+    do_copy (out, "/headers/spatialite/", "gg_const.h");
+    do_copy (out, "/headers/spatialite/", "gg_structs.h");
+    do_copy (out, "/headers/spatialite/", "gg_core.h");
+    do_copy (out, "/headers/spatialite/", "gg_mbr.h");
+    do_copy (out, "/headers/spatialite/", "gg_formats.h");
+    do_copy (out, "/headers/spatialite/", "gg_dynamic.h");
+    do_copy (out, "/headers/spatialite/", "gg_advanced.h");
+    do_copy (out, "/headers/spatialite/", "spatialite.h");
+    do_copy (out, "/headers/spatialite/", "sqlite.h");
+    do_copy (out, "/headers/spatialite/", "debug.h");
+    do_copy (out, "/gaiaaux/", "gg_sqlaux.c");
+    do_copy (out, "/gaiaaux/", "gg_utf8.c");
+    do_copy (out, "/gaiaexif/", "gaia_exif.c");
+    do_copy (out, "/gaiageo/", "gg_advanced.c");
+    do_copy (out, "/gaiageo/", "gg_endian.c");
+    do_copy (out, "/gaiageo/", "gg_geometries.c");
+    do_copy (out, "/gaiageo/", "gg_relations.c");
+    do_copy (out, "/gaiageo/", "gg_geoscvt.c");
+    do_copy (out, "/gaiageo/", "gg_shape.c");
+    do_copy (out, "/gaiageo/", "gg_transform.c");
+    do_copy (out, "/gaiageo/", "gg_wkb.c");
+    do_copy (out, "/gaiageo/", "gg_geodesic.c");
+    do_copy (out, "/spatialite/", "spatialite.c");
+    do_copy (out, "/spatialite/", "mbrcache.c");
+    do_copy (out, "/spatialite/", "virtualshape.c");
+    do_copy (out, "/spatialite/", "virtualdbf.c");
+    do_copy (out, "/spatialite/", "virtualXL.c");
+    do_copy (out, "/spatialite/", "virtualnetwork.c");
+    do_copy (out, "/spatialite/", "virtualspatialindex.c");
+    do_copy (out, "/spatialite/", "virtualfdo.c");
+    do_copy (out, "/virtualtext/", "virtualtext.c");
+    do_copy (out, "/versioninfo/", "version.c");
+    do_copy (out, "/gaiageo/", "gg_wkt.c");
+    do_copy (out, "/srsinit/", "srs_init.c");
+    do_copy (out, "/shapefiles/", "shapefiles.c");
+    do_copy (out, "/gaiageo/", "gg_vanuatu.c");
+    do_copy (out, "/gaiageo/", "gg_ewkt.c");
+    do_copy (out, "/gaiageo/", "gg_geoJSON.c");
+    do_copy (out, "/gaiageo/", "gg_kml.c");
+    do_copy (out, "/gaiageo/", "gg_gml.c");
+    fclose (out);
+
+/* setting up the HEADERS */
+    out = fopen ("amalgamation/headers/spatialite/sqlite3.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/sqlite3.h\n");
+	  return 1;
+      }
+    do_copy_header (out, "/headers/spatialite/sqlite3.h", first);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/sqlite3ext.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/sqlite3.h\n");
+	  return 1;
+      }
+    do_copy_header (out, "/headers/spatialite/sqlite3ext.h", first);
+    fclose (out);
+    out = fopen ("amalgamation/sqlite3.c", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/sqlite3.c\n");
+	  return 1;
+      }
+    do_sqlite3_dll (out, first);
+    prepare_masked ("/sqlite3/sqlite3.c", &first, &last);
+    do_copy_plain (out, "/sqlite3/sqlite3.c");
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gaiaaux.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gaiaaux.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gaiaaux.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gaiageo.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gaiageo.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gaiageo.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_const.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_const.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_const.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_structs.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_structs.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_structs.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_core.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_core.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_core.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_mbr.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_mbr.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_mbr.h", &first_def, &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_formats.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_formats.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_formats.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_dynamic.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_dynamic.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_dynamic.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gg_advanced.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gg_advanced.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gg_advanced.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/gaiaexif.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/gaiaexif.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/gaiaexif.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/spatialite.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/spatialite.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/spatialite.h", &first_def,
+		    &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/sqlite.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/sqlite.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/sqlite.h", &first_def, &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite/debug.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/headers/spatialite/debug.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite/debug.h", &first_def, &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/spatialite.h", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/headers/spatialite.h\n");
+	  return 1;
+      }
+    do_copy_export (out, "/headers/spatialite.h", &first_def, &last_def);
+    fclose (out);
+    out = fopen ("amalgamation/headers/Makefile.am", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/headers/Makefile.am\n");
+	  return 1;
+      }
+    do_makefile (out);
+    fclose (out);
+
+/* setting up the AUTOMAKE stuff */
+    out = fopen ("amalgamation/AUTHORS", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/AUTHORS\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/AUTHORS");
+    fclose (out);
+    out = fopen ("amalgamation/COPYING", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/COPYING\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/COPYING");
+    fclose (out);
+    out = fopen ("amalgamation/INSTALL", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/INSTALL\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/INSTALL");
+    fclose (out);
+    out = fopen ("amalgamation/README", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/README\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/README");
+    fclose (out);
+    out = fopen ("amalgamation/configure.ac", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/configure.ac\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/configure.ac");
+    fclose (out);
+    out = fopen ("amalgamation/Makefile.am", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/Makefile.am\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/Makefile.am");
+    fclose (out);
+    out = fopen ("amalgamation/makefile.vc", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/makefile.vc\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/makefile.vc");
+    fclose (out);
+    out = fopen ("amalgamation/nmake.opt", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/nmake.opt\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/nmake.opt");
+    out = fopen ("amalgamation/spatialite.pc.in", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/spatialite.pc.in\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/automake/spatialite.pc.in");
+    fclose (out);
+    out = fopen ("amalgamation/auto-sh", "wb");
+    if (!out)
+      {
+	  fprintf (stderr, "Error opening amalgamation/auto-sh\n");
+	  return 1;
+      }
+    do_auto_sh (out);
+    fclose (out);
+    out = fopen ("amalgamation/spatialite-sql-latest.html", "wb");
+    if (!out)
+      {
+	  fprintf (stderr,
+		   "Error opening amalgamation/spatialite-sql-latest.html\n");
+	  return 1;
+      }
+    do_copy_plain (out, "/../spatialite-sql-latest.html");
+    fclose (out);
+    free_masked_keywords (first, first_def);
+    return 0;
+}
diff --git a/compile b/compile
deleted file mode 100755
index a85b723..0000000
--- a/compile
+++ /dev/null
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey at cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake at gnu.org> or send patches to
-# <automake-patches at gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" ""	$nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
-  file=$1
-  case $file in
-    / | /[!/]*) # absolute file, and not a UNC file
-      if test -z "$file_conv"; then
-	# lazily determine how to convert abs files
-	case `uname -s` in
-	  MINGW*)
-	    file_conv=mingw
-	    ;;
-	  CYGWIN*)
-	    file_conv=cygwin
-	    ;;
-	  *)
-	    file_conv=wine
-	    ;;
-	esac
-      fi
-      case $file_conv/,$2, in
-	*,$file_conv,*)
-	  ;;
-	mingw/*)
-	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
-	  ;;
-	cygwin/*)
-	  file=`cygpath -m "$file" || echo "$file"`
-	  ;;
-	wine/*)
-	  file=`winepath -w "$file" || echo "$file"`
-	  ;;
-      esac
-      ;;
-  esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
-  func_file_conv "$1"
-  if test -z "$lib_path"; then
-    lib_path=$file
-  else
-    lib_path="$lib_path;$file"
-  fi
-  linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
-  lib=$1
-  found=no
-  save_IFS=$IFS
-  IFS=';'
-  for dir in $lib_path $LIB
-  do
-    IFS=$save_IFS
-    if $shared && test -f "$dir/$lib.dll.lib"; then
-      found=yes
-      lib=$dir/$lib.dll.lib
-      break
-    fi
-    if test -f "$dir/$lib.lib"; then
-      found=yes
-      lib=$dir/$lib.lib
-      break
-    fi
-    if test -f "$dir/lib$lib.a"; then
-      found=yes
-      lib=$dir/lib$lib.a
-      break
-    fi
-  done
-  IFS=$save_IFS
-
-  if test "$found" != yes; then
-    lib=$lib.lib
-  fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
-  # Assume a capable shell
-  lib_path=
-  shared=:
-  linker_opts=
-  for arg
-  do
-    if test -n "$eat"; then
-      eat=
-    else
-      case $1 in
-	-o)
-	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
-	  eat=1
-	  case $2 in
-	    *.o | *.[oO][bB][jJ])
-	      func_file_conv "$2"
-	      set x "$@" -Fo"$file"
-	      shift
-	      ;;
-	    *)
-	      func_file_conv "$2"
-	      set x "$@" -Fe"$file"
-	      shift
-	      ;;
-	  esac
-	  ;;
-	-I)
-	  eat=1
-	  func_file_conv "$2" mingw
-	  set x "$@" -I"$file"
-	  shift
-	  ;;
-	-I*)
-	  func_file_conv "${1#-I}" mingw
-	  set x "$@" -I"$file"
-	  shift
-	  ;;
-	-l)
-	  eat=1
-	  func_cl_dashl "$2"
-	  set x "$@" "$lib"
-	  shift
-	  ;;
-	-l*)
-	  func_cl_dashl "${1#-l}"
-	  set x "$@" "$lib"
-	  shift
-	  ;;
-	-L)
-	  eat=1
-	  func_cl_dashL "$2"
-	  ;;
-	-L*)
-	  func_cl_dashL "${1#-L}"
-	  ;;
-	-static)
-	  shared=false
-	  ;;
-	-Wl,*)
-	  arg=${1#-Wl,}
-	  save_ifs="$IFS"; IFS=','
-	  for flag in $arg; do
-	    IFS="$save_ifs"
-	    linker_opts="$linker_opts $flag"
-	  done
-	  IFS="$save_ifs"
-	  ;;
-	-Xlinker)
-	  eat=1
-	  linker_opts="$linker_opts $2"
-	  ;;
-	-*)
-	  set x "$@" "$1"
-	  shift
-	  ;;
-	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
-	  func_file_conv "$1"
-	  set x "$@" -Tp"$file"
-	  shift
-	  ;;
-	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
-	  func_file_conv "$1" mingw
-	  set x "$@" "$file"
-	  shift
-	  ;;
-	*)
-	  set x "$@" "$1"
-	  shift
-	  ;;
-      esac
-    fi
-    shift
-  done
-  if test -n "$linker_opts"; then
-    linker_opts="-link$linker_opts"
-  fi
-  exec "$@" $linker_opts
-  exit 1
-}
-
-eat=
-
-case $1 in
-  '')
-     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "compile $scriptversion"
-    exit $?
-    ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
-    func_cl_wrapper "$@"      # Doesn't return...
-    ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
-  if test -n "$eat"; then
-    eat=
-  else
-    case $1 in
-      -o)
-	# configure might choose to run compile as 'compile cc -o foo foo.c'.
-	# So we strip '-o arg' only if arg is an object.
-	eat=1
-	case $2 in
-	  *.o | *.obj)
-	    ofile=$2
-	    ;;
-	  *)
-	    set x "$@" -o "$2"
-	    shift
-	    ;;
-	esac
-	;;
-      *.c)
-	cfile=$1
-	set x "$@" "$1"
-	shift
-	;;
-      *)
-	set x "$@" "$1"
-	shift
-	;;
-    esac
-  fi
-  shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
-  # If no '-o' option was seen then we might have been invoked from a
-  # pattern rule where we don't need one.  That is ok -- this is a
-  # normal compilation that the losing compiler can handle.  If no
-  # '.c' file was seen then we are probably linking.  That is also
-  # ok.
-  exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file.  Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
-  if mkdir "$lockdir" >/dev/null 2>&1; then
-    break
-  fi
-  sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
-  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
-  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/compile b/compile
new file mode 120000
index 0000000..80e119e
--- /dev/null
+++ b/compile
@@ -0,0 +1 @@
+/usr/share/automake-1.15/compile
\ No newline at end of file
diff --git a/config-msvc.h b/config-msvc.h
index 9c7f477..d9fb05b 100644
--- a/config-msvc.h
+++ b/config-msvc.h
@@ -190,7 +190,7 @@
 #define PACKAGE_NAME "libspatialite"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libspatialite 4.3.0-RC1"
+#define PACKAGE_STRING "libspatialite 4.4.0-RC1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libspatialite"
@@ -199,7 +199,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "4.3.0"
+#define PACKAGE_VERSION "4.4.0-RC1"
 
 /* Should be defined when linking liblwgeom from PostGIS 2.1 (or later). */
 /* #undefine POSTGIS_2_1 */
@@ -217,7 +217,7 @@
 /* #undef TM_IN_SYS_TIME */
 
 /* Version number of package */
-#define VERSION "4.3.0-RC1"
+#define VERSION "4.4.0-RC1"
 
 /* Must be =64 in order to enable huge-file support. */
 #define _FILE_OFFSET_BITS 64
diff --git a/config.h.in b/config.h.in
index e3ff281..bcbe892 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,8 +9,8 @@
 /* Should be defined in order to enable LIBXML2 support. */
 #undef ENABLE_LIBXML2
 
-/* Should be defined in order to enable LWGEOM support. */
-#undef ENABLE_LWGEOM
+/* Should be defined in order to enable RTTOPO support. */
+#undef ENABLE_RTTOPO
 
 /* Should be defined in order to enable GEOS_ADVANCED support. */
 #undef GEOS_ADVANCED
@@ -21,6 +21,9 @@
 /* Should be defined in order to enable GEOS_REENTRANT (fully thread-safe). */
 #undef GEOS_REENTRANT
 
+/* depending on SQLite library version. */
+#undef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
@@ -54,8 +57,8 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the <liblwgeom.h> header file. */
-#undef HAVE_LIBLWGEOM_H
+/* Define to 1 if you have the <librttopo.h> header file. */
+#undef HAVE_LIBRTTOPO_H
 
 /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
 #undef HAVE_LIBSQLITE3
@@ -172,6 +175,9 @@
 /* Should be defined in order to disable ICONV support. */
 #undef OMIT_ICONV
 
+/* Should be defined in order to disable KNN support. */
+#undef OMIT_KNN
+
 /* Should be defined in order to disable MATHSQL support. */
 #undef OMIT_MATHSQL
 
@@ -199,12 +205,6 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* Should be defined when linking liblwgeom from PostGIS 2.1 (or later). */
-#undef POSTGIS_2_1
-
-/* Should be defined when linking liblwgeom from PostGIS 2.2 (or later). */
-#undef POSTGIS_2_2
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
diff --git a/configure b/configure
index de617d7..3b603fb 100755
--- a/configure
+++ b/configure
@@ -793,6 +793,7 @@ with_sysroot
 enable_libtool_lock
 enable_mathsql
 enable_geocallbacks
+enable_knn
 enable_proj
 enable_iconv
 enable_freexl
@@ -803,7 +804,7 @@ enable_gcp
 enable_geosadvanced
 enable_geosreentrant
 with_geosonlyreentrant
-enable_lwgeom
+enable_rttopo
 enable_libxml2
 enable_geopackage
 enable_gcov
@@ -1462,6 +1463,7 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-mathsql        enables SQL math functions [default=yes]
   --enable-geocallbacks   enables geometry callbacks [default=no]
+  --enable-knn            enables KNN support [default=yes]
   --enable-proj           enables PROJ.4 inclusion [default=yes]
   --enable-iconv          enables ICONV inclusion [default=yes]
   --enable-freexl         enables FreeXL inclusion [default=yes]
@@ -1471,7 +1473,7 @@ Optional Features:
   --enable-geosadvanced   enables GEOS advanced features [default=yes]
   --enable-geosreentrant  enables GEOS reentrant (fully thread safe)
                           [default=yes]
-  --enable-lwgeom         enables LWGEOM support [default=no]
+  --enable-rttopo         enables RTTOPO support [default=no]
   --enable-libxml2        enables libxml2 inclusion [default=yes]
   --enable-geopackage     enables GeoPackage support [default=yes]
   --enable-gcov           turn on code coverage analysis tools
@@ -2119,6 +2121,52 @@ $as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -17366,7 +17414,7 @@ else
 fi
 
 
-ac_config_files="$ac_config_files Makefile src/Makefile src/headers/Makefile src/gaiaaux/Makefile src/gaiaexif/Makefile src/gaiageo/Makefile src/gaiageo/flex/Makefile src/gaiageo/lemon/Makefile src/gaiageo/lemon/lemon_src/Makefile src/geopackage/Makefile src/spatialite/Makefile src/shapefiles/Makefile src/dxf/Makefile src/md5/Makefile src/control_points/Makefile src/cutter/Makefile src/topology/Makefile src/srsinit/Makefile src/srsinit/epsg_update/Makefile src/connection_cache/Makefile s [...]
+ac_config_files="$ac_config_files Makefile src/Makefile src/headers/Makefile src/gaiaaux/Makefile src/gaiaexif/Makefile src/gaiageo/Makefile src/gaiageo/flex/Makefile src/gaiageo/lemon/Makefile src/gaiageo/lemon/lemon_src/Makefile src/geopackage/Makefile src/spatialite/Makefile src/shapefiles/Makefile src/dxf/Makefile src/md5/Makefile src/control_points/Makefile src/cutter/Makefile src/topology/Makefile src/srsinit/Makefile src/srsinit/epsg_update/Makefile src/connection_cache/Makefile s [...]
 
 
 # exporting the TARGET_CPU string
@@ -17458,6 +17506,70 @@ fi
 #-----------------------------------------------------------------------
 
 #-----------------------------------------------------------------------
+#   --enable-knn
+#
+# Check whether --enable-knn was given.
+if test "${enable_knn+set}" = set; then :
+  enableval=$enable_knn;
+else
+  enable_knn=yes
+fi
+
+if test x"$enable_knn" == "xyes"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_rtree_query_callback in -lsqlite3" >&5
+$as_echo_n "checking for sqlite3_rtree_query_callback in -lsqlite3... " >&6; }
+if ${ac_cv_lib_sqlite3_sqlite3_rtree_query_callback+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsqlite3 -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqlite3_rtree_query_callback ();
+int
+main ()
+{
+return sqlite3_rtree_query_callback ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_sqlite3_sqlite3_rtree_query_callback=yes
+else
+  ac_cv_lib_sqlite3_sqlite3_rtree_query_callback=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_rtree_query_callback" >&5
+$as_echo "$ac_cv_lib_sqlite3_sqlite3_rtree_query_callback" >&6; }
+if test "x$ac_cv_lib_sqlite3_sqlite3_rtree_query_callback" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSQLITE3 1
+_ACEOF
+
+  LIBS="-lsqlite3 $LIBS"
+
+else
+  as_fn_error $? "obsolete 'libsqlite3' (< v.3.8.5). please retry specifying: --disable-knn" "$LINENO" 5
+fi
+
+else
+  $as_echo "#define OMIT_KNN 1" >>confdefs.h
+
+fi
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
 #   --enable-proj
 #
 # Check whether --enable-proj was given.
@@ -18317,53 +18429,33 @@ fi
   fi
 
   #-----------------------------------------------------------------------
-  #   --enable-lwgeom
+  #   --enable-rttopo
   #
-  # Check whether --enable-lwgeom was given.
-if test "${enable_lwgeom+set}" = set; then :
-  enableval=$enable_lwgeom;
+  # Check whether --enable-rttopo was given.
+if test "${enable_rttopo+set}" = set; then :
+  enableval=$enable_rttopo;
 else
-  enable_lwgeom=no
+  enable_rttopo=no
 fi
 
-  if test x"$enable_lwgeom" != "xno"; then
-	  for ac_header in liblwgeom.h
+  if test x"$enable_rttopo" != "xno"; then
+	  for ac_header in librttopo.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "liblwgeom.h" "ac_cv_header_liblwgeom_h" "$ac_includes_default"
-if test "x$ac_cv_header_liblwgeom_h" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "librttopo.h" "ac_cv_header_librttopo_h" "$ac_includes_default"
+if test "x$ac_cv_header_librttopo_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLWGEOM_H 1
+#define HAVE_LIBRTTOPO_H 1
 _ACEOF
 
 else
-  as_fn_error $? "cannot find liblwgeom.h, bailing out" "$LINENO" 5
+  as_fn_error $? "cannot find librttopo.h, bailing out" "$LINENO" 5
 fi
 
 done
 
-	  _save_libs="$LIBS"
-	  LIBS=$LIBS' -llwgeom -lgeos_c'
-	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int main() { return lwgeom_make_valid(); return 0; }
-	    void lwgeom_init_allocators(void) { return; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  $as_echo "#define ENABLE_LWGEOM 1" >>confdefs.h
-
-else
-  as_fn_error $? "'liblwgeom' doesn't seem to be installed on this system; unsupported lwgeom_make_valid()." "$LINENO" 5
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-	  LIBS="$_save_libs"
-	  LIBS=$LIBS' -llwgeom -lgeos_c'
-	#
-	# testing for PostGIS 2.1 - lwgeom_set_handlers
-	#
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lwgeom_set_handlers" >&5
-$as_echo_n "checking for library containing lwgeom_set_handlers... " >&6; }
-if ${ac_cv_search_lwgeom_set_handlers+:} false; then :
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rtgeom_make_valid" >&5
+$as_echo_n "checking for library containing rtgeom_make_valid... " >&6; }
+if ${ac_cv_search_rtgeom_make_valid+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -18376,16 +18468,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char lwgeom_set_handlers ();
+char rtgeom_make_valid ();
 int
 main ()
 {
-return lwgeom_set_handlers ();
+return rtgeom_make_valid ();
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' geos_c; do
+for ac_lib in '' rttopo; do
   if test -z "$ac_lib"; then
     ac_res="none required"
   else
@@ -18393,90 +18485,33 @@ for ac_lib in '' geos_c; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_lwgeom_set_handlers=$ac_res
+  ac_cv_search_rtgeom_make_valid=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if ${ac_cv_search_lwgeom_set_handlers+:} false; then :
+  if ${ac_cv_search_rtgeom_make_valid+:} false; then :
   break
 fi
 done
-if ${ac_cv_search_lwgeom_set_handlers+:} false; then :
+if ${ac_cv_search_rtgeom_make_valid+:} false; then :
 
 else
-  ac_cv_search_lwgeom_set_handlers=no
+  ac_cv_search_rtgeom_make_valid=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lwgeom_set_handlers" >&5
-$as_echo "$ac_cv_search_lwgeom_set_handlers" >&6; }
-ac_res=$ac_cv_search_lwgeom_set_handlers
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_rtgeom_make_valid" >&5
+$as_echo "$ac_cv_search_rtgeom_make_valid" >&6; }
+ac_res=$ac_cv_search_rtgeom_make_valid
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define POSTGIS_2_1 1" >>confdefs.h
-
-fi
-
-	#
-	# testing for PostGIS 2.2 - lwt_AddIsoNode
-	#
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lwt_AddIsoNode" >&5
-$as_echo_n "checking for library containing lwt_AddIsoNode... " >&6; }
-if ${ac_cv_search_lwt_AddIsoNode+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char lwt_AddIsoNode ();
-int
-main ()
-{
-return lwt_AddIsoNode ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' geos_c; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_lwt_AddIsoNode=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_lwt_AddIsoNode+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_lwt_AddIsoNode+:} false; then :
 
 else
-  ac_cv_search_lwt_AddIsoNode=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+  as_fn_error $? "'librttopo' is required but it doesn't seem to be installed on this system. You may need to try re-running configure with a --disable-rttopo parameter." "$LINENO" 5
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lwt_AddIsoNode" >&5
-$as_echo "$ac_cv_search_lwt_AddIsoNode" >&6; }
-ac_res=$ac_cv_search_lwt_AddIsoNode
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define POSTGIS_2_2 1" >>confdefs.h
 
-fi
+	  $as_echo "#define ENABLE_RTTOPO 1" >>confdefs.h
 
   fi
 else
@@ -18799,6 +18834,15 @@ else
 fi
 
 
+# testing for sqlite 3-10 or later
+ac_fn_c_check_decl "$LINENO" "SQLITE_INDEX_CONSTRAINT_LIKE" "ac_cv_have_decl_SQLITE_INDEX_CONSTRAINT_LIKE" "#include <sqlite3.h>
+"
+if test "x$ac_cv_have_decl_SQLITE_INDEX_CONSTRAINT_LIKE" = xyes; then :
+  $as_echo "#define HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE 1" >>confdefs.h
+
+fi
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -19969,11 +20013,11 @@ do
     "test/sql_stmt_geos_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_geos_tests/Makefile" ;;
     "test/sql_stmt_geosadvanced_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_geosadvanced_tests/Makefile" ;;
     "test/sql_stmt_geopackage_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_geopackage_tests/Makefile" ;;
+    "test/sql_stmt_gpkg_epsg_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_gpkg_epsg_tests/Makefile" ;;
     "test/sql_stmt_proj_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_proj_tests/Makefile" ;;
     "test/sql_stmt_mathsql_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_mathsql_tests/Makefile" ;;
-    "test/sql_stmt_lwgeom_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_lwgeom_tests/Makefile" ;;
-    "test/sql_stmt_lwgeom_20_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_lwgeom_20_tests/Makefile" ;;
-    "test/sql_stmt_lwgeom_22_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_lwgeom_22_tests/Makefile" ;;
+    "test/sql_stmt_rtgeom_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_rtgeom_tests/Makefile" ;;
+    "test/sql_stmt_rttopo_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_rttopo_tests/Makefile" ;;
     "test/sql_stmt_libxml2_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_libxml2_tests/Makefile" ;;
     "test/sql_stmt_security_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_security_tests/Makefile" ;;
     "test/sql_stmt_xmlsec_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_xmlsec_tests/Makefile" ;;
@@ -21521,7 +21565,7 @@ fi
 # printing an eventual message reporting about GPL escalation
 #-----------------------------------------------------------------------
 gpl_escalation=no;
-if test x"$enable_lwgeom" != "xno"; then
+if test x"$enable_rttopo" != "xno"; then
     gpl_escalation=yes
 fi
 if test x"$enable_gcp" != "xno"; then
@@ -21533,7 +21577,7 @@ if test x"$gpl_escalation" != xno; then
     echo "=============================================================="
     echo "                        IMPORTANT NOTICE"
     echo "=============================================================="
-    echo "You have selected --enable-lwgeom and/or --enable-gcp"
+    echo "You have selected --enable-rttopo and/or --enable-gcp"
     echo
     echo "Both modules strictly depend on code released under the GPLv2+"
     echo "license, wich takes precedence over any other license."
@@ -21542,7 +21586,7 @@ if test x"$gpl_escalation" != xno; then
     echo
     echo "If you wish better preserving the initial MPL tri-license you"
     echo "simply have to reconfigure by specifying the following options:"
-    echo "        --disable-lwgeom --disable-gcp"
+    echo "        --disable-rttopo --disable-gcp"
     echo "=============================================================="
 
 fi
diff --git a/configure.ac b/configure.ac
index 2b92677..8a0a7b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,8 +35,8 @@ AH_TEMPLATE([GEOS_REENTRANT],
             [Should be defined in order to enable GEOS_REENTRANT (fully thread-safe).])
 AH_TEMPLATE([GEOS_ONLY_REENTRANT],
             [Should be defined in order to fully disable GEOS non-thread-safe API.])
-AH_TEMPLATE([ENABLE_LWGEOM],
-            [Should be defined in order to enable LWGEOM support.])
+AH_TEMPLATE([ENABLE_RTTOPO],
+            [Should be defined in order to enable RTTOPO support.])
 AH_TEMPLATE([ENABLE_GCP],
             [Should be defined in order to enable GCP support.])
 AH_TEMPLATE([OMIT_PROJ],
@@ -49,18 +49,18 @@ AH_TEMPLATE([OMIT_EPSG],
             [Should be defined in order to disable EPSG full support.])
 AH_TEMPLATE([OMIT_GEOCALLBACKS],
             [Should be defined in order to disable GEOCALLBACKS support.])
+AH_TEMPLATE([OMIT_KNN],
+            [Should be defined in order to disable KNN support.])
 AH_TEMPLATE([OMIT_FREEXL],
             [Should be defined in order to disable FREEXL support.])
 AH_TEMPLATE([ENABLE_LIBXML2],
             [Should be defined in order to enable LIBXML2 support.])
 AH_TEMPLATE([ENABLE_GEOPACKAGE],
             [Should be defined in order to enable GeoPackage support.])
-AH_TEMPLATE([POSTGIS_2_1],
-            [Should be defined when linking liblwgeom from PostGIS 2.1 (or later).])
-AH_TEMPLATE([POSTGIS_2_2],
-            [Should be defined when linking liblwgeom from PostGIS 2.2 (or later).])
 AH_TEMPLATE([TARGET_CPU],
             [Should contain a text-string describing the intended target CPU])
+AH_TEMPLATE([HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE],
+            [depending on SQLite library version.])
 
 # Checks for header files.
 AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
@@ -138,11 +138,11 @@ AC_CONFIG_FILES([Makefile \
 		test/sql_stmt_geos_tests/Makefile \
 		test/sql_stmt_geosadvanced_tests/Makefile \
 		test/sql_stmt_geopackage_tests/Makefile \
+		test/sql_stmt_gpkg_epsg_tests/Makefile \
 		test/sql_stmt_proj_tests/Makefile \
 		test/sql_stmt_mathsql_tests/Makefile \
-		test/sql_stmt_lwgeom_tests/Makefile \
-		test/sql_stmt_lwgeom_20_tests/Makefile \
-		test/sql_stmt_lwgeom_22_tests/Makefile \
+		test/sql_stmt_rtgeom_tests/Makefile \
+		test/sql_stmt_rttopo_tests/Makefile \
 		test/sql_stmt_libxml2_tests/Makefile \
 		test/sql_stmt_security_tests/Makefile \
 		test/sql_stmt_xmlsec_tests/Makefile \
@@ -185,6 +185,19 @@ fi
 #-----------------------------------------------------------------------
 
 #-----------------------------------------------------------------------
+#   --enable-knn
+#
+AC_ARG_ENABLE(knn, [AS_HELP_STRING(
+  [--enable-knn], [enables KNN support [default=yes]])],
+  [], [enable_knn=yes])
+if test x"$enable_knn" == "xyes"; then
+  AC_CHECK_LIB(sqlite3,sqlite3_rtree_query_callback,,AC_MSG_ERROR([obsolete 'libsqlite3' (< v.3.8.5). please retry specifying: --disable-knn]),-lm)
+else
+  AC_DEFINE(OMIT_KNN)
+fi
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
 #   --enable-proj
 #
 AC_ARG_ENABLE(proj, [AS_HELP_STRING(
@@ -334,29 +347,15 @@ if test x"$enable_geos" != "xno"; then
   fi
 
   #-----------------------------------------------------------------------
-  #   --enable-lwgeom
+  #   --enable-rttopo
   #
-  AC_ARG_ENABLE(lwgeom, [AS_HELP_STRING(
-	  [--enable-lwgeom], [enables LWGEOM support [default=no]])],
-	  [], [enable_lwgeom=no])
-  if test x"$enable_lwgeom" != "xno"; then
-	  AC_CHECK_HEADERS(liblwgeom.h,, [AC_MSG_ERROR([cannot find liblwgeom.h, bailing out])])
-	  _save_libs="$LIBS"
-	  LIBS=$LIBS' -llwgeom -lgeos_c'
-	  AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return lwgeom_make_valid(); return 0; }
-	    void lwgeom_init_allocators(void) { return; } ])],
-	    [AC_DEFINE(ENABLE_LWGEOM)],
-            [AC_MSG_ERROR(['liblwgeom' doesn't seem to be installed on this system; unsupported lwgeom_make_valid().])])
-	  LIBS="$_save_libs"
-	  LIBS=$LIBS' -llwgeom -lgeos_c'
-	#
-	# testing for PostGIS 2.1 - lwgeom_set_handlers
-	#
-	  AC_SEARCH_LIBS(lwgeom_set_handlers,geos_c,AC_DEFINE(POSTGIS_2_1))
-	#
-	# testing for PostGIS 2.2 - lwt_AddIsoNode
-	#
-	  AC_SEARCH_LIBS(lwt_AddIsoNode,geos_c,AC_DEFINE(POSTGIS_2_2))
+  AC_ARG_ENABLE(rttopo, [AS_HELP_STRING(
+	  [--enable-rttopo], [enables RTTOPO support [default=no]])],
+	  [], [enable_rttopo=no])
+  if test x"$enable_rttopo" != "xno"; then
+	  AC_CHECK_HEADERS(librttopo.h,, [AC_MSG_ERROR([cannot find librttopo.h, bailing out])])
+	  AC_SEARCH_LIBS(rtgeom_make_valid,rttopo,,AC_MSG_ERROR(['librttopo' is required but it doesn't seem to be installed on this system. You may need to try re-running configure with a --disable-rttopo parameter.]))
+	  AC_DEFINE(ENABLE_RTTOPO)
   fi
 else
   AC_DEFINE(OMIT_GEOS)
@@ -424,13 +423,17 @@ AM_CONDITIONAL([MACOSX], [test "$target_alias" = "macosx"])
 # Checking for Android
 AM_CONDITIONAL([ANDROID], [test "$target_alias" = "android"])
 
+# testing for sqlite 3-10 or later
+AC_CHECK_DECL([SQLITE_INDEX_CONSTRAINT_LIKE],
+  [AC_DEFINE(HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE)],[],[[#include <sqlite3.h>]])
+
 AC_OUTPUT
 
 #-----------------------------------------------------------------------
 # printing an eventual message reporting about GPL escalation
 #-----------------------------------------------------------------------
 gpl_escalation=no;
-if test x"$enable_lwgeom" != "xno"; then
+if test x"$enable_rttopo" != "xno"; then
     gpl_escalation=yes
 fi
 if test x"$enable_gcp" != "xno"; then
@@ -442,7 +445,7 @@ if test x"$gpl_escalation" != xno; then
     echo "=============================================================="
     echo "                        IMPORTANT NOTICE"
     echo "=============================================================="
-    echo "You have selected --enable-lwgeom and/or --enable-gcp"
+    echo "You have selected --enable-rttopo and/or --enable-gcp"
     echo
     echo "Both modules strictly depend on code released under the GPLv2+"
     echo "license, wich takes precedence over any other license."
@@ -451,7 +454,7 @@ if test x"$gpl_escalation" != xno; then
     echo
     echo "If you wish better preserving the initial MPL tri-license you"
     echo "simply have to reconfigure by specifying the following options:"
-    echo "        --disable-lwgeom --disable-gcp"
+    echo "        --disable-rttopo --disable-gcp"
     echo "=============================================================="
   
 fi
diff --git a/examples/HOW-TO-BUILD.txt b/examples/HOW-TO-BUILD.txt
new file mode 100644
index 0000000..16f2eee
--- /dev/null
+++ b/examples/HOW-TO-BUILD.txt
@@ -0,0 +1,137 @@
+Basically you can build the demo C programs simply 
+using the C compiler alone [there is no need to use 
+a Makefile], as in:
+
+gcc -Wall demo1.c -o demo1
+
+but unhappily you can't follow a so simplistic approach
+
+Step 1:
+-------
+you have to instruct the C compiler about location 
+of any required header file and library to link; 
+you do this setting -Ipath_include and -Lpath_lib 
+directives [actual paths depends on your locale 
+file system layout]
+
+Step 2:
+-------
+you have to instruct the C compiler about location
+and type of external libraries you have to link.
+you can build an executable binary in two alternative
+ways:
+a) you can link STATIC libraries, thus obtaining a
+   monolithic executable, with no external dependencies
+   [this will produce a bigger sized executable, but
+    will strongly simplify following installation and
+    deployment steps]
+b) you can link DYNAMIC / SHARED libraries, thus
+   obtaining an executable requiring external dependencies
+   to be resolved at run time
+   [this will produce a smallest sized executable, but
+    you have then to face quite complex problems in the
+    installation and deployment steps]
+Both static and shared linkage modes have pros and cons;
+choosing the one or the other depends on your specific 
+needs.
+There are several way to set DYNAMIC or STATIC linkage,
+but the simplest one is:
+gcc -dynamic ...
+   or
+gcc -static ...
+The -dynamic option is the default one, so you simply can use:
+gcc ...
+in order to select DYNAMIC linkage.
+A different approach is to directly link the static libraries,
+directly referring their paths.
+
+>>>
+>>> following examples are assuming:
+>>> 1. that you have installed any required dependency for the 
+>>>    specific platform you are using to compile 
+>>> 2. you have placed all this stuff under /usr/local/include
+>>>    and /usr/local/lib
+>>>    if not, you have to accommodate paths in order to match
+>>>    your locale file system layout
+>>>
+
+Building on Linux systems:
+=================================================
+
+static linkage:
+---------------
+
+gcc -Wall -I/usr/local/include demo1.c -o demo1 \
+    /usr/local/lib/libspatialite.a \
+    /usr/local/lib/libsqlite3.a \
+    /usr/local/lib/libgeos_c.a \
+    /usr/local/lib/libgeos.a \
+    /usr/local/lib/libproj.a \
+    -lm -lstdc++ -lpthread -ldl
+
+dynamic linkage:
+----------------
+
+gcc -Wall -I/usr/local/include -L/usr/local/lib demo1.c \
+    -o demo1.exe -lspatialite
+
+ 
+Building on Windows systems:
+=================================================
+
+>>>
+>>> requires the MinGW compiler
+>>> and the MSys command shell
+>>>
+>>> on the standard MSys setup,
+>>>     /usr/local/ 
+>>> corresponds to
+>>>     C:\msys\1.0\local or C:\msys\local
+>>>
+
+static linkage:
+---------------
+
+gcc -static -Wall -I/usr/local/include -L/usr/local/lib \
+    demo1.c -o demo1.exe \
+    -lspatialite -liconv -lproj -lgeos_c -lgeos \
+    -lm -lstdc++
+
+dynamic linkage:
+----------------
+
+gcc -Wall -I/usr/local/include -L/usr/local/lib demo1.c \
+    -o demo1.exe -lspatialite
+
+
+
+Building on Mac OsX systems:
+=================================================
+
+static linkage:
+---------------
+
+gcc -Wall -I/usr/local/include demo1.c -o demo1 \
+    /usr/local/lib/libspatialite.a \
+    /usr/local/lib/libsqlite3.a \
+    /usr/local/lib/libgeos_c.a \
+    /usr/local/lib/libgeos.a \
+    /usr/local/lib/libproj.a \
+    -liconv -lm -lstdc++ -lpthread -ldl
+
+dynamic linkage:
+----------------
+
+gcc -Wall -I/usr/local/include -L/usr/local/lib demo1.c \
+    -o demo1 -lspatialite
+    
+=========================================================
+
+Some remarkable point to be noted:
+a) when using dynamic linkage you simply need to use 
+   the 'libspatialite' alone, because this latter will
+   automatically resolve any other required dependency
+b) but when using static linkage you need instead to 
+   resolve explicitly (by yourself) any required dependency.
+   And this explains why do you need to refer so many 
+   libraries (-lgeos_c, -lgeos, -lproj ....)
diff --git a/makefile.vc b/makefile.vc
index 9b9e8ee..7f91e33 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -56,7 +56,8 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
 	src\srsinit\epsg_inlined_46.obj src\srsinit\epsg_inlined_extra.obj \
 	src\srsinit\epsg_inlined_prussian.obj \
 	src\srsinit\epsg_inlined_wgs84_00.obj src\srsinit\epsg_inlined_wgs84_01.obj \
-	src\versioninfo\version.obj src\virtualtext\virtualtext.obj
+	src\versioninfo\version.obj src\virtualtext\virtualtext.obj \
+	src\cutter\gaia_cutter.obj src\spatialite\virtualknn.obj
 SPATIALITE_DLL = spatialite$(VERSION).dll
 
 CFLAGS = /nologo -I.\src\headers -I. -IC:\OSGeo4W\include $(OPTFLAGS)
diff --git a/makefile_mod.vc b/makefile_mod.vc
new file mode 100644
index 0000000..61510dd
--- /dev/null
+++ b/makefile_mod.vc
@@ -0,0 +1,116 @@
+# $Id: $
+#
+# NMAKE Makefile to build libspatialite on Windows
+#
+!INCLUDE nmake_mod.opt
+
+LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
+	src\gaiaexif\gaia_exif.obj src\gaiageo\gg_advanced.obj \
+	src\gaiageo\gg_endian.obj src\gaiageo\gg_ewkt.obj \
+	src\gaiageo\gg_geodesic.obj src\gaiageo\gg_geoJSON.obj \
+	src\gaiageo\gg_geometries.obj src\gaiageo\gg_geoscvt.obj \
+	src\gaiageo\gg_gml.obj src\gaiageo\gg_kml.obj \
+	src\gaiageo\gg_relations.obj src\gaiageo\gg_shape.obj \
+	src\gaiageo\gg_transform.obj src\gaiageo\gg_vanuatu.obj \
+	src\gaiageo\gg_wkb.obj src\gaiageo\gg_wkt.obj \
+	src\gaiageo\gg_extras.obj src\gaiageo\gg_xml.obj \
+	src\gaiageo\gg_voronoj.obj src\gaiageo\gg_matrix.obj \
+	src\gaiageo\gg_relations_ext.obj src/connection_cache/alloc_cache.obj \
+	src\spatialite\mbrcache.obj src\shapefiles\shapefiles.obj \
+	src\spatialite\spatialite.obj src\spatialite\virtualdbf.obj \
+	src\spatialite\virtualfdo.obj src\spatialite\virtualnetwork.obj \
+	src\spatialite\virtualshape.obj src\spatialite\virtualspatialindex.obj \
+	src\spatialite\statistics.obj src\spatialite\metatables.obj \
+	src\spatialite\virtualXL.obj src\spatialite\extra_tables.obj \
+	src\spatialite\virtualxpath.obj src\spatialite\virtualbbox.obj \
+	src\spatialite\spatialite_init.obj src\spatialite\se_helpers.obj \
+	src\spatialite\srid_aux.obj src\spatialite\table_cloner.obj \
+	src\spatialite\virtualelementary.obj \
+	src\wfs\wfs_in.obj src\srsinit\srs_init.obj \
+	src\dxf\dxf_parser.obj src\dxf\dxf_loader.obj src\dxf\dxf_writer.obj \
+	src\dxf\dxf_load_distinct.obj src\dxf\dxf_load_mixed.obj \
+	src\shapefiles\validator.obj src\md5\md5.obj src\md5\gaia_md5.obj \
+	src\srsinit\epsg_inlined_00.obj src\srsinit\epsg_inlined_01.obj \
+	src\srsinit\epsg_inlined_02.obj src\srsinit\epsg_inlined_03.obj \
+	src\srsinit\epsg_inlined_04.obj src\srsinit\epsg_inlined_05.obj \
+	src\srsinit\epsg_inlined_06.obj src\srsinit\epsg_inlined_07.obj \
+	src\srsinit\epsg_inlined_08.obj src\srsinit\epsg_inlined_09.obj \
+	src\srsinit\epsg_inlined_10.obj src\srsinit\epsg_inlined_11.obj \
+	src\srsinit\epsg_inlined_12.obj src\srsinit\epsg_inlined_13.obj \
+	src\srsinit\epsg_inlined_14.obj src\srsinit\epsg_inlined_15.obj \
+	src\srsinit\epsg_inlined_16.obj src\srsinit\epsg_inlined_17.obj \
+	src\srsinit\epsg_inlined_18.obj src\srsinit\epsg_inlined_19.obj \
+	src\srsinit\epsg_inlined_20.obj src\srsinit\epsg_inlined_21.obj \
+	src\srsinit\epsg_inlined_22.obj src\srsinit\epsg_inlined_23.obj \
+	src\srsinit\epsg_inlined_24.obj src\srsinit\epsg_inlined_25.obj \
+	src\srsinit\epsg_inlined_26.obj src\srsinit\epsg_inlined_27.obj \
+	src\srsinit\epsg_inlined_28.obj src\srsinit\epsg_inlined_29.obj \
+	src\srsinit\epsg_inlined_30.obj src\srsinit\epsg_inlined_31.obj \
+	src\srsinit\epsg_inlined_32.obj src\srsinit\epsg_inlined_33.obj \
+	src\srsinit\epsg_inlined_34.obj src\srsinit\epsg_inlined_35.obj \
+	src\srsinit\epsg_inlined_36.obj src\srsinit\epsg_inlined_37.obj \
+	src\srsinit\epsg_inlined_38.obj src\srsinit\epsg_inlined_39.obj \
+	src\srsinit\epsg_inlined_40.obj src\srsinit\epsg_inlined_41.obj \
+	src\srsinit\epsg_inlined_42.obj src\srsinit\epsg_inlined_43.obj \
+	src\srsinit\epsg_inlined_44.obj src\srsinit\epsg_inlined_45.obj \
+	src\srsinit\epsg_inlined_46.obj src\srsinit\epsg_inlined_extra.obj \
+	src\srsinit\epsg_inlined_prussian.obj \
+	src\srsinit\epsg_inlined_wgs84_00.obj src\srsinit\epsg_inlined_wgs84_01.obj \
+	src\versioninfo\version.obj src\virtualtext\virtualtext.obj \
+	src\cutter\gaia_cutter.obj  src\spatialite\virtualknn.obj 
+MOD_SPATIALITE_DLL = mod_spatialite$(VERSION).dll
+
+CFLAGS = /nologo -I.\src\headers -I. -IC:\OSGeo4W\include $(OPTFLAGS)
+
+default:	all
+
+all: mod_spatialite.lib mod_spatialite_i.lib
+#$(EXIF_LOADER_EXE)
+
+mod_spatialite.lib:	$(LIBOBJ)
+	if exist mod_spatialite.lib del mod_spatialite.lib
+	lib /out:mod_spatialite.lib $(LIBOBJ)
+
+$(MOD_SPATIALITE_DLL):	mod_spatialite_i.lib
+
+mod_spatialite_i.lib:     $(LIBOBJ)
+	link /debug /dll /out:$(MOD_SPATIALITE_DLL) \
+		/implib:mod_spatialite_i.lib $(LIBOBJ) \
+		C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \
+		C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \
+		C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \
+		C:\OSGeo4W\lib\libxml2.lib
+	if exist $(MOD_SPATIALITE_DLL).manifest mt -manifest \
+		$(MOD_SPATIALITE_DLL).manifest -outputresource:$(MOD_SPATIALITE_DLL);2
+		
+.c.obj:
+	$(CC) $(CFLAGS) /c $*.c /Fo$@
+	
+clean:
+	del *.dll
+	del *.exp
+	del *.manifest
+	del *.lib
+	del src\gaiaaux\*.obj
+	del src\gaiaexif\*.obj
+	del src\gaiageo\*.obj
+	del src\spatialite\*.obj
+	del src\srsinit\*.obj
+	del src\versioninfo\*.obj
+	del src\virtualtext\*.obj
+	del src\wfs\*.obj
+	del src\dxf\*.obj
+	del src\md5\*.obj
+	del *.pdb
+
+install: all
+	-mkdir $(INSTDIR)
+	-mkdir $(INSTDIR)\bin
+	-mkdir $(INSTDIR)\lib
+	-mkdir $(INSTDIR)\include
+	-mkdir $(INSTDIR)\include\spatialite
+	copy *.dll $(INSTDIR)\bin
+	copy *.lib $(INSTDIR)\lib
+	copy src\headers\spatialite.h $(INSTDIR)\include
+	copy src\headers\spatialite\*.h $(INSTDIR)\include\spatialite
+	
diff --git a/nmake.opt b/nmake.opt
index 0960ec1..c048aa7 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -2,7 +2,7 @@
 INSTDIR=C:\OSGeo4W
 
 # Uncomment the first for an optimized build, or the second for debug.
-OPTFLAGS=	/nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
+OPTFLAGS=	/nologo /Ox /fp:precise /W4 /MD /D_CRT_SECURE_NO_WARNINGS \
 		/DDLL_EXPORT /DYY_NO_UNISTD_H
 #OPTFLAGS=	/nologo /Zi /MD /Fdspatialite.pdb /DDLL_EXPORT
 
diff --git a/nmake_mod.opt b/nmake_mod.opt
new file mode 100644
index 0000000..7772853
--- /dev/null
+++ b/nmake_mod.opt
@@ -0,0 +1,12 @@
+# Directory tree where SpatiaLite will be installed.
+INSTDIR=C:\OSGeo4W
+
+# Uncomment the first for an optimized build, or the second for debug.
+OPTFLAGS=	/nologo /Ox /fp:precise /W4 /MD /D_CRT_SECURE_NO_WARNINGS \
+		/DDLL_EXPORT /DLOADABLE_EXTENSION /DYY_NO_UNISTD_H
+#OPTFLAGS=	/nologo /Zi /MD /Fdmod_spatialite.pdb /DDLL_EXPORT
+
+# Set the version number for the DLL.  Normally we leave this blank since
+# we want software that is dynamically loading the DLL to have no problem
+# with version numbers.
+VERSION=
diff --git a/spatialite-4.4.0.mk b/spatialite-4.4.0.mk
new file mode 100644
index 0000000..89d664d
--- /dev/null
+++ b/spatialite-4.4.0.mk
@@ -0,0 +1,210 @@
+include $(CLEAR_VARS)
+# ./configure  --enable-lwgeom=yes --enable-gcp --enable-examples=no --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
+# 20150626.libspatialite-4.4.0-dev
+# -------------------
+# As of 2015-10-03 [4.4.0-t20160229]
+# -------------------
+# changes:
+# - geos-3.5.0
+# - json-c-0.12
+# - json-c-0.12
+# -------------------
+# Excluded files:
+# gaiageo/
+# - directories 'flex' and 'lemon'
+# - Ewkt.c/.h geoJSON.c/.h
+# - Gml.c/.h Kml.c/.h
+# - lex.*.c
+# srsinit/
+# - directory 'epsg_update'
+# -------------------
+LOCAL_MODULE    := spatialite
+
+# SQLite flags copied from ASOP
+common_sqlite_flags := \
+ -DHAVE_USLEEP=1 \
+ -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \
+ -DSQLITE_THREADSAFE=1 \
+ -DNDEBUG=1 \
+ -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \
+ -DSQLITE_DEFAULT_AUTOVACUUM=1 \
+ -DSQLITE_TEMP_STORE=3 \
+ -DSQLITE_ENABLE_FTS3 \
+ -DSQLITE_ENABLE_FTS3_BACKWARDS \
+ -DSQLITE_ENABLE_RTREE=1 \
+ -DSQLITE_DEFAULT_FILE_FORMAT=4
+
+# spatialite flags
+# comment out TARGET_CPU in config.h - will be replaced with TARGET_ARCH_ABI
+spatialite_flags := \
+ -DOMIT_FREEXL \
+ -DTARGET_CPU=\"$(TARGET_ARCH_ABI)\" \
+ -Dfdatasync=fsync \
+ -DSQLITE_ENABLE_RTREE=1 \
+ -DENABLE_GCP=1 \
+ -DENABLE_GEOPACKAGE=1 \
+ -DENABLE_LIBXML2=1 \
+ -DENABLE_LWGEOM=1 \
+ -DSQLITE_OMIT_BUILTIN_TEST=1 
+
+LOCAL_CFLAGS    := \
+ $(common_sqlite_flags) \
+ $(spatialite_flags)
+
+# LOCAL_LDLIBS is always ignored for static libraries
+# LOCAL_LDLIBS    := -llog -lz
+# LOADABLE_EXTENSION must NOT be defined
+LOCAL_C_INCLUDES := \
+ $(SQLITE_PATH) \
+ $(SPATIALITE_PATH) \
+ $(SPATIALITE_PATH)/src/headers \
+ $(SPATIALITE_PATH)/src/topology \
+ $(ICONV_PATH)/include \
+ $(ICONV_PATH)/libcharset/include \
+ $(GEOS_PATH)/include \
+ $(GEOS_PATH)/capi \
+ $(LWGEOM_PATH) \
+ $(PROJ4_PATH)/src \
+ $(LZMA_PATH)/src/liblzma/api \
+ $(XML2_PATH)/include
+LOCAL_SRC_FILES := \
+ $(SPATIALITE_PATH)/src/connection_cache/generator/code_generator.c \
+ $(SPATIALITE_PATH)/src/connection_cache/alloc_cache.c \
+ $(SPATIALITE_PATH)/src/control_points/gaia_control_points.c \
+ $(SPATIALITE_PATH)/src/control_points/grass_crs3d.c \
+ $(SPATIALITE_PATH)/src/control_points/grass_georef.c \
+ $(SPATIALITE_PATH)/src/control_points/grass_georef_tps.c \
+ $(SPATIALITE_PATH)/src/cutter/gaia_cutter.c \
+ $(SPATIALITE_PATH)/src/dxf/dxf_load_distinct.c \
+ $(SPATIALITE_PATH)/src/dxf/dxf_loader.c \
+ $(SPATIALITE_PATH)/src/dxf/dxf_load_mixed.c \
+ $(SPATIALITE_PATH)/src/dxf/dxf_parser.c \
+ $(SPATIALITE_PATH)/src/dxf/dxf_writer.c \
+ $(SPATIALITE_PATH)/src/gaiaaux/gg_sqlaux.c \
+ $(SPATIALITE_PATH)/src/gaiaaux/gg_utf8.c \
+ $(SPATIALITE_PATH)/src/gaiaexif/gaia_exif.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_advanced.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_endian.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_ewkt.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_extras.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_geodesic.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_geoJSON.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_geometries.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_geoscvt.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_gml.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_kml.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_lwgeom.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_matrix.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_relations.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_relations_ext.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_shape.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_transform.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_vanuatu.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_voronoj.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_wkb.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_wkt.c \
+ $(SPATIALITE_PATH)/src/gaiageo/gg_xml.c \
+ $(SPATIALITE_PATH)/src/geopackage/gaia_cvt_gpkg.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgAddGeometryColumn.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkg_add_geometry_triggers.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkg_add_spatial_index.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkg_add_tile_triggers.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgBinary.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgCreateBaseTables.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgCreateTilesTable.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgCreateTilesZoomLevel.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgGetImageType.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkg_get_normal_row.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkg_get_normal_zoom.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgInsertEpsgSRID.c \
+ $(SPATIALITE_PATH)/src/geopackage/gpkgMakePoint.c \
+ $(SPATIALITE_PATH)/src/md5/gaia_md5.c \
+ $(SPATIALITE_PATH)/src/md5/md5.c \
+ $(SPATIALITE_PATH)/src/shapefiles/shapefiles.c \
+ $(SPATIALITE_PATH)/src/shapefiles/validator.c \
+ $(SPATIALITE_PATH)/src/spatialite/extra_tables.c \
+ $(SPATIALITE_PATH)/src/spatialite/mbrcache.c \
+ $(SPATIALITE_PATH)/src/spatialite/metatables.c \
+ $(SPATIALITE_PATH)/src/spatialite/se_helpers.c \
+ $(SPATIALITE_PATH)/src/spatialite/spatialite.c \
+ $(SPATIALITE_PATH)/src/spatialite/spatialite_init.c \
+ $(SPATIALITE_PATH)/src/spatialite/srid_aux.c \
+ $(SPATIALITE_PATH)/src/spatialite/statistics.c \
+ $(SPATIALITE_PATH)/src/spatialite/table_cloner.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualbbox.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualdbf.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualelementary.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualfdo.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualgpkg.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualknn.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualnetwork.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualshape.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualspatialindex.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualXL.c \
+ $(SPATIALITE_PATH)/src/spatialite/virtualxpath.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_00.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_01.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_02.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_03.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_04.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_05.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_06.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_07.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_08.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_09.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_10.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_11.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_12.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_13.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_14.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_15.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_16.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_17.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_18.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_19.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_20.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_21.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_22.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_23.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_24.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_25.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_26.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_27.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_28.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_29.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_30.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_31.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_32.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_33.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_34.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_35.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_36.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_37.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_38.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_39.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_40.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_41.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_42.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_43.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_44.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_45.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_46.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_extra.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_prussian.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_wgs84_00.c \
+ $(SPATIALITE_PATH)/src/srsinit/epsg_inlined_wgs84_01.c \
+ $(SPATIALITE_PATH)/src/srsinit/srs_init.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_auxnet.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_auxtopo.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_netstmts.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_network.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_topology.c \
+ $(SPATIALITE_PATH)/src/topology/gaia_topostmts.c \
+ $(SPATIALITE_PATH)/src/topology/lwn_network.c \
+ $(SPATIALITE_PATH)/src/topology/net_callbacks.c \
+ $(SPATIALITE_PATH)/src/topology/topo_callbacks.c \
+ $(SPATIALITE_PATH)/src/versioninfo/version.c \
+ $(SPATIALITE_PATH)/src/virtualtext/virtualtext.c \
+ $(SPATIALITE_PATH)/src/wfs/wfs_in.c
+LOCAL_STATIC_LIBRARIES := iconv proj geos libljson-c liblwgeom libxml2
+include $(BUILD_STATIC_LIBRARY)
diff --git a/spatialite-sql-latest.html b/spatialite-sql-latest.html
index ed9e472..190a7c5 100644
--- a/spatialite-sql-latest.html
+++ b/spatialite-sql-latest.html
@@ -16,7 +16,7 @@
 			<li><a href="#generic">Generic SQL utility functions</a></li>
 			<li><a href="#global">Global settings per connection</a></li>
 			<li><a href="#math">SQL math functions</a></li>
-			<li><a href="#error">SQL functions reporting GEOS / LWGEOM errors and warnings</a></li>
+			<li><a href="#error">SQL functions reporting GEOS / RTTOPO errors and warnings</a></li>
 			<li><a href="#length_cvt">SQL length/distance unit-conversion functions</a></li>
 			<li><a href="#dms_cvt">SQL conversion functions from DD/DMS notations (longitude/latitude)</a></li>
 			<li><a href="#blob">SQL utility functions for BLOB objects</a></li>
@@ -42,7 +42,7 @@
 			<li><a href="#p14">SQL functions that implement spatial operators</a></li>
 			<li><a href="#p14b">SQL functions that implement spatial operators [GEOS specific features]</a></li>
 			<li><a href="#p14c">SQL functions that implement spatial operators [GEOS advanced features]</a></li>
-			<li><a href="#p14d">SQL functions that implement spatial operators [LWGEOM features]</a></li>
+			<li><a href="#p14d">SQL functions that implement spatial operators [RTTOPO features]</a></li>
 			<li><a href="#p15">SQL functions for coordinate transformations</a></li>
 			<li><a href="#p15plus">SQL functions supporting Affine Transformations and Ground Control Points</a></li>
 			<li><a href="#p16">SQL functions for Spatial-MetaData and Spatial-Index handling</a></li>
@@ -83,10 +83,10 @@
 				<td>geos_version( void ) : <i>String</i></td>
 				<td colspan="3">returns the current <b>GEOS</b> version as a text string<br>
 					or NULL if GEOS is currently unsupported</td></tr>
-			<tr><td><b>lwgeom_version</b></td>
-				<td>lwgeom_version( void ) : <i>String</i></td>
-				<td colspan="3">returns the current <b>LWGEOM</b> version as a text string<br>
-					or NULL if LWGEOM is currently unsupported</td></tr>
+			<tr><td><b>rttopo_version</b></td>
+				<td>rttopo_version( void ) : <i>String</i></td>
+				<td colspan="3">returns the current <b>RTTOPO</b> version as a text string<br>
+					or NULL if RTTOPO is currently unsupported</td></tr>
 			<tr><td><b>libxml2_version</b></td>
 				<td>libxml2_version( void ) : <i>String</i></td>
 				<td colspan="3">returns the current <b>LibXML2</b> version as a text string<br>
@@ -118,9 +118,9 @@
 			<tr><td><b>HasGeosOnlyReentrant</b></td>
 				<td>HasGeosOnlyReentrant( void ) : <i>Boolean</i></td>
 				<td colspan="3">TRUE if the underlaying library was built enabling <b>GEOSONLYREENTRANT</b></td></tr>
-			<tr><td><b>HasLwGeom</b></td>
-				<td>HasLwGeom( void ) : <i>Boolean</i></td>
-				<td colspan="3">TRUE if the underlaying library was built enabling <b>LWGEOM</b></td></tr>
+			<tr><td><b>HasRtTopo</b></td>
+				<td>HasRtTopo( void ) : <i>Boolean</i></td>
+				<td colspan="3">TRUE if the underlaying library was built enabling <b>RTTOPO</b></td></tr>
 			<tr><td><b>HasLibXML2</b></td>
 				<td>HasLibXML2( void ) : <i>Boolean</i></td>
 				<td colspan="3">TRUE if the underlaying library was built enabling <b>LibXML2</b></td></tr>
@@ -336,7 +336,7 @@
 				<td colspan="3">returns the sample variance of the input values (<i>square of the sample standard deviation</i>)<br>
 				<b><u>aggregate function</u></b></td></tr>
 			<tr><td colspan="5" align="center" bgcolor="#f0e0c0">
-				<h3><a name="error">SQL functions reporting GEOS / LWGEOM errors and warnings</a></h3></td></tr>
+				<h3><a name="error">SQL functions reporting GEOS / RTTOPO errors and warnings</a></h3></td></tr>
 			<tr><th bgcolor="#d0d0d0">Function</th>
 				<th bgcolor="#d0d0d0">Syntax</th>
 				<th colspan="3" bgcolor="#d0d0d0">Summary</th></tr>
@@ -363,16 +363,16 @@
 				message returned by GEOS.<hr>
 				<b>NULL</b> will be returned if there is no pending GEOS message, or if the current GEOS message
 				doesn't contain a critical Point.</td></tr>
-			<tr><td><b>LWGEOM_GetLastWarningMsg</b></td>
-				<td>LWGEOM_GetLastWarningMsg( <i>void</i> ) : <i>String</i></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
-				<td colspan="2">Will return the most recent warning message returned by LWGEOM (if any).<hr>
-				<b>NULL</b> will be returned if there is no pending LWGEOM warning.</td></tr>
-			<tr><td><b>LWGEOM_GetLastErrorMsg</b></td>
-				<td>LWGEOM_GetLastErrorMsg( <i>void</i> ) : <i>String</i></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
-				<td colspan="2">Will return the most recent error message returned by LWGEOM (if any).<hr>
-				<b>NULL</b> will be returned if there is no pending LWGEOM error.</td></tr>
+			<tr><td><b>RTTOPO_GetLastWarningMsg</b></td>
+				<td>RTTOPO_GetLastWarningMsg( <i>void</i> ) : <i>String</i></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="2">Will return the most recent warning message returned by RTTOPO (if any).<hr>
+				<b>NULL</b> will be returned if there is no pending RTTOPO warning.</td></tr>
+			<tr><td><b>RTTOPO_GetLastErrorMsg</b></td>
+				<td>RTTOPO_GetLastErrorMsg( <i>void</i> ) : <i>String</i></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="2">Will return the most recent error message returned by RTTOPO (if any).<hr>
+				<b>NULL</b> will be returned if there is no pending RTTOPO error.</td></tr>
 			<tr><td colspan="5" align="center" bgcolor="#f0e0c0">
 				<h3><a name="length_cvt">SQL length/distance unit-conversion functions</a></h3></td></tr>
 			<tr><th bgcolor="#d0d0d0">Function</th>
@@ -1077,10 +1077,17 @@ a Geometry will be returned representing the MBR for the corresponding GARS area
 				<td align="center" bgcolor="#d0f0d0">base</td>
 				<td>construct a geometric object given its EWKT Representation</td></tr>	
 			<tr><td><b>AsFGF</b></td>
-				<td>AsFGF( geom <i>Geometry</i> ) : <i>Binary</i></td>
+				<td>AsFGF( geom <i>Geometry</i> , dims <i>Integer</i> ) : <i>Binary</i></td>
 				<td></td>
 				<td align="center" bgcolor="#d0f0d0">base</td>
-				<td>returns the FGF [<i>FDO Geometry Binary Format</i>] representation</td></tr>
+				<td>returns the FGF [<i>FDO Geometry Binary Format</i>] representation<hr>
+				<i>dims</i> can assume one of the following values:
+				<ul>
+					<li><b>0</b> XY dimension</li>
+					<li><b>1</b> XYZ dimension</li>
+					<li><b>2</b> XYM dimension</li>
+					<li><b>3</b> XYZM dimension</li>
+				</ul></td></tr></td></tr>
 			<tr><td><b>GeomFromFGF</b></td>
 				<td>GeomFromFGF( fgfGeometry <i>Binary</i> [ , SRID <i>Integer</i>] ) : <i>Geometry</i></td>
 				<td></td>
@@ -1162,26 +1169,32 @@ a Geometry will be returned representing the MBR for the corresponding GARS area
 					corresponding to a function invocation on NULL arguments.<hr>
 					TRUE if this geometric object is simple, as defined in the Geometry Model</td></tr>
 			<tr><td><b>IsValid</b></td>
-				<td>IsValid( geom <i>Geometry</i> ) : <i>Integer</i><hr>
-					ST_IsValid( geom <i>Geometry</i> ) : <i>Integer</i></td>
+				<td>IsValid( geom <i>Geometry</i> [ , esri_flag <i>Boolean</i> ] ) : <i>Integer</i><hr>
+					ST_IsValid( geom <i>Geometry</i> [ , esri_flag <i>Boolean</i> ] ) : <i>Integer</i></td>
 				<td></td>
 				<td align="center" bgcolor="#f0d0d0">GEOS</td>
 				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and –1 for UNKNOWN
-					corresponding to a function invocation on NULL arguments.<hr>
+					corresponding to a function invocation on NULL arguments.<br>
+					If the <b>ESRI_flag</b> argument is set to 1 (TRUE), then all ESRI-like internal holes
+					(violating the standard OGC model) will be considered valid.<hr>
 					TRUE if this geometric object does  not contains any topological error</td></tr>
 			<tr><td><b>IsValidReason</b></td>
-				<td>IsValidReason( geom <i>Geometry</i> ) : <i>String</i><hr>
-					ST_IsValidReason( geom <i>Geometry</i> ) : <i>String</i></td>
+				<td>IsValidReason( geom <i>Geometry</i> [ , esri_flag <i>Boolean</i> ] ) : <i>String</i><hr>
+					ST_IsValidReason( geom <i>Geometry</i> [ , esri_flag <i>Boolean</i> ] ) : <i>String</i></td>
 				<td></td>
 				<td align="center" bgcolor="#f0d0d0">GEOS</td>
-				<td>Will return a TEXT string stating if a Geometry is valid and if not valid, a reason why.<hr>
+				<td>Will return a TEXT string stating if a Geometry is valid and if not valid, a reason why.<br>
+					If the <b>ESRI_flag</b> argument is set to 1 (TRUE), then all ESRI-like internal holes
+					(violating the standard OGC model) will be considered valid.<hr>
 					NULL will be returned on invalid arguments.</td></tr>
 			<tr><td><b>IsValidDetail</b></td>
-				<td>IsValidDetail( geom <i>Geometry</i> ) : <i>Geometry</i><hr>
-					ST_IsValidDetail( geom <i>Geometry</i> ) : <i>Geometry</i></td>
+				<td>IsValidDetail( geom <i>Geometry</i>  [ , esri_flag <i>Boolean</i> ]) : <i>Geometry</i><hr>
+					ST_IsValidDetail( geom <i>Geometry</i>  [ , esri_flag <i>Boolean</i> ]) : <i>Geometry</i></td>
 				<td></td>
 				<td align="center" bgcolor="#f0d0d0">GEOS</td>
-				<td>Will return a Geometry detail (usually a <b>POINT</b>) causing invalidity.<hr>
+				<td>Will return a Geometry detail (usually a <b>POINT</b>) causing invalidity.<br>
+					If the <b>ESRI_flag</b> argument is set to 1 (TRUE), then all ESRI-like internal holes
+					(violating the standard OGC model) will be considered valid.<hr>
 					NULL will be returned on invalid arguments, or in the case of a valid Geometry.</td></tr>
 			<tr><td><b>Boundary</b></td>
 				<td>Boundary( geom <i>Geometry</i> ) : <i>Geometry</i><hr>
@@ -1583,7 +1596,7 @@ algorithm with given <i>tolerance</i> and respecting topology</td></tr>
 					ST_Area( s <i>Surface</i> , use_ellipsoid <i>Boolean</i> ) : <i>Double precision</i>
 				</td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the area of s (measured in meters).<br>
 If the <b>use_ellipsoid</b> argument is set to <b>TRUE</b> the precise (but slower) area will be computed on the Ellipsoid, otherwise will be computed on the Sphere (approximative, but faster).<hr>
 This function only supports Long/Lat coordinates, and will return NULL for any planar CRS</td></tr>
@@ -2183,7 +2196,7 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
                                         The optional argument <b>tolerance</b> is intended to normalize the input Geometry, suppressing repeated (or too close) Points.<br>
 					NULL is returned on failure.</td></tr>
 			<tr><td colspan="5" align="center" bgcolor="#f0f0c0">
-				<h3><a name="p14d">SQL functions that implement spatial operators<br>[LWGEOM features]</a></h3></td></tr>
+				<h3><a name="p14d">SQL functions that implement spatial operators<br>[RTTOPO features]</a></h3></td></tr>
 			<tr><th bgcolor="#d0d0d0">Function</th>
 				<th bgcolor="#d0d0d0">Syntax</th>
 				<th bgcolor="#d0d0d0">OGC<br>defined</th>
@@ -2193,7 +2206,7 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>MakeValid( geom <i>Geometry</i> ) : <i>Geometry</i><hr>
 					ST_MakeValid( geom <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a geometric object representing the <i>repaired</i> version of the input Geometry.<br>
                                         If the input Geometry was already valid, then it will be returned exactly as it was.<br>
 					NULL is returned on failure.</td></tr>
@@ -2201,14 +2214,14 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>MakeValidDiscarded( geom <i>Geometry</i> ) : <i>Geometry</i><hr>
 					ST_MakeValidDiscarded( geom <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a geometric object containing all elements that would be eventually <i>discarded</i> by ST_MakeValid() while validating the same input Geometry.<br>
 					NULL is returned on failure, or if no <i>discarded</i> item exists.</td></tr>
 			<tr><td><b>Segmentize</b></td>
 				<td>Segmentize( geom <i>Geometry</i>, dist <i>Double precision</i>  ) : <i>Geometry</i><hr>
 					ST_Segmentize( geom <i>Geometry</i> , dist <i>Double precision</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a new Geometry corresponding to the input Geometry; as much Linestring / Ring vertices 
                                         as required will be eventually interpolated so to ensure that no segment will be longer than <i>dist</i>.<br>
 					NULL is returned on failure.</td></tr>
@@ -2216,14 +2229,14 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>Split( geom <i>Geometry</i>, blade <i>Geometry</i>  ) : <i>Geometry</i><hr>
 					ST_Split( geom <i>Geometry</i> , blade <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a new Geometry collecting all items resulting by splitting the input Geometry by the <i>blade</i>.<br>
 					NULL is returned on failure.</td></tr>
 			<tr><td><b>SplitLeft</b></td>
 				<td>SplitLeft( geom <i>Geometry</i>, blade <i>Geometry</i>  ) : <i>Geometry</i><hr>
 					ST_SplitLeft( geom <i>Geometry</i> , blade <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a new Geometry collecting all items resulting by splitting the input Geometry by the <i>blade</i> and falling on the <i>left side</i>.<br>
                                         All items not affected by the split operation (i.e. not intersecting the <i>blade</i>) will be returned into the <i>left</i> collection.<br>
 					NULL is returned on failure.</td></tr>
@@ -2231,14 +2244,14 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>SplitRight( geom <i>Geometry</i>, blade <i>Geometry</i>  ) : <i>Geometry</i><hr>
 					ST_SplitRight( geom <i>Geometry</i> , blade <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a new Geometry collecting all items resulting by splitting the input Geometry by the <i>blade</i> and falling on the <i>right side</i>.<br>
 					NULL is returned on failure (or if the <i>right side</i> is empty).</td></tr>
 			<tr><td><b>Azimuth</b></td>
 				<td>Azimuth( pt1 <i>Geometry</i>, pt2 <i>Geometry</i>  ) : <i>Double precision</i><hr>
 					ST_Azimuth( pt1 <i>Geometry</i> , pt2 <i>Geometry</i> ) : <i>Double precision</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the angle (in radians) from the horizontal of the vector defined by <b>pt1</b> and <b>pt2</b>.<br>
                                         Both <b>pt1</b> and <b>pt2</b> are expected to be simple Points.<br>
 					Starting since <u>4.1.0</u> if both points supports <u>long/lat</u> coords the returned Azimuth will be precisely computed on the ellipsoid.<br>
@@ -2248,7 +2261,7 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>Project( start_point <i>Geometry</i>, distance <i>Double precision</i>, azimuth <i>Double precision</i>  ) : <i>Geometry</i><hr>
 					ST_Project( start_point <i>Geometry</i>, distance <i>Double precision</i>, azimuth <i>Double precision</i>  ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return a new Point projected from a start point using a bearing and distance.<br>
                                         <b>start_point</b> is expected to be simple <u>long/lat</u> Point.<br>
 					<b>distance</b> is expected to be measured in <u>meters</u>; <b>azimuth</b> (aka <u>bearing</u> or <u>heading</u>) has the same identical meaning as in <b>ST_Azimuth()</b>.<br>
@@ -2272,7 +2285,7 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				<td>GeoHash( geom <i>Geometry</i> [ , precision <i>Integer</i> ] ) : <i>String</i><hr>
 					ST_GeoHash( geom <i>Geometry</i> [ , precision <i>Integer</i> ] ) : <i>String</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">LRTTOPO</td>
 				<td>Return a GeoHash representation (geohash.org) of the geometry.<br>
                                     A GeoHash encodes a point into a text form that is sortable and searchable based on prefixing.<br>
                                     <ul>
@@ -2295,41 +2308,41 @@ This function only supports Long/Lat coordinates, and will return NULL for any p
 				ST_AsX3D( geom <i>Geometry</i> , precision <i>Integer</i> , options <i>Integer</i> , refid <i>String</i> ) : <i>String</i>
 </td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>Returns a geometry as an X3D XML formatted node element.</td></tr>
 			<tr><td><b>MaxDistance</b></td>
 				<td>MaxDistance( geom1 <i>Geometry</i> , geom2 <i>Geometry</i> ) : <i>Double precision</i><hr>
 					ST_MaxDistance( geom1 <i>Geometry</i> , geom2 <i>Geometry</i> ) : <i>Double precision</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the max distance between geom1 and geom2</td></tr>
 			<tr><td><b>3DDistance</b></td>
 				<td>ST_3DDistance( geom1 <i>Geometry</i> , geom2 <i>Geometry</i> ) : <i>Double precision</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the 3D-distance between geom1 and geom2 (Z coordinates will be considered)</td></tr>
 			<tr><td><b>3DMaxDistance</b></td>
 				<td>ST_3DMaxDistance( geom1 <i>Geometry</i> , geom2 <i>Geometry</i> ) : <i>Double precision</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the max 3D-distance between geom1 and geom2 (Z coordinates will be considered)</td></tr>
 			<tr><td><b>3dLength</b></td>
 				<td>ST_3dLength( geom <i>Geometry</i> ) : <i>Double precision</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>return the total 2D or 3D-length of <i>Linestring</i> or <i>MultiLinestring</i> geometry.<br>
 				Z coordinates if eventually present will be considered leading to a 3D measured length; otherwise a 2D length will be computed.</td></tr>
 			<tr><td><b>ST_Node</b></td>
 				<td>ST_Node( geom <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>Fully nodes a set of linestrings using the least possible number of nodes while preserving all of the input ones.<br>
                                 <b>NULL</b> will be returned if the input Geometry isn't a set of linestrings or if any other error occurs.</td></tr>
 			<tr><td><b>SelfIntersections</b></td>
 				<td>SelfIntersections( geom <i>Geometry</i> ) : <i>Geometry</i><hr>
                                 	ST_SelfIntersections( geom <i>Geometry</i> ) : <i>Geometry</i></td>
 				<td></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td>Returns a MultiPoint Geometry representing any self-intersection found within the input geometry
 					[expected to be of the Linestring or MultiLinestring type].<br>
                                 <b>NULL</b> will be returned for invalid arguments, or when no self-intersections were found.</td></tr>
@@ -4050,12 +4063,12 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>GetLastTopologyException</b></td>
 				<td>GetLastTopologyException( toponame <i>Text</i> ) : <i>Text</i></i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return the most recent exception raised by this Topo-Geo, or <b>NULL</b> if no exception is currently pending.</td></tr>
 			<tr><td><b>InitTopoGeo</b></td>
 				<td>ST_InitTopoGeo( toponame <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">This SQL function is explicitly required by <b>ISO 13249-3</b>, anyway it's simply implemented as an <i>alias-name</i> for <b>CreateTopology ( toponame )</b>.<hr>
 					Will return <i>1</i> on success) or <i>0</i> on failure: <i>-1</i> will be returned on invalid arguments.</td></tr>
 			<tr><td><b>CreateTopology</b></td>
@@ -4064,7 +4077,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				    CreateTopology( toponame <i>Text</i> , srid <i>Integer</i> , tolerance <i>Double precision</i> ) : <i>Integer</i><hr>
 				    CreateTopology( toponame <i>Text</i> , srid <i>Integer</i> , tolerance <i>Double precision</i> , has_z <i>Boolean</i>) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create all DBMS objects (tables, triggers, indices and alike) required in order to store a separate Topo-Geo.
 				<ul>
 					<li><i>toponame</i>: the individual unique name of this Topo-Geo: all subordinated tables will use it as a prefix.</li>
@@ -4075,112 +4088,112 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>DropTopology</b></td>
 				<td>DropTopology( toponame <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Completely removes a Topo-Geo (and all data it contains) from the DBMS: to be invoked very cautiously and only if you are absolutely sure of what you are doing.<hr>
 					Will return <i>1</i> on success) or <i>0</i> on failure: <i>-1</i> will be returned on invalid arguments.</td></tr>
 			<tr><td><b>AddIsoNode</b></td>
 				<td>ST_AddIsoNode( toponame <i>Text</i> , face-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new isolated Node; <i>face-id</i> is expected to exactly match the ID of the Face containing <i>point</i>; by passing a 
 					<b>NULL face-id</b> the function itself will take care to identify the appropriate Face.<hr>
 					Will return the <b>ID</b> of the inserted Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>MoveIsoNode</b></td>
 				<td>ST_MoveIsoNode( toponame <i>Text</i> , node-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will move an isolated Node from a point to another.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemIsoNode</b></td>
 				<td>ST_RemIsoNode( toponame <i>Text</i> , node-id <i>Integer</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove an isolated Node.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>AddIsoEdge</b></td>
 				<td>ST_AddIsoEdge( toponame <i>Text</i> , startnode-id <i>Integer</i> , endnode-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new isolated Edge connecting two isolated Nodes.<hr>
 					Will return the <b>ID</b> of the inserted Edge on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ChangeEdgeGeom</b></td>
 				<td>ST_ChangeEdgeGeom( toponame <i>Text</i> , edge-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will change the geometry of an Edge without affecting Topology relationships.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemIsoEdge</b></td>
 				<td>ST_RemIsoEdge( toponame <i>Text</i> , edge-id <i>Integer</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove an isolated Edge.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>NewEdgesSplit</b></td>
 				<td>ST_NewEdgesSplit( toponame <i>Text</i> , edge-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split an Edge by creating a new intermediate Node. The original Edge will be deleted and will be replaced by two new Edges.<hr>
 					Will return the <b>ID</b> of the inserted Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ModEdgeSplit</b></td>
 				<td>ST_ModEdgeSplit( toponame <i>Text</i> , edge-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split an Edge by creating a new intermediate Node. The original Edge will be modified and a new Edge will be inserted.<hr>
 					Will return the <b>ID</b> of the inserted Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>NewEdgeHeal</b></td>
 				<td>ST_NewEdgeHeal( toponame <i>Text</i> , edge1-id <i>Integer</i> , edge2-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will heal two Edges by deleting the Node connecting them. Both the original Edges will be deleted and will be replaced by
 					a new Edge preserving the same orientation of the first Edge provided.<hr>
 					Will return the <b>ID</b> of the removed Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ModEdgeHeal</b></td>
 				<td>ST_ModEdgeHeal( toponame <i>Text</i> , edge1-id <i>Integer</i> , edge2-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will heal two Edges by deleting the Node connecting them. The first Edge provided will be modified and the second deleted.<hr>
 					Will return the <b>ID</b> of the removed Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>AddEdgeNewFaces</b></td>
 				<td>ST_AddEdgeNewFaces( toponame <i>Text</i> , startnode-id <i>Integer</i> , endnode-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new Edge connecting two Nodes. If this new Edge splits a Face the original Face will be deleted and replaced by two new Faces.<hr>
 					Will return the <b>ID</b> of the inserted Edge on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>AddEdgeModFace</b></td>
 				<td>ST_AddEdgeModFace( toponame <i>Text</i> , startnode-id <i>Integer</i> , endnode-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new Edge connecting two Nodes. If this new Edge splits a Face the original Face will be modified and a new Face will be inserted.<hr>
 					Will return the <b>ID</b> of the inserted Edge on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemEdgeNewFace</b></td>
 				<td>ST_RemEdgeNewFace( toponame <i>Text</i> , edge-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove an Edge. If the removed Edge separated two Faces the original Faces will be deleted and replaced by a new Face.<hr>
 					Will return the <b>ID</b> of the inserted Face on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemEdgeModFace</b></td>
 				<td>ST_RemEdgeModFace( toponame <i>Text</i> , edge-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove an Edge. If the removed Edge separated two Faces one of then will be modified and the other deleted.<hr>
 					Will return the <b>ID</b> of the surviving Face on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>GetFaceGeometry</b></td>
 				<td>ST_GetFaceGeometry( toponame <i>Text</i> , face-id <i>Integer</i> ) : <i>Geometry</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return the exact Geometry of a Face.<hr>
 					Will return a <b>Polygon</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>GetFaceEdges</b></td>
 				<td>ST_GetFaceEdges( toponame <i>Text</i> , face-id <i>Integer</i> ) : <i>DB-table</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will update a DB-Table containing the ordered list of all Edges delimiting the given Face. 
 					The orientation will always be counterclockwise, and all Edges traversed in the opposite direction (i.e. from <u>end</u> to <u>start</u>) will be marked by a <b>negative sign</b>.<hr>
 					Will return <b>NULL</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ValidateTopoGeo</b></td>
 				<td>ST_ValidateTopoGeo( toponame <i>Text</i> ) : <i>DB-table</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a DB-Table containing a validation report for the given TopoGeo: if the output table is empty and no exception was raised
 					the Topology is assumed to be fully valid, otherwise a row will be inserted into the table for each detected Topology invalidity.<br>
 					If the destination table already exists it will be dropped and created yet again.<hr>
@@ -4188,44 +4201,44 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>CreateTopoGeo</b></td>
 				<td>ST_CreateTopoGeo( toponame <i>Text</i> , geometry <i>BLOB</i> )</td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will populate a full Topology by importing a collection of arbitrary Geometries.<br>
 					The destination Topology must already exists and must be empty; both SRID and dimensions of input Geometries must match SRID and dimensions declared by Topology.<hr>
 					Will return <b>NULL</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>GetNodeByPoint</b></td>
 				<td>GetNodeByPoint( toponame <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to find the ID of a Node located at Point.<hr>
 					Will return the ID of the Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>GetEdgeByPoint</b></td>
 				<td>GetEdgeByPoint( toponame <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to find the ID of an Edge intersecting the given Point.<hr>
 					Will return the ID of the Edge on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>GetFaceByPoint</b></td>
 				<td>GetFaceByPoint( toponame <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to find the ID of a Face intersecting the given Point.<hr>
 					Will return the ID of the Face on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_AddPoint</b></td>
 				<td>TopoGeo_AddPoint( toponame <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to add a <b>Point</b> (or even a <b>MultiPoint</b>) to an already existing Topology, possibly splitting existing Edges.<hr>
 					Will return a comma separated list of all IDs of corresponding Nodes on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_AddLineString</b></td>
 				<td>TopoGeo_AddLineString( toponame <i>Text</i> , linestring <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to add a <b>Linestring</b> (or even a <b>MultiLinestring</b>) to an already existing Topology, possibly splitting existing Edges/Faces.<hr>
 					Will return a comma separated list of all IDs of the corresponding Edges on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_SubdivideLines</b></td>
 				<td>TopoGeo_SubdivideLines( input <i>Geometry</i> , line_max_points <i>Integer</i> , line_max_length <i>Double precision</i> ) : <i>MultiLinestring</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to split a <b>Linestring</b> (or even a <b>MultiLinestring</b>, <b>Polygon</b> or <b>Multipolygon</b>) into a collection 
 					of shorter LineStrings fully respecting Topology consistency.
 					<ul>
@@ -4242,7 +4255,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				    TopoGeo_FromGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i>, tolerance <i>Double precision</i> ,
 				    line_max_points <i>Integer</i> , line_max_length <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to import all Geometries from an input GeoTable identified by <i>db-prefix</i>, <i>table-name</i> and <i>column-name</i> into an already existing Topology-Geometry.
 					<ul>
 						<li><i>db-prefix</i> can be <b>NULL</b>, and in this case the input GeoTable is expected to be located within the <b>"MAIN"</b> database.</li>
@@ -4255,29 +4268,87 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 						(default for both: <b>-1</b>).</li>
 					</ul><hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
+			<tr><td><b>TopoGeo_FromGeoTableExt</b></td>
+				<td>TopoGeo_FromGeoTableExt( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i>, tolerance <i>Double precision</i> ,
+				    dustbin-table <i>Text</i> , dustbin-view <i>Text</i> ) : <i>Integer</i><hr>
+				    TopoGeo_FromGeoTableExt( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i>, tolerance <i>Double precision</i> ,
+				    dustbin-table <i>Text</i> , dustbin-view <i>Text</i> , line_max_points <i>Integer</i> , line_max_length <i>Double precision</i> ) : <i>Integer</i></td>
+				<td align="center" bgcolor="#d0f0d0"></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will attempt to import all Geometries from an input GeoTable identified by <i>db-prefix</i>, <i>table-name</i> and <i>column-name</i> into an already existing Topology-Geometry.
+				    When some Topology expection is encounterd this function will never stop: the Primary Key corresponding to the failing feature will be saved into the <i>dustbin-table</i>,
+				    and the loading process will restart from the next feature until all input features will be consumed. 
+					<ul>
+						<li><i>db-prefix</i> can be <b>NULL</b>, and in this case the input GeoTable is expected to be located within the <b>"MAIN"</b> database.</li>
+						<li><i>column-name</i> too can be <b>NULL</b>, and in this case the name of the column containing Geometries will be automatically retrieved;
+						if <b>"db"."table"</b> does not contains any Geometry column, or if it contains two or more Geometries an exception will be raised.</li>
+						<li>the input GeoTable must be properly registered and must match both <b>SRID</b> and <b>dimensions</b> declared by the target Topology.</li>
+						<li>the input GeoTable is absolutely required to declare a <b>Primary Key</b>.</li>
+						<li>this function accepts input Geometries of any class: <b>Point</b>, <b>MultiPoint</b>, <b>Linestring</b>, <b>MultiLinestring</b>,
+						<b>Polygon</b>, <b>MultiPolygon</b>, <b>GeometryCollection</b> and <b>Geometry</b>.</li>
+						<li><i>dustbin-table</i> is the name of the table intended to store PK values corresponding to features failing to be imported; this table should not already exist
+						and will be automatically created by the function itself.</li>
+						<li><i>dustbin-view</i> is the name of the Spatial View supporting the above table; this view should not already exist
+						and will be automatically created by the function itself.<br>
+						<u>Note</u>: both the <i>dustbin-table</i> and the <i>dustbin-view</i> will be always created on the same DB containing the input GeoTable.</li>
+						<li>The optional arguments <i>line_max_points</i> and <i>line_max_length</i> will be interpreted in the same way adopted by <b>TopoGeo_SubdivideLines()</b> 
+						(default for both: <b>-1</b>).</li>
+					</ul><hr>
+					Will return <b>0</b> on full success or a <b>positive</b> integer corresponding to the total count of failing features referenced by the <i>dustbin</i> table.<br>
+					An exception will be raised only on wrong arguments.</td></tr>
+			<tr><td><b>TopoGeo_RemoveSmallFaces</b></td>
+				<td>TopoGeo_RemoveSmallFaces( toponame <i>Text</i> , min-area <i>Double precision</i> ) : <i>Integer</i></td>
+				<td align="center" bgcolor="#d0f0d0"></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will remove from the given Topology all Faces presenting an area smaller than <i>min-area</i>.<hr>
+					Will return <b>1</b> on full success; an exception will be raised on failure.</td></tr>
+			<tr><td><b>TopoGeo_RemoveDanglingEdges</b></td>
+				<td>TopoGeo_RemoveDanglingEdges( toponame <i>Text</i> ) : <i>Integer</i></td>
+				<td align="center" bgcolor="#d0f0d0"></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will remove from the given Topology all dangling Edges.<hr>
+					Will return <b>1</b> on full success; an exception will be raised on failure.</td></tr>
+			<tr><td><b>TopoGeo_RemoveDanglingNodes</b></td>
+				<td>TopoGeo_RemoveDanglingNodes( toponame <i>Text</i> ) : <i>Integer</i></td>
+				<td align="center" bgcolor="#d0f0d0"></td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will remove from the given Topology all dangling Nodes.<hr>
+					Will return <b>1</b> on full success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_Clone</b></td>
 				<td>TopoGeo_Clone( toponame <i>Text</i> , new-toponame <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will clone an existing Topology into another; the destionation Topology shall not exist and will be automatically created.<hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_GetEdgeSeed</b></td>
 				<td>TopoGeo_GetEdgeSeed( toponame <i>Text</i> , edge-id <i>Integer</i> ) : <i>Geometry</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return a Point Geometry uniquely identifying an Edge (i.e. spatially intersecting the Edge).<hr>
 					Will return a <b>Point</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_GetFaceSeed</b></td>
 				<td>TopoGeo_GetFaceSeed( toponame <i>Text</i> , face-id <i>Integer</i> ) : <i>Geometry</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return a Point Geometry uniquely identifying a Face (i.e. spatially intersecting the Face).<hr>
 					Will return a <b>Point</b> on success; an exception will be raised on failure.</td></tr>
+			<tr><td><b>TopoGeo_SnapPointToSeed</b></td>
+				<td>TopoGeo_SnapPointToSeed( point <i>Geometry</i> , toponame <i>Text</i> , distance <i>Double</i> ) : <i>Geometry</i></td>
+				<td align="center" bgcolor="#d0f0d0">X</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will possibly return a new <b>Point</b> precisely snapped to the nearset TopoNode within the given <b>distance</b>; if no such TopoNode exists <b>NULL</b> will be returned.<br>
+				An exception will be raised on invalid arguments.</td></tr>
+			<tr><td><b>TopoGeo_SnapLineToSeed</b></td>
+				<td>TopoGeo_SnapLineToSeed( line <i>Geometry</i> , toponame <i>Text</i> , distance <i>Double</i> ) : <i>Geometry</i></td>
+				<td align="center" bgcolor="#d0f0d0">X</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
+				<td colspan="3">Will possibly return a new <b>Linestring</b> precisely snapped to the nearset Edge TopoSeed within the given <b>distance</b>; if no such TopoSeed exists <b>NULL</b> will be returned.<br>
+				An exception will be raised on invalid arguments.</td></tr>
 			<tr><td><b>TopoGeo_UpdateSeeds</b></td>
 				<td>TopoGeo_UpdateSeeds( toponame <i>Text</i> ) : <i>Integer</i><hr>
 				    TopoGeo_UpdateSeeds( toponame <i>Text</i> , incremental-mode <i>Integer</i> ) : <i>Integer</i> </td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will update all persistent Edge- and Face-Seeds so to correctly represent the current state of the underlaying Topology.
 					<ul>
 						<li>if the optional argument <i>incremental-mode</i> is set to TRUE an incremental update (faster) will be applied,
@@ -4288,7 +4359,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>TopoGeo_ToGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> ) : <i>Integer</i><hr>
 				    TopoGeo_ToGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , with-spatial-index <i>Boolenan</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to export into an Output GeoTable all Geometries out from a Topology-Geometry matching (via Seed-based references) a given
 				    Reference-GeoTable containing information attributes. 
 					<ul>
@@ -4310,7 +4381,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>TopoGeo_ToGeoTableGeneralize( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , tolerance <i>Double precision</i> ) : <i>Integer</i><hr>
 				    TopoGeo_ToGeoTableGeneralize( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , tolerance <i>Double precision</i> , with-spatial-index <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Exactly the same as <b>TopoGeo_ToGeoTable()</b> except in that all exported geometries will be simplified / generalized still maintaining full topological consistency. 
 					<ul>
 						<li><i>tolerance</i> represents the approximation radius required by the Douglas-Peuker simplification algorithm.</li>
@@ -4320,7 +4391,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>TopoGeo_CreateTopoLayer( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, topolayer-name <i>Text</i> ) : <i>Integer</i><hr>
 				    TopoGeo_CreateTopoLayer( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, topolayer-name <i>Text</i> , is-view <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a fully defined new <b>TopoLayer</b> starting from a reference GeoTable:
 					<ul>
 						<li><i>db-prefix</i> can be <b>NULL</b>, and in this case the reference GeoTable is expected to be located within the <b>"MAIN"</b> database.</li>
@@ -4337,7 +4408,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>TopoGeo_InitTopoLayer</b></td>
 				<td>TopoGeo_InitTopoLayer( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , topolayer-name <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will initialize a partialy defined new <b>TopoLayer</b> starting from a reference plain Table or View:
 					<ul>
 						<li><i>db-prefix</i> can be <b>NULL</b>, and in this case the reference Table or View is expected to be located within the <b>"MAIN"</b> database.</li>
@@ -4346,7 +4417,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>TopoGeo_RemoveTopoLayer</b></td>
 				<td>TopoGeo_RemoveTopoLayer( toponame <i>Text</i> , topolayer-name <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will completely remove an existing <b>TopoLayer</b>.<hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoGeo_ExportTopoLayer</b></td>
@@ -4354,7 +4425,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				    TopoGeo_ExportTopoLayer( toponame <i>Text</i> , topolayer-name <i>Text</i> , out-table <i>Text</i> , with-spatial-index <i>Boolean</i> ) : <i>Integer</i><hr>
 				    TopoGeo_ExportTopoLayer( toponame <i>Text</i> , topolayer-name <i>Text</i> , out-table <i>Text</i> , with-spatial-index <i>Boolean</i> , create-only <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create and populate a GeoTable corresponding to a <b>TopoLayer</b>.
 					<ul>
 						<li>if the optional boolean argument <b>with-spatial-index</b> is set to <b>TRUE</b> (any other value different from zero) then a <b>Spatial Index</b> supporting
@@ -4366,7 +4437,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>TopoGeo_InsertFeatureFromTopoLayer</b></td>
 				<td>TopoGeo_InsertFeatureFrom( toponame <i>Text</i> , topolayer-name <i>Text</i> , out-table <i>Text</i> , fid <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will inserting a single TopoFeature identified by is <b>fid</b> into a GeoTable corresponding to a <b>TopoLayer</b>.
 					<ul>
 						<li>the output GeoTable must exist and is expected to be created by a previous call to <b>TopoGeo_ExportTopoLayer()</b>.</li>
@@ -4383,12 +4454,12 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>GetLastNetworkException</b></td>
 				<td>GetLastNetworkException( netname <i>Text</i> ) : <i>Text</i></i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return the most recent exception raised by this Topo-Net, or <b>NULL</b> if no exception is currently pending.</td></tr>
 			<tr><td><b>InitTopoNet</b></td>
 				<td>ST_InitTopoNet( netname <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">This SQL function is explicitly required by <b>ISO 13249-3</b>, anyway it's simply implemented as an <i>alias-name</i> for <b>CreateNetwork ( netname )</b>.<hr>
 					Will return <i>1</i> on success) or <i>0</i> on failure: <i>-1</i> will be returned on invalid arguments.</td></tr>
 			<tr><td><b>CreateNetwork</b></td>
@@ -4398,7 +4469,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				    CreateNetwork( netname <i>Text</i> , spatial <i>Boolean</i> , srid <i>Integer</i> , has_z <i>Boolean</i> ) : <i>Integer</i><hr>
 				    CreateNetwork( netname <i>Text</i> , spatial <i>Boolean</i> , srid <i>Integer</i> , has_z <i>Boolean</i> , allow_coincident <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create all DBMS objects (tables, triggers, indices and alike) required in order to store a separate Topo-Net.
 				<ul>
 					<li><i>netname</i>: the individual unique name of this Topo-Net: all subordinated tables will use it as a prefix.</li>
@@ -4410,86 +4481,86 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>DropNetwork</b></td>
 				<td>DropNetwork( netname <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Completely removes a Topo-Net (and all data it contains) from the DBMS: to be invoked very cautiously and only if you are absolutely sure of what you are doing.<hr>
 					Will return <i>1</i> on success) or <i>0</i> on failure: <i>-1</i> will be returned on invalid arguments.</td></tr>
 			<tr><td><b>AddIsoNetNode</b></td>
 				<td>ST_AddIsoNetNode( netname <i>Text</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new isolated NetNode.<hr>
 					Will return the <b>ID</b> of the inserted NetNode on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>MoveIsoNetNode</b></td>
 				<td>ST_MoveIsoNetNode( netname <i>Text</i> , node-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will move an isolated NetNode from a point to another.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemIsoNetNode</b></td>
 				<td>ST_RemIsoNetNode( netname <i>Text</i> , node-id <i>Integer</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove an isolated NetNode.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>AddLink</b></td>
 				<td>ST_AddLink( netname <i>Text</i> , startnode-id <i>Integer</i> , endnode-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will add a new Link connecting two NetNodes.<hr>
 					Will return the <b>ID</b> of the inserted Link on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ChangeLinkGeom</b></td>
 				<td>ST_ChangeLinkGeom( netname <i>Text</i> , link-id <i>Integer</i> , linestring <i>Geometry</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will change the geometry of a Link without affecting Topology relationships.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>RemoveLink</b></td>
 				<td>ST_RemoveLink( netname <i>Text</i> , link-id <i>Integer</i> ) : <i>Text</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will remove a Link.<hr>
 					Will return a <b>text message</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>NewLogLinkSplit</b></td>
 				<td>ST_NewLogLinkSplit( netname <i>Text</i> , link-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split a Link (of the <u>Logical</u> type) by creating a new intermediate NetNode. The original Link will be deleted and will be replaced by two new Links.<hr>
 					Will return the <b>ID</b> of the inserted Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ModLogLinkSplit</b></td>
 				<td>ST_ModLogLingSplit( netname <i>Text</i> , link-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split a Link (of the <u>Logical</u> type) by creating a new intermediate NetNode. The original Link will be modified and a new Link will be inserted.<hr>
 					Will return the <b>ID</b> of the inserted Node on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>NewGeoLinkSplit</b></td>
 				<td>ST_NewGeoLinkSplit( netame <i>Text</i> , link-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split a Link (of the <u>Spatial</u> type) by creating a new intermediate NetNode. The original Link will be deleted and will be replaced by two new Links.<hr>
 					Will return the <b>ID</b> of the inserted NetNode on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ModGeoLinkSplit</b></td>
 				<td>ST_ModGeoLingSplit( netame <i>Text</i> , link-id <i>Integer</i> , point <i>Geometry</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will split a Link (of the <u>Spatial</u> type) by creating a new intermediate NetNode. The original Link will be modified and a new Link will be inserted.<hr>
 					Will return the <b>ID</b> of the inserted NetNode on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>NewLinkHeal</b></td>
 				<td>ST_NewLinkHeal( netname <i>Text</i> , link1-id <i>Integer</i> , link2-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will heal two Links by deleting the NetNode connecting them. Both the original Links will be deleted and will be replaced by
 					a new Link preserving the same orientation of the first Link provided.<hr>
 					Will return the <b>ID</b> of the removed NetNode on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>ModLinkHeal</b></td>
 				<td>ST_ModLinkHeal( netname <i>Text</i> , link1-id <i>Integer</i> , link2-id <i>Integer</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will heal two Links by deleting the NetNode connecting them. The first Link provided will be modified and the second deleted.<hr>
 					Will return the <b>ID</b> of the removed NetNode on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>LogiNetFromTGeo</b></td>
 				<td>ST_LogiNetFromTGeo( netname <i>Text</i> , toponame <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a <b>Logical Topology-Network</b> from an existing <b>Topology-Geometry</b>.<br>
 					The destination <i>TopoNet</i> is expected to exist and to be completely empty.<hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.<br>
@@ -4497,7 +4568,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>SpatNetFromTGeo</b></td>
 				<td>ST_SpatNetFromTGeo( netname <i>Text</i> , toponame <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a <b>Spatial Topology-Network</b> from an existing <b>Topology-Geometry</b>.<br>
 					The destination <i>TopoNet</i> is expected to exist and to be completely empty.<hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.<br>
@@ -4507,7 +4578,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>SpatNetFromGeom</b></td>
 				<td>ST_SpatNetFromGeom( netname <i>Text</i> , geometry <i>BLOB</i> )</td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will populate a full Network by importing a collection of arbitrary Geometries.<br>
 					The destination Network must already exists and must be empty; both SRID and dimensions of input Geometries must match SRID and dimensions declared by Network.<br>
 					Calling this function on behalf of some Network of the Logical type will raise an exception<hr>
@@ -4515,7 +4586,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>ValidLogicalNet</b></td>
 				<td>ST_ValidLogicalNet( netname <i>Text</i> ) : <i>DB-table</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a DB-Table containing a validation report for the given TopoNet of the Logical type: if the output table is empty and no exception was raised
 					the Network is assumed to be fully valid, otherwise a row will be inserted into the table for each detected Topology invalidity.<br>
 					If the destination table already exists it will be dropped and created yet again.<hr>
@@ -4524,7 +4595,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>ValidSpatialNet</b></td>
 				<td>ST_ValidSpatialNet( netname <i>Text</i> ) : <i>DB-table</i></td>
 				<td align="center" bgcolor="#d0f0d0">X</td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will create a DB-Table containing a validation report for the given TopoNet of the Spatial type: if the output table is empty and no exception was raised
 					the Network is assumed to be fully valid, otherwise a row will be inserted into the table for each detected Topology invalidity.<br>
 					If the destination table already exists it will be dropped and created yet again.<hr>
@@ -4533,21 +4604,21 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>GetNetNodeByPoint</b></td>
 				<td>GetNetNodeByPoint( netname <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to find the ID of a NetNode located at Point.<hr>
 					Will return the ID of the NetNode on success; an exception will be raised on failure.<br>
 					<b>Note</b>: this function cannot be applied to a <i>Logical Network</i></td></tr>
 			<tr><td><b>GetLinkByPoint</b></td>
 				<td>GetLinkByPoint( netname <i>Text</i> , point <i>Geometry</i> , tolerance <i>Double precision</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to find the ID of a Link intersecting the given Point.<hr>
 					Will return the ID of the Link on success; an exception will be raised on failure.<br>
 					<b>Note</b>: this function cannot be applied to a <i>Logical Network</i></td></tr>
 			<tr><td><b>TopoNet_FromGeoTable</b></td>
 				<td>TopoNet_FromGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to import all Geometries from an input GeoTable identified by <i>db-prefix</i>, <i>table-name</i> and <i>column-name</i> into an already existing Topology-Network.
 					<ul>
 						<li><i>db-prefix</i> can be <b>NULL</b>, and in this case the input GeoTable is expected to be located within the <b>"MAIN"</b> database.</li>
@@ -4560,20 +4631,20 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 			<tr><td><b>TopoNet_Clone</b></td>
 				<td>TopoNet_Clone( netname <i>Text</i> , new-netname <i>Text</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will clone an existing Network into another; the destionation Network shall not exist and will be automatically created.<hr>
 					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoNet_GetLinkSeed</b></td>
 				<td>TopoNet_GetLinkSeed( netname <i>Text</i> , link-id <i>Integer</i> ) : <i>Geometry</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will return a Point Geometry uniquely identifying a Link (i.e. spatially intersecting the Link).<hr>
 					Will return a <b>Point</b> on success; an exception will be raised on failure.</td></tr>
 			<tr><td><b>TopoNet_UpdateSeeds</b></td>
 				<td>TopoNet_UpdateSeeds( netname <i>Text</i> ) : <i>Integer</i><hr>
 				    TopoNet_UpdateSeeds( netname <i>Text</i> , incremental-mode <i>Integer</i> ) : <i>Integer</i> </td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPOM</td>
 				<td colspan="3">Will update all persistent Link-Seeds so to correctly represent the current state of the underlaying Network.
 					<ul>
 						<li>if the optional argument <i>incremental-mode</i> is set to TRUE an incremental update (faster) will be applied,
@@ -4584,7 +4655,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>TopoNet_ToGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> ) : <i>Integer</i><hr>
 				    TopoNet_ToGeoTable( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , with-spatial-index <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">RTTOPO</td>
 				<td colspan="3">Will attempt to export into an Output GeoTable all Geometries out from a Topology-Network matching (via Seed-based references) a given
 				    Reference-GeoTable containing information attributes. 
 					<ul>
@@ -4607,7 +4678,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>TopoNet_ToGeoTableGeneralize( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , tolerance <i>Double precision</i> ) : <i>Integer</i><hr>
 				    TopoNet_ToGeoTableGeneralize( toponame <i>Text</i> , db-prefix <i>Text</i> , ref-table-name <i>Text</i> , ref-column-name <i>Text</i>, out-table <i>Text</i> , tolerance <i>Double precision</i> , with-spatial-index <i>Boolean</i> ) : <i>Integer</i></td>
 				<td align="center" bgcolor="#d0f0d0"></td>
-				<td align="center" bgcolor="#f0d0f0">LWGEOM</td>
+				<td align="center" bgcolor="#f0d0f0">LRTTOPO</td>
 				<td colspan="3">Exactly the same as <b>TopoNet_ToGeoTable()</b> except in that all exported geometries will be simplified / generalized still maintaining full topological consistency. 
 					<ul>
 						<li><i>tolerance</i> represents the approximation radius required by the Douglas-Peuker simplification algorithm.</li>
@@ -4700,7 +4771,7 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 				<td>ImportSHP( filename <i>Text</i> , table <i>Text</i> , charset <i>Text</i> ) : <i>Integer</i><hr>
 				ImportSHP( filename <i>Text</i> , table <i>Text</i> , charset <i>Text</i> [ , srid <i>Integer</i>  [ ,
 				    geom_column <i>Text</i> [ , pk_column <i>Text</i> [ , geometry_type <i>Text</i> [ , coerce2D <i>Integer</i> 
-				    [ , compressed <i>Integer</i> [ , spatial_index <i>Integer</i> [ , text_dats <i>Integer</i> ] ] ] ] ] ] ] ] )
+				    [ , compressed <i>Integer</i> [ , spatial_index <i>Integer</i> [ , text_dates <i>Integer</i> [ , verbose <i>Integer</i> ] ] ] ] ] ] ] ] ] )
 				    : <i>Integer</i></td>
 				<td colspan="3">Will import an external Shapfile into an internal Table:
 				<ul>
@@ -4724,6 +4795,8 @@ the return type is Integer, with a return value of 1 for TRUE, 0 for FALSE</td><
 					<li><b>spatial_index</b> boolean flag: immediately building a Spatial Index or not; <i>0</i> by default.</li>
 					<li><b>text_dates</b> boolean flag: interpreting DBF dates as plaintext or not: <i>0</i> by default
 					(i.e. as <i>Julian Day</i>).</li>
+					<li><b>verbose</b> boolean flag: verbose console output: <i>1</i> by default, you can explicitly pass <i>0</i>
+					if you better whish a silent output.
 				</ul></li>
 				</ul>
 				<hr>
diff --git a/src/connection_cache/alloc_cache.c b/src/connection_cache/alloc_cache.c
index b942819..bcfae08 100644
--- a/src/connection_cache/alloc_cache.c
+++ b/src/connection_cache/alloc_cache.c
@@ -84,6 +84,10 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include <proj_api.h>
 #endif
 
+#ifdef ENABLE_RTTOPO		/* including RTTOPO */
+#include <librttopo.h>
+#endif
+
 #ifndef GEOS_REENTRANT		/* only when using the obsolete partially thread-safe mode */
 #include "cache_aux_1.h"
 #endif /* end GEOS_REENTRANT */
@@ -96,10 +100,8 @@ extern char *gaia_geos_warning_msg;
 int gaia_already_initialized = 0;
 #ifdef _WIN32
 static CRITICAL_SECTION gaia_cache_semaphore;
-static CRITICAL_SECTION gaia_lwgeom_semaphore;
 #else
 static pthread_mutex_t gaia_cache_semaphore = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t gaia_lwgeom_semaphore = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
 #define GAIA_CONN_RESERVED	(char *)1
@@ -164,6 +166,86 @@ conn_geos_warning (const char *msg, void *userdata)
 	spatialite_e ("GEOS warning: %s\n", msg);
 }
 
+static void
+conn_rttopo_error (const char *fmt, va_list ap, void *userdata)
+{
+/* reporting some RTTOPO error - thread safe */
+    char *msg = NULL;
+    int len;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) userdata;
+    if (cache == NULL)
+	goto invalid_cache;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	goto invalid_cache;
+
+    if (cache->gaia_rttopo_error_msg != NULL)
+	free (cache->gaia_rttopo_error_msg);
+    cache->gaia_rttopo_error_msg = NULL;
+
+    msg = sqlite3_vmprintf (fmt, ap);
+    if (msg)
+      {
+	  if (strlen (msg) > 0)
+	    {
+		spatialite_e ("RTTOPO error: %s\n\n", msg);
+		len = strlen (msg);
+		cache->gaia_rttopo_error_msg = malloc (len + 1);
+		strcpy (cache->gaia_rttopo_error_msg, msg);
+	    }
+	  sqlite3_free (msg);
+      }
+    return;
+
+  invalid_cache:
+    if (msg)
+      {
+	  spatialite_e ("RTTOPO error: %s\n", msg);
+	  sqlite3_free (msg);
+      }
+}
+
+static void
+conn_rttopo_warning (const char *fmt, va_list ap, void *userdata)
+{
+/* reporting some RTTOPO warning - thread safe */
+    char *msg = NULL;
+    int len;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) userdata;
+    if (cache == NULL)
+	goto invalid_cache;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	goto invalid_cache;
+
+    if (cache->gaia_rttopo_warning_msg != NULL)
+	free (cache->gaia_rttopo_warning_msg);
+    cache->gaia_rttopo_warning_msg = NULL;
+
+    msg = sqlite3_vmprintf (fmt, ap);
+    if (msg)
+      {
+	  if (strlen (msg) > 0)
+	    {
+		spatialite_e ("RTTOPO warning: %s\n", msg);
+		len = strlen (msg);
+		cache->gaia_rttopo_warning_msg = malloc (len + 1);
+		strcpy (cache->gaia_rttopo_warning_msg, msg);
+	    }
+	  sqlite3_free (msg);
+      }
+    return;
+
+  invalid_cache:
+    if (msg)
+      {
+	  spatialite_e ("RTTOPO warning: %s\n\n", msg);
+	  sqlite3_free (msg);
+      }
+}
+
 #ifndef GEOS_REENTRANT		/* only when using the obsolete partially thread-safe mode */
 static void
 setGeosErrorMsg (int pool_index, const char *msg)
@@ -281,20 +363,25 @@ spatialite_alloc_reentrant ()
     cache->decimal_precision = -1;
     cache->GEOS_handle = NULL;
     cache->PROJ_handle = NULL;
+    cache->RTTOPO_handle = NULL;
     cache->cutterMessage = NULL;
     cache->pool_index = -1;
     cache->gaia_geos_error_msg = NULL;
     cache->gaia_geos_warning_msg = NULL;
     cache->gaia_geosaux_error_msg = NULL;
+    cache->gaia_rttopo_error_msg = NULL;
+    cache->gaia_rttopo_warning_msg = NULL;
 /* initializing an empty linked list of Topologies */
     cache->firstTopology = NULL;
     cache->lastTopology = NULL;
     cache->next_topo_savepoint = 0;
-    cache->topo_savepoint_name = NULL;
+    cache->first_topo_svpt = NULL;
+    cache->last_topo_svpt = NULL;
     cache->firstNetwork = NULL;
     cache->lastNetwork = NULL;
     cache->next_network_savepoint = 0;
-    cache->network_savepoint_name = NULL;
+    cache->first_net_svpt = NULL;
+    cache->last_net_svpt = NULL;
 /* initializing the XML error buffers */
     out = malloc (sizeof (gaiaOutBuffer));
     gaiaOutBufferInitialize (out);
@@ -343,6 +430,12 @@ spatialite_alloc_reentrant ()
     cache->PROJ_handle = pj_ctx_alloc ();
 #endif /* end PROJ.4  */
 
+#ifdef ENABLE_RTTOPO		/* initializing the RTTOPO context */
+    cache->RTTOPO_handle = rtgeom_init (NULL, NULL, NULL);
+    rtgeom_set_error_logger (cache->RTTOPO_handle, conn_rttopo_error, cache);
+    rtgeom_set_notice_logger (cache->RTTOPO_handle, conn_rttopo_warning, cache);
+#endif /* end RTTOPO */
+
   done:
     return cache;
 }
@@ -397,11 +490,13 @@ spatialite_alloc_connection ()
     cache->firstTopology = NULL;
     cache->lastTopology = NULL;
     cache->next_topo_savepoint = 0;
-    cache->topo_savepoint_name = NULL;
+    cache->first_topo_svpt = NULL;
+    cache->last_topo_svpt = NULL;
     cache->firstNetwork = NULL;
     cache->lastNetwork = NULL;
     cache->next_network_savepoint = 0;
-    cache->network_savepoint_name = NULL;
+    cache->first_net_svpt = NULL;
+    cache->last_net_svpt = NULL;
 /* initializing the XML error buffers */
     out = malloc (sizeof (gaiaOutBuffer));
     gaiaOutBufferInitialize (out);
@@ -458,8 +553,10 @@ spatialite_alloc_connection ()
 SPATIALITE_DECLARE void
 spatialite_finalize_topologies (const void *ptr)
 {
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 /* freeing all Topology Accessor Objects */
+    struct splite_savepoint *p_svpt;
+    struct splite_savepoint *p_svpt_n;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) ptr;
     if (cache == NULL)
 	return;
@@ -469,19 +566,35 @@ spatialite_finalize_topologies (const void *ptr)
     free_internal_cache_topologies (cache->firstTopology);
     cache->firstTopology = NULL;
     cache->lastTopology = NULL;
-    if (cache->topo_savepoint_name != NULL)
-	sqlite3_free (cache->topo_savepoint_name);
-    cache->topo_savepoint_name = NULL;
+    p_svpt = cache->first_topo_svpt;
+    while (p_svpt != NULL)
+      {
+	  p_svpt_n = p_svpt->next;
+	  if (p_svpt->savepoint_name != NULL)
+	      sqlite3_free (p_svpt->savepoint_name);
+	  free (p_svpt);
+	  p_svpt = p_svpt_n;
+      }
+    cache->first_topo_svpt = NULL;
+    cache->last_topo_svpt = NULL;
     free_internal_cache_networks (cache->firstNetwork);
     cache->firstNetwork = NULL;
     cache->lastTopology = NULL;
-    if (cache->network_savepoint_name != NULL)
-	sqlite3_free (cache->network_savepoint_name);
-    cache->network_savepoint_name = NULL;
+    p_svpt = cache->first_net_svpt;
+    while (p_svpt != NULL)
+      {
+	  p_svpt_n = p_svpt->next;
+	  if (p_svpt->savepoint_name != NULL)
+	      sqlite3_free (p_svpt->savepoint_name);
+	  free (p_svpt);
+	  p_svpt = p_svpt_n;
+      }
+    cache->first_net_svpt = NULL;
+    cache->last_net_svpt = NULL;
 #else
     if (ptr == NULL)
 	return;			/* silencing stupid compiler warnings */
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
 }
 
 SPATIALITE_PRIVATE void
@@ -518,6 +631,12 @@ free_internal_cache (struct splite_internal_cache *cache)
     cache->PROJ_handle = NULL;
 #endif
 
+#ifdef ENABLE_RTTOPO
+    if (cache->RTTOPO_handle != NULL)
+	rtgeom_finish (cache->RTTOPO_handle);
+    cache->RTTOPO_handle = NULL;
+#endif
+
 /* freeing GEOS error buffers */
     if (cache->gaia_geos_error_msg)
 	free (cache->gaia_geos_error_msg);
@@ -526,6 +645,12 @@ free_internal_cache (struct splite_internal_cache *cache)
     if (cache->gaia_geosaux_error_msg)
 	free (cache->gaia_geosaux_error_msg);
 
+/* freeing RTTOPO error buffers */
+    if (cache->gaia_rttopo_error_msg)
+	free (cache->gaia_rttopo_error_msg);
+    if (cache->gaia_rttopo_warning_msg)
+	free (cache->gaia_rttopo_warning_msg);
+
 /* freeing the XML error buffers */
     gaiaOutBufferReset (cache->xmlParsingErrors);
     gaiaOutBufferReset (cache->xmlSchemaValidationErrors);
@@ -865,30 +990,11 @@ splite_cache_semaphore_unlock (void)
 #ifdef _WIN32
     LeaveCriticalSection (&gaia_cache_semaphore);
 #else
+    pthread_mutex_trylock (&gaia_cache_semaphore);
     pthread_mutex_unlock (&gaia_cache_semaphore);
 #endif
 }
 
-SPATIALITE_PRIVATE void
-splite_lwgeom_semaphore_lock (void)
-{
-#ifdef _WIN32
-    EnterCriticalSection (&gaia_lwgeom_semaphore);
-#else
-    pthread_mutex_lock (&gaia_lwgeom_semaphore);
-#endif
-}
-
-SPATIALITE_PRIVATE void
-splite_lwgeom_semaphore_unlock (void)
-{
-#ifdef _WIN32
-    LeaveCriticalSection (&gaia_lwgeom_semaphore);
-#else
-    pthread_mutex_unlock (&gaia_lwgeom_semaphore);
-#endif
-}
-
 SPATIALITE_DECLARE void
 spatialite_initialize (void)
 {
@@ -898,7 +1004,6 @@ spatialite_initialize (void)
 
 #ifdef _WIN32
     InitializeCriticalSection (&gaia_cache_semaphore);
-    InitializeCriticalSection (&gaia_lwgeom_semaphore);
 #endif
 
 #ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
@@ -920,7 +1025,6 @@ spatialite_shutdown (void)
 
 #ifdef _WIN32
     DeleteCriticalSection (&gaia_cache_semaphore);
-    DeleteCriticalSection (&gaia_lwgeom_semaphore);
 #endif
 
 #ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
diff --git a/src/cutter/gaia_cutter.c b/src/cutter/gaia_cutter.c
index 0333f7b..e8bc7d7 100644
--- a/src/cutter/gaia_cutter.c
+++ b/src/cutter/gaia_cutter.c
@@ -61,6 +61,10 @@ CIG: 6038019AE5
 #include <time.h>
 
 #if defined(_WIN32) && !defined(__MINGW32__)
+#include "process.h"
+#endif
+
+#if defined(_WIN32) && !defined(__MINGW32__)
 #include "config-msvc.h"
 #else
 #include "config.h"
@@ -75,6 +79,12 @@ CIG: 6038019AE5
 
 #ifndef OMIT_GEOS		/* only if GEOS is enabled */
 
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define strcasecmp    _stricmp
+#define strncasecmp    _strnicmp
+#define pid_t	int
+#endif
+
 #define GAIA_CUTTER_OUTPUT_PK	1
 #define GAIA_CUTTER_INPUT_PK	2
 #define GAIA_CUTTER_BLADE_PK	3
@@ -649,8 +659,8 @@ do_check_input (sqlite3 * handle, const char *db_prefix, const char *table,
     char *errMsg = NULL;
     int count = 0;
     char *geom_name = NULL;
-    int geom_srid;
-    int geom_type;
+    int geom_srid = -1;
+    int geom_type = -1;
     int pk = 0;
     int i;
     int ret;
@@ -805,8 +815,8 @@ do_check_blade (sqlite3 * handle, const char *db_prefix, const char *table,
     char *errMsg = NULL;
     int count = 0;
     char *geom_name = NULL;
-    int geom_srid;
-    int geom_type;
+    int geom_srid = -1;
+    int geom_type = -1;
     int pk = 0;
     int i;
     int ret;
@@ -1077,7 +1087,7 @@ do_check_valid (sqlite3 * handle, const char *out_table, const char *input_geom,
     int columns;
     int i;
     char *errMsg = NULL;
-    int count;
+    int count = 0;
 
 /* inspecting the table */
     xcolumn = gaiaDoubleQuotedSql (input_geom);
@@ -1231,7 +1241,11 @@ do_verify_blade_spatial_index (sqlite3 * handle, const char *db_prefix,
 
   create_default:
 /* creating a transient Spatial Index */
+#if defined(_WIN32) && !defined(__MINGW32__)
+    pid = _getpid ();
+#else
     pid = getpid ();
+#endif
     time (&now);
     idx_name = sqlite3_mprintf ("tmpidx_%u_%u", pid, now);
     xtable = gaiaDoubleQuotedSql (idx_name);
@@ -1637,8 +1651,8 @@ do_create_output_geometry (sqlite3 * handle, const char *table,
     int retcode = 0;
     sqlite3_stmt *stmt = NULL;
     char *sql;
-    const char *type;
-    const char *dims;
+    const char *type = "";
+    const char *dims = "";
 
     switch (geom_type)
       {
@@ -1977,8 +1991,8 @@ do_prepare_linestring (gaiaLinestringPtr ln, int srid)
     int iv;
     double x;
     double y;
-    double z;
-    double m;
+    double z = 0.0;
+    double m = 0.0;
 
     if (ln->DimensionModel == GAIA_XY_Z || ln->DimensionModel == GAIA_XY_Z_M)
 	new_geom = gaiaAllocGeomCollXYZ ();
@@ -2054,6 +2068,8 @@ do_prepare_polygon (gaiaPolygonPtr pg, int srid)
     new_rng = new_pg->Exterior;
     for (iv = 0; iv < rng->Points; iv++)
       {
+	  m = 0.0;
+	  z = 0.0;
 	  if (rng->DimensionModel == GAIA_XY_Z)
 	    {
 		gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
@@ -2094,6 +2110,8 @@ do_prepare_polygon (gaiaPolygonPtr pg, int srid)
 	  new_rng = gaiaAddInteriorRing (new_pg, ib, rng->Points);
 	  for (iv = 0; iv < rng->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (rng->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
@@ -2420,7 +2438,11 @@ do_prepare_temp_points (struct output_table *tbl, sqlite3 * handle,
 
     *tmp_table = NULL;
 /* composing the SQL statement */
+#if defined(_WIN32) && !defined(__MINGW32__)
+    pid = _getpid ();
+#else
     pid = getpid ();
+#endif
     time (&now);
     temporary_table = sqlite3_mprintf ("tmpcuttertbl_%u_%u", pid, now);
     xtable = gaiaDoubleQuotedSql (temporary_table);
@@ -2576,7 +2598,11 @@ do_create_temp_linestrings (struct output_table *tbl, sqlite3 * handle,
 
     *tmp_table = NULL;
 /* composing the SQL statement */
+#if defined(_WIN32) && !defined(__MINGW32__)
+    pid = _getpid ();
+#else
     pid = getpid ();
+#endif
     time (&now);
     temporary_table = sqlite3_mprintf ("tmpcuttertbl_%u_%u", pid, now);
     xtable = gaiaDoubleQuotedSql (temporary_table);
@@ -2683,7 +2709,11 @@ do_create_temp_polygons (struct output_table *tbl, sqlite3 * handle,
 
     *tmp_table = NULL;
 /* composing the SQL statement */
+#if defined(_WIN32) && !defined(__MINGW32__)
+    pid = _getpid ();
+#else
     pid = getpid ();
+#endif
     time (&now);
     temporary_table = sqlite3_mprintf ("tmpcuttertbl_%u_%u", pid, now);
     xtable = gaiaDoubleQuotedSql (temporary_table);
@@ -3688,7 +3718,7 @@ do_cut_tmp_linestrings (sqlite3 * handle, const void *cache,
 		/* fetched one row from the resultset */
 		sqlite3_int64 pk = 0;
 		unsigned char *blob = NULL;
-		int blob_sz;
+		int blob_sz = 0;
 		gaiaGeomCollPtr input_g;
 		gaiaGeomCollPtr result;
 		if (sqlite3_column_type (stmt_in, 0) == SQLITE_INTEGER
@@ -4884,7 +4914,7 @@ do_cut_tmp_polygons (sqlite3 * handle, const void *cache,
 		/* fetched one row from the resultset */
 		sqlite3_int64 pk = 0;
 		unsigned char *blob = NULL;
-		int blob_sz;
+		int blob_sz = 0;
 		gaiaGeomCollPtr input_g;
 		gaiaGeomCollPtr result;
 		if (sqlite3_column_type (stmt_in, 0) == SQLITE_INTEGER
@@ -5704,8 +5734,8 @@ do_insert_output_polygons (struct output_table *tbl, sqlite3 * handle,
     int gpkg_mode = 0;
     int gpkg_amphibious = 0;
     struct temporary_row prev_row;
-    int prev_ngeom;
-    int prog_res;
+    int prev_ngeom = -1;
+    int prog_res = -1;
 
     if (cache != NULL)
       {
@@ -6455,8 +6485,8 @@ do_insert_output_linestrings (struct output_table *tbl, sqlite3 * handle,
     int gpkg_mode = 0;
     int gpkg_amphibious = 0;
     struct temporary_row prev_row;
-    int prev_ngeom;
-    int prog_res;
+    int prev_ngeom = -1;
+    int prog_res = -1;
 
     if (cache != NULL)
       {
diff --git a/src/dxf/dxf_load_distinct.c b/src/dxf/dxf_load_distinct.c
index 7dd6fe6..4096797 100644
--- a/src/dxf/dxf_load_distinct.c
+++ b/src/dxf/dxf_load_distinct.c
@@ -736,9 +736,9 @@ import_by_layer (sqlite3 * handle, gaiaDxfParserPtr dxf, int append)
 {
 /* populating the target DB - by distinct layers */
     int ret;
-    sqlite3_stmt *stmt;
-    sqlite3_stmt *stmt_ext;
-    sqlite3_stmt *stmt_pattern;
+    sqlite3_stmt *stmt = NULL;
+    sqlite3_stmt *stmt_ext = NULL;
+    sqlite3_stmt *stmt_pattern = NULL;
     unsigned char *blob;
     int blob_size;
     gaiaGeomCollPtr geom;
@@ -747,9 +747,9 @@ import_by_layer (sqlite3 * handle, gaiaDxfParserPtr dxf, int append)
     gaiaRingPtr p_rng;
     int iv;
     char *name;
-    char *attr_name;
+    char *attr_name = "";
     char *block;
-    gaiaDxfTextPtr txt;
+    gaiaDxfTextPtr txt = NULL;
     gaiaDxfPointPtr pt;
     gaiaDxfPolylinePtr ln;
     gaiaDxfPolylinePtr pg;
diff --git a/src/dxf/dxf_loader.c b/src/dxf/dxf_loader.c
index 3c54170..75218e7 100644
--- a/src/dxf/dxf_loader.c
+++ b/src/dxf/dxf_loader.c
@@ -3251,7 +3251,7 @@ import_blocks (sqlite3 * handle, gaiaDxfParserPtr dxf, int append)
     int blob_size;
     gaiaGeomCollPtr geom;
     int error = 0;
-    char *name;
+    char *name = "??";
     sqlite3_stmt *stmt;
     sqlite3_stmt *stmt_text_2d = NULL;
     sqlite3_stmt *stmt_text_3d = NULL;
diff --git a/src/dxf/dxf_parser.c b/src/dxf/dxf_parser.c
index d3fdf99..074ee30 100644
--- a/src/dxf/dxf_parser.c
+++ b/src/dxf/dxf_parser.c
@@ -1308,7 +1308,7 @@ static void
 unlinked_rings (const void *p_cache, gaiaDxfPolylinePtr line)
 {
 /* attempt to identify unlinked Polygon rings */
-    int invalid;
+    int invalid = 0;
     int start;
     int count;
     double x;
@@ -3537,7 +3537,7 @@ gaiaParseDxfFileCommon (const void *p_cache, gaiaDxfParserPtr dxf,
 		p = line;
 		continue;
 	    }
-	  *p++ = c;
+	  *p++ = (char) c;
 	  /* Even Rouault 2013-06-02 - avoiding a potential buffer overflow */
 	  if (p - line == sizeof (line) - 1)
 	      goto stop;
diff --git a/src/dxf/dxf_writer.c b/src/dxf/dxf_writer.c
index 5382e25..577eff1 100644
--- a/src/dxf/dxf_writer.c
+++ b/src/dxf/dxf_writer.c
@@ -273,6 +273,8 @@ gaiaDxfWriteLine (gaiaDxfWriterPtr dxf, const char *layer,
     for (iv = 0; iv < line->Points; iv++)
       {
 	  /* exporting all vertices */
+	  m = 0.0;
+	  z = 0.0;
 	  if (line->DimensionModel == GAIA_XY_Z)
 	    {
 		gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -327,6 +329,8 @@ gaiaDxfWriteRing (gaiaDxfWriterPtr dxf, const char *layer, gaiaRingPtr ring)
 	     Ring closure is always implicitly assumed, so 
 	     there is no need at all to explicitly export
 	     a last vertex identical to the first one */
+	  m = 0.0;
+	  z = 0.0;
 	  if (ring->DimensionModel == GAIA_XY_Z)
 	    {
 		gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z);
diff --git a/src/gaiaaux/gg_sqlaux.c b/src/gaiaaux/gg_sqlaux.c
index d4edb43..a7bc571 100644
--- a/src/gaiaaux/gg_sqlaux.c
+++ b/src/gaiaaux/gg_sqlaux.c
@@ -1257,7 +1257,7 @@ gaiaEncodeURL (const char *url)
 static char
 url_from_hex (char ch)
 {
-    return isdigit (ch) ? ch - '0' : tolower (ch) - 'a' + 10;
+    return isdigit (ch) ? ch - '0' : (char) (tolower (ch) - 'a' + 10);
 }
 
 GAIAAUX_DECLARE char *
@@ -1305,7 +1305,7 @@ gaiaDirNameFromPath (const char *path)
     const char *in = path;
     const char *last = NULL;
     int len = 0;
-    int dirlen;
+    int dirlen = len;
     char *name;
 
     if (path == NULL)
diff --git a/src/gaiaaux/gg_utf8.c b/src/gaiaaux/gg_utf8.c
index b838288..fa8fd08 100644
--- a/src/gaiaaux/gg_utf8.c
+++ b/src/gaiaaux/gg_utf8.c
@@ -100,7 +100,7 @@ GAIAAUX_DECLARE int
 gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs)
 {
 /* converting a string from a charset to another "on-the-fly" */
-    char utf8buf[65536];
+    char *utf8buf;
 #if !defined(__MINGW32__) && defined(_WIN32)
     const char *pBuf;
 #else /* not WIN32 */
@@ -109,21 +109,27 @@ gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs)
     size_t len;
     size_t utf8len;
     char *pUtf8buf;
+    int maxlen;
     iconv_t cvt = iconv_open (toCs, fromCs);
     if (cvt == (iconv_t) (-1))
 	goto unsupported;
     len = strlen (*buf);
-    utf8len = 65536;
+    maxlen = len * 4;
+    utf8len = maxlen;
     pBuf = *buf;
+    utf8buf = sqlite3_malloc (utf8len);
     pUtf8buf = utf8buf;
     if (iconv (cvt, &pBuf, &len, &pUtf8buf, &utf8len) == (size_t) (-1))
 	goto error;
-    utf8buf[65536 - utf8len] = '\0';
-    memcpy (*buf, utf8buf, (65536 - utf8len) + 1);
+    utf8buf[maxlen - utf8len] = '\0';
+    sqlite3_free (*buf);
+    *buf = utf8buf;
     iconv_close (cvt);
     return 1;
   error:
     iconv_close (cvt);
+    sqlite3_free (*buf);
+    *buf = NULL;
   unsupported:
     return 0;
 }
diff --git a/src/gaiageo/Makefile.am b/src/gaiageo/Makefile.am
index 294aec4..fc500f0 100644
--- a/src/gaiageo/Makefile.am
+++ b/src/gaiageo/Makefile.am
@@ -13,7 +13,7 @@ GAIAGEO_COMMON_SOURCES = gg_advanced.c \
 	gg_geoscvt.c \
 	gg_relations.c \
 	gg_relations_ext.c \
-	gg_lwgeom.c \
+	gg_rttopo.c \
 	gg_extras.c \
 	gg_shape.c \
 	gg_transform.c \
diff --git a/src/gaiageo/Makefile.in b/src/gaiageo/Makefile.in
index 92ec0f3..b447b05 100644
--- a/src/gaiageo/Makefile.in
+++ b/src/gaiageo/Makefile.in
@@ -106,7 +106,7 @@ gaiageo_la_LIBADD =
 am__objects_1 = gaiageo_la-gg_advanced.lo gaiageo_la-gg_endian.lo \
 	gaiageo_la-gg_geodesic.lo gaiageo_la-gg_geometries.lo \
 	gaiageo_la-gg_geoscvt.lo gaiageo_la-gg_relations.lo \
-	gaiageo_la-gg_relations_ext.lo gaiageo_la-gg_lwgeom.lo \
+	gaiageo_la-gg_relations_ext.lo gaiageo_la-gg_rttopo.lo \
 	gaiageo_la-gg_extras.lo gaiageo_la-gg_shape.lo \
 	gaiageo_la-gg_transform.lo gaiageo_la-gg_wkb.lo \
 	gaiageo_la-gg_wkt.lo gaiageo_la-gg_vanuatu.lo \
@@ -126,7 +126,7 @@ gaiageo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 libgaiageo_la_LIBADD =
 am__objects_2 = gg_advanced.lo gg_endian.lo gg_geodesic.lo \
 	gg_geometries.lo gg_geoscvt.lo gg_relations.lo \
-	gg_relations_ext.lo gg_lwgeom.lo gg_extras.lo gg_shape.lo \
+	gg_relations_ext.lo gg_rttopo.lo gg_extras.lo gg_shape.lo \
 	gg_transform.lo gg_wkb.lo gg_wkt.lo gg_vanuatu.lo gg_ewkt.lo \
 	gg_geoJSON.lo gg_kml.lo gg_gml.lo gg_voronoj.lo gg_xml.lo \
 	gg_matrix.lo
@@ -376,7 +376,7 @@ GAIAGEO_COMMON_SOURCES = gg_advanced.c \
 	gg_geoscvt.c \
 	gg_relations.c \
 	gg_relations_ext.c \
-	gg_lwgeom.c \
+	gg_rttopo.c \
 	gg_extras.c \
 	gg_shape.c \
 	gg_transform.c \
@@ -471,10 +471,10 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_geoscvt.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_gml.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_kml.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_lwgeom.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_matrix.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_relations.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_relations_ext.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_rttopo.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_shape.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_transform.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaiageo_la-gg_vanuatu.Plo at am__quote@
@@ -492,10 +492,10 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_geoscvt.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_gml.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_kml.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_lwgeom.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_matrix.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_relations.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_relations_ext.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_rttopo.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_shape.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_transform.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gg_vanuatu.Plo at am__quote@
@@ -574,12 +574,12 @@ gaiageo_la-gg_relations_ext.lo: gg_relations_ext.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gaiageo_la-gg_relations_ext.lo `test -f 'gg_relations_ext.c' || echo '$(srcdir)/'`gg_relations_ext.c
 
-gaiageo_la-gg_lwgeom.lo: gg_lwgeom.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gaiageo_la-gg_lwgeom.lo -MD -MP -MF $(DEPDIR)/gaiageo_la-gg_lwgeom.Tpo -c -o gaiageo_la-gg_lwgeom.lo `test -f 'gg_lwgeom.c' || echo '$(srcdir)/'`gg_lwgeom.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gaiageo_la-gg_lwgeom.Tpo $(DEPDIR)/gaiageo_la-gg_lwgeom.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='gg_lwgeom.c' object='gaiageo_la-gg_lwgeom.lo' libtool=yes @AMDEPBACKSLASH@
+gaiageo_la-gg_rttopo.lo: gg_rttopo.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gaiageo_la-gg_rttopo.lo -MD -MP -MF $(DEPDIR)/gaiageo_la-gg_rttopo.Tpo -c -o gaiageo_la-gg_rttopo.lo `test -f 'gg_rttopo.c' || echo '$(srcdir)/'`gg_rttopo.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gaiageo_la-gg_rttopo.Tpo $(DEPDIR)/gaiageo_la-gg_rttopo.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='gg_rttopo.c' object='gaiageo_la-gg_rttopo.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gaiageo_la-gg_lwgeom.lo `test -f 'gg_lwgeom.c' || echo '$(srcdir)/'`gg_lwgeom.c
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gaiageo_la-gg_rttopo.lo `test -f 'gg_rttopo.c' || echo '$(srcdir)/'`gg_rttopo.c
 
 gaiageo_la-gg_extras.lo: gg_extras.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(gaiageo_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gaiageo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gaiageo_la-gg_extras.lo -MD -MP -MF $(DEPDIR)/gaiageo_la-gg_extras.Tpo -c -o gaiageo_la-gg_extras.lo `test -f 'gg_extras.c' || echo '$(srcdir)/'`gg_extras.c
diff --git a/src/gaiageo/flex/ewktLexer.l b/src/gaiageo/flex/ewktLexer.l
index 2d3e45d..c2d2009 100644
--- a/src/gaiageo/flex/ewktLexer.l
+++ b/src/gaiageo/flex/ewktLexer.l
@@ -57,7 +57,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  of the two tokens, FLEX will match POINTM.
 */
 %%
--?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*       	{ Ewktget_extra(yyscanner)->ewkt_col += (int) strlen(yytext);  Ewktget_extra(yyscanner)->EwktLval.dval = atof(yytext); return EWKT_NUM; }
+-?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*|-?[0-9]+[eE]-?[0-9]*|-?[0-9]+[eE]"+"[0-9]*|"+"?[0-9]+[eE]-?[0-9]*|"+"?[0-9]+[eE]"+"[0-9]*|-?[0-9]+"."[0-9]+[eE]-?[0-9]*|-?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]-?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]+[eE]-?[0-9]*|-?"."[0-9]+[eE]"+"?[0-9]*|"+"?"."[0-9]+[eE]-?[0-9]*|"+"?"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]*|"+"?"."[0-9]*       	{ Ewktget_extra(yyscanner)->ewkt_col += (int) strlen(yytext);  Ewktget_extra(yy [...]
 ","				{ Ewktget_extra(yyscanner)->EwktLval.dval = 0; return EWKT_COMMA; }
 "("				{ Ewktget_extra(yyscanner)->EwktLval.dval = 0; return EWKT_OPEN_BRACKET; }
 ")"				{ Ewktget_extra(yyscanner)->EwktLval.dval = 0; return EWKT_CLOSE_BRACKET; }
diff --git a/src/gaiageo/flex/geoJsonLexer.l b/src/gaiageo/flex/geoJsonLexer.l
index 27fb569..719de70 100644
--- a/src/gaiageo/flex/geoJsonLexer.l
+++ b/src/gaiageo/flex/geoJsonLexer.l
@@ -57,7 +57,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  of the two tokens, FLEX will match POINTM.
 */
 %%
--?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*      { GeoJsonget_extra(yyscanner)->geoJson_col += (int) strlen(yytext);  GeoJsonget_extra(yyscanner)->GeoJsonLval.dval = atof(yytext); return GEOJSON_NUM; }
+-?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*|-?[0-9]+[eE]-?[0-9]*|-?[0-9]+[eE]"+"[0-9]*|"+"?[0-9]+[eE]-?[0-9]*|"+"?[0-9]+[eE]"+"[0-9]*|-?[0-9]+"."[0-9]+[eE]-?[0-9]*|-?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]-?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]+[eE]-?[0-9]*|-?"."[0-9]+[eE]"+"?[0-9]*|"+"?"."[0-9]+[eE]-?[0-9]*|"+"?"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]*|"+"?"."[0-9]*      { GeoJsonget_extra(yyscanner)->geoJson_col += (int) strlen(yytext);  GeoJsonget_e [...]
 -?"\""EPSG:-?[0-9]+"\""					{ GeoJsonget_extra(yyscanner)->geoJson_col += (int) strlen(yytext);  GeoJsonget_extra(yyscanner)->GeoJsonLval.ival = atoi(yytext+6); return GEOJSON_SHORT_SRID; }
 -?"\""urn:ogc:def:crs:EPSG:-?[0-9]+"\""	{ GeoJsonget_extra(yyscanner)->geoJson_col += (int) strlen(yytext);  GeoJsonget_extra(yyscanner)->GeoJsonLval.ival = atoi(yytext+22); return GEOJSON_LONG_SRID; }
 ","					{ GeoJsonget_extra(yyscanner)->GeoJsonLval.dval = 0; return GEOJSON_COMMA; }
diff --git a/src/gaiageo/flex/gmlLexer.l b/src/gaiageo/flex/gmlLexer.l
index 6609f60..b020b11 100644
--- a/src/gaiageo/flex/gmlLexer.l
+++ b/src/gaiageo/flex/gmlLexer.l
@@ -61,7 +61,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 "="				{ gml_freeString(&(Gmlget_extra(yyscanner)->GmlLval.pval)); return GML_EQ; }
 "<"				{ gml_freeString(&(Gmlget_extra(yyscanner)->GmlLval.pval)); return GML_OPEN; }
 ">"				{ gml_freeString(&(Gmlget_extra(yyscanner)->GmlLval.pval)); return GML_CLOSE; }
-[0-9,\.\+-]*			{ gml_saveString(&(Gmlget_extra(yyscanner)->GmlLval.pval), yytext); return GML_COORD; }
+[0-9Ee,\.\+\-]*		{ gml_saveString(&(Gmlget_extra(yyscanner)->GmlLval.pval), yytext); return GML_COORD; }
 \"[^<>\"]*\"			{ gml_saveString(&(Gmlget_extra(yyscanner)->GmlLval.pval), yytext); return GML_VALUE; }
 [a-zA-Z_][a-zA-Z_:0-9]*		{ gml_saveString(&(Gmlget_extra(yyscanner)->GmlLval.pval), yytext); return GML_KEYWORD; }
 
diff --git a/src/gaiageo/flex/kmlLexer.l b/src/gaiageo/flex/kmlLexer.l
index e6e7e7e..aaa825c 100644
--- a/src/gaiageo/flex/kmlLexer.l
+++ b/src/gaiageo/flex/kmlLexer.l
@@ -61,7 +61,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 "="				{ kml_freeString(&(Kmlget_extra(yyscanner)->KmlLval.pval)); return KML_EQ; }
 "<"				{ kml_freeString(&(Kmlget_extra(yyscanner)->KmlLval.pval)); return KML_OPEN; }
 ">"				{ kml_freeString(&(Kmlget_extra(yyscanner)->KmlLval.pval)); return KML_CLOSE; }
-[0-9,\.\+-]*			{ kml_saveString(&(Kmlget_extra(yyscanner)->KmlLval.pval), yytext); return KML_COORD; }
+[0-9Ee,\.\+\-]*			{ kml_saveString(&(Kmlget_extra(yyscanner)->KmlLval.pval), yytext); return KML_COORD; }
 \"[^<>\"]*\"			{ kml_saveString(&(Kmlget_extra(yyscanner)->KmlLval.pval), yytext); return KML_VALUE; }
 [a-zA-Z_][a-zA-Z_:0-9]*		{ kml_saveString(&(Kmlget_extra(yyscanner)->KmlLval.pval), yytext); return KML_KEYWORD; }
 
diff --git a/src/gaiageo/flex/vanuatuLexer.l b/src/gaiageo/flex/vanuatuLexer.l
index b79e385..e519e09 100644
--- a/src/gaiageo/flex/vanuatuLexer.l
+++ b/src/gaiageo/flex/vanuatuLexer.l
@@ -79,7 +79,7 @@ Greg Wilson			gvwilson at cs.toronto.ca
 *  of the two tokens, FLEX will match POINT ZM.
 */
 %%
--?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*       	{ VanuatuWktget_extra(yyscanner)->vanuatu_col += (int) strlen(yytext);  VanuatuWktget_extra(yyscanner)->VanuatuWktlval.dval = atof(yytext); return VANUATU_NUM; }
+-?[0-9]+|-?[0-9]+"."[0-9]*|"+"?[0-9]+|"+"?[0-9]+"."[0-9]*|-?[0-9]+[eE]-?[0-9]*|-?[0-9]+[eE]"+"[0-9]*|"+"?[0-9]+[eE]-?[0-9]*|"+"?[0-9]+[eE]"+"[0-9]*|-?[0-9]+"."[0-9]+[eE]-?[0-9]*|-?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]-?[0-9]*|"+"?[0-9]+"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]+[eE]-?[0-9]*|-?"."[0-9]+[eE]"+"?[0-9]*|"+"?"."[0-9]+[eE]-?[0-9]*|"+"?"."[0-9]+[eE]"+"?[0-9]*|-?"."[0-9]*|"+"?"."[0-9]*      	{ VanuatuWktget_extra(yyscanner)->vanuatu_col += (int) strlen(yytext);  VanuatuW [...]
 ","					{ VanuatuWktget_extra(yyscanner)->VanuatuWktlval.dval = 0; return VANUATU_COMMA; }
 "("					{ VanuatuWktget_extra(yyscanner)->VanuatuWktlval.dval = 0; return VANUATU_OPEN_BRACKET; }
 ")"					{ VanuatuWktget_extra(yyscanner)->VanuatuWktlval.dval = 0; return VANUATU_CLOSE_BRACKET; }
diff --git a/src/gaiageo/gg_advanced.c b/src/gaiageo/gg_advanced.c
index d049afe..a0f5aee 100644
--- a/src/gaiageo/gg_advanced.c
+++ b/src/gaiageo/gg_advanced.c
@@ -1170,10 +1170,9 @@ gaiaIsToxicLinestring (gaiaLinestringPtr line)
 /* checking a Linestring */
     if (line->Points < 2)
 	return 1;
-    return 0;
 
 /* not a valid Linestring, simply a degenerated Point */
-    return 1;
+    return 0;
 }
 
 static int
diff --git a/src/gaiageo/gg_extras.c b/src/gaiageo/gg_extras.c
index ff3dd7c..d114871 100644
--- a/src/gaiageo/gg_extras.c
+++ b/src/gaiageo/gg_extras.c
@@ -60,12 +60,19 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include <spatialite/gaiageo.h>
 
 #if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(_MSC_VER) && _MSC_VER < 1800
+/*
+/ only when using an obsolete MSVC (< 2013)
+/ we need to define an internal replacement
+/ implementig C99 rint()
+*/
 static double
 rint (double x)
 {
     return floor (x + 0.5);
 }
 #endif
+#endif
 
 static void
 auxGridSnapPoint (int dimension_model, gaiaPointPtr pt, gaiaGeomCollPtr result,
diff --git a/src/gaiageo/gg_geoJSON.c b/src/gaiageo/gg_geoJSON.c
index c355314..af2297a 100644
--- a/src/gaiageo/gg_geoJSON.c
+++ b/src/gaiageo/gg_geoJSON.c
@@ -50,10 +50,16 @@ the terms of any one of the MPL, the GPL or the LGPL.
 
 #if defined(_WIN32) && !defined(__MINGW32__)
 #include "config-msvc.h"
+#include <io.h>
 #else
 #include "config.h"
 #endif
 
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define isatty	_isatty
+#define fileno	_fileno
+#endif
+
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
 
diff --git a/src/gaiageo/gg_geodesic.c b/src/gaiageo/gg_geodesic.c
index dc031ad..a17eee5 100644
--- a/src/gaiageo/gg_geodesic.c
+++ b/src/gaiageo/gg_geodesic.c
@@ -86,10 +86,6 @@ struct ellipses
     double b;			/* polar radius - meters */
 };
 
-#if defined(_WIN32) && !defined(__MINGW32__)
-#define isnan	_isnan
-#endif /* not WIN32-MSVC */
-
 GAIAGEO_DECLARE int
 gaiaEllipseParams (const char *name, double *a, double *b, double *rf)
 {
diff --git a/src/gaiageo/gg_geoscvt.c b/src/gaiageo/gg_geoscvt.c
index 0013049..0cb176c 100644
--- a/src/gaiageo/gg_geoscvt.c
+++ b/src/gaiageo/gg_geoscvt.c
@@ -890,7 +890,7 @@ toGeosGeometry (const void *cache, GEOSContextHandle_t handle,
 		      ring_points = rng->Points;
 		      if (cache != NULL)
 			{
-			    if (gaiaIsNotClosedRing_r (handle, rng))
+			    if (gaiaIsNotClosedRing_r (cache, rng))
 				ring_points++;
 			}
 #ifndef GEOS_USE_ONLY_R_API	/* obsolete versions non fully thread-safe */
diff --git a/src/gaiageo/gg_gml.c b/src/gaiageo/gg_gml.c
index 2c1ff86..6260aab 100644
--- a/src/gaiageo/gg_gml.c
+++ b/src/gaiageo/gg_gml.c
@@ -773,6 +773,8 @@ gml_check_coord (const char *value)
 {
 /* checking a GML coordinate */
     int decimal = 0;
+    int exp = 0;
+    int expsign = 0;
     const char *p = value;
     if (*p == '+' || *p == '-')
 	p++;
@@ -787,10 +789,20 @@ gml_check_coord (const char *value)
 	    }
 	  else if (*p >= '0' && *p <= '9')
 	      ;
+	  else if (*p == 'e' || *p == 'E')
+	      exp++;
+	  else if (*p == '+' || *p == '-')
+	    {
+		if (!exp)
+		    return 0;
+		expsign++;
+	    }
 	  else
 	      return 0;
 	  p++;
       }
+    if (exp > 1 || expsign > 1)
+	return 0;
     return 1;
 }
 
@@ -1676,6 +1688,107 @@ gml_parse_curve (struct gml_data *p_data, gaiaGeomCollPtr geom, gmlNodePtr node,
     return 0;
 }
 
+static int
+gml_parse_alt_ring (struct gml_data *p_data, gmlNodePtr node,
+		    int *has_z, gmlNodePtr * next, gaiaDynamicLinePtr dyn)
+{
+/* alternative Ring syntax */
+    int srid;
+    if (strcmp (node->Tag, "gml:Ring") == 0 || strcmp (node->Tag, "Ring") == 0)
+      {
+	  node = node->Next;
+	  if (node == NULL)
+	      return 0;
+	  if (strcmp (node->Tag, "gml:curveMember") == 0
+	      || strcmp (node->Tag, "curveMember") == 0)
+	      ;
+	  else
+	      return 0;
+	  node = node->Next;
+	  if (node == NULL)
+	      return 0;
+	  if (strcmp (node->Tag, "gml:Curve") == 0
+	      || strcmp (node->Tag, "Curve") == 0)
+	      srid = guessGmlSrid (node);
+	  else
+	      return 0;
+	  node = node->Next;
+	  if (node == NULL)
+	      return 0;
+	  if (strcmp (node->Tag, "gml:segments") == 0
+	      || strcmp (node->Tag, "segments") == 0)
+	    {
+		node = node->Next;
+		if (node == NULL)
+		    return 0;
+		if (strcmp (node->Tag, "gml:LineStringSegment") == 0
+		    || strcmp (node->Tag, "LineStringSegment") == 0)
+		    ;
+		else
+		    return 0;
+		node = node->Next;
+		if (node == NULL)
+		    return 0;
+		if (strcmp (node->Tag, "gml:posList") == 0
+		    || strcmp (node->Tag, "posList") == 0)
+		  {
+		      *has_z = gml_get_srsDimension (node);
+		      if (!gml_parse_posList (node->Coordinates, dyn, *has_z))
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:posList") == 0
+			  || strcmp (node->Tag, "posList") == 0)
+			  ;
+		      else
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:LineStringSegment") == 0
+			  || strcmp (node->Tag, "LineStringSegment") == 0)
+			  ;
+		      else
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:segments") == 0
+			  || strcmp (node->Tag, "segments") == 0)
+			  ;
+		      else
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:Curve") == 0
+			  || strcmp (node->Tag, "Curve") == 0)
+			  srid = guessGmlSrid (node);
+		      else
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:curveMember") == 0
+			  || strcmp (node->Tag, "curveMember") == 0)
+			  ;
+		      else
+			  return 0;
+		      node = node->Next;
+		      if (node == NULL)
+			  return 0;
+		      if (strcmp (node->Tag, "gml:Ring") == 0
+			  || strcmp (node->Tag, "Ring") == 0)
+			  *next = node;
+		      return 1;
+		  }
+
+	    }
+      }
+    return 0;
+}
+
 static gaiaDynamicLinePtr
 gml_parse_ring (struct gml_data *p_data, gmlNodePtr node, int *interior,
 		int *has_z, gmlNodePtr * next)
@@ -1853,6 +1966,18 @@ gml_parse_ring (struct gml_data *p_data, gmlNodePtr node, int *interior,
 	  if (strcmp (node->Tag, "gml:LinearRing") == 0
 	      || strcmp (node->Tag, "LinearRing") == 0)
 	      ;
+	  else if (strcmp (node->Tag, "gml:Ring") == 0
+		   || strcmp (node->Tag, "Ring") == 0)
+	    {
+		if (gml_parse_alt_ring (p_data, node, has_z, next, dyn))
+		  {
+		      *interior = 0;
+		      node = *next;
+		      goto ex_exterior;
+		  }
+		else
+		    goto error;
+	    }
 	  else
 	      goto error;
 	  node = node->Next;
@@ -1895,6 +2020,7 @@ gml_parse_ring (struct gml_data *p_data, gmlNodePtr node, int *interior,
 	      ;
 	  else
 	      goto error;
+	ex_exterior:
 	  node = node->Next;
 	  if (node == NULL)
 	      goto error;
@@ -1917,6 +2043,18 @@ gml_parse_ring (struct gml_data *p_data, gmlNodePtr node, int *interior,
 	  if (strcmp (node->Tag, "gml:LinearRing") == 0
 	      || strcmp (node->Tag, "LinearRing") == 0)
 	      ;
+	  else if (strcmp (node->Tag, "gml:Ring") == 0
+		   || strcmp (node->Tag, "Ring") == 0)
+	    {
+		if (gml_parse_alt_ring (p_data, node, has_z, next, dyn))
+		  {
+		      *interior = 1;
+		      node = *next;
+		      goto ex_interior;
+		  }
+		else
+		    goto error;
+	    }
 	  else
 	      goto error;
 	  node = node->Next;
@@ -1959,6 +2097,7 @@ gml_parse_ring (struct gml_data *p_data, gmlNodePtr node, int *interior,
 	      ;
 	  else
 	      goto error;
+	ex_interior:
 	  node = node->Next;
 	  if (node == NULL)
 	      goto error;
@@ -1987,7 +2126,7 @@ gml_parse_polygon (struct gml_data *p_data, gaiaGeomCollPtr geom,
     int has_z;
     int inners;
     int outers;
-    int points;
+    int points = 0;
     int iv;
     int ib = 0;
     gaiaGeomCollPtr pg;
@@ -1996,7 +2135,7 @@ gml_parse_polygon (struct gml_data *p_data, gaiaGeomCollPtr geom,
     gaiaRingPtr ring;
     gaiaDynamicLinePtr dyn;
     gaiaPointPtr pt;
-    gaiaDynamicLinePtr exterior_ring;
+    gaiaDynamicLinePtr exterior_ring = NULL;
     gmlNodePtr next;
     gmlDynamicRingPtr dyn_rng;
     gmlDynamicPolygonPtr dyn_pg = gml_alloc_dyn_polygon (p_data);
diff --git a/src/gaiageo/gg_kml.c b/src/gaiageo/gg_kml.c
index 99fc607..2438f67 100644
--- a/src/gaiageo/gg_kml.c
+++ b/src/gaiageo/gg_kml.c
@@ -670,6 +670,8 @@ kml_check_coord (const char *value)
 {
 /* checking a KML coordinate */
     int decimal = 0;
+    int exp = 0;
+    int expsign = 0;
     const char *p = value;
     if (*p == '+' || *p == '-')
 	p++;
@@ -684,10 +686,20 @@ kml_check_coord (const char *value)
 	    }
 	  else if (*p >= '0' && *p <= '9')
 	      ;
+	  else if (*p == 'e' || *p == 'E')
+	      exp++;
+	  else if (*p == '+' || *p == '-')
+	    {
+		if (!exp)
+		    return 0;
+		expsign++;
+	    }
 	  else
 	      return 0;
 	  p++;
       }
+    if (exp > 1 || expsign > 1)
+	return 0;
     return 1;
 }
 
@@ -1217,7 +1229,7 @@ kml_parse_polygon (struct kml_data *p_data, gaiaGeomCollPtr geom,
     int has_z;
     int inners;
     int outers;
-    int points;
+    int points = 0;
     int iv;
     int ib = 0;
     gaiaGeomCollPtr pg;
@@ -1226,7 +1238,7 @@ kml_parse_polygon (struct kml_data *p_data, gaiaGeomCollPtr geom,
     gaiaRingPtr ring;
     gaiaDynamicLinePtr dyn;
     gaiaPointPtr pt;
-    gaiaDynamicLinePtr exterior_ring;
+    gaiaDynamicLinePtr exterior_ring = NULL;
     kmlNodePtr next;
     kmlDynamicRingPtr dyn_rng;
     kmlDynamicPolygonPtr dyn_pg = kml_alloc_dyn_polygon (p_data);
@@ -1449,7 +1461,7 @@ kml_validate_geometry (struct kml_data *p_data, gaiaGeomCollPtr chain)
     int pgs = 0;
     gaiaPointPtr pt;
     gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
+    gaiaPolygonPtr pg = NULL;
     gaiaPointPtr save_pt = NULL;
     gaiaLinestringPtr save_ln = NULL;
     gaiaPolygonPtr save_pg = NULL;
diff --git a/src/gaiageo/gg_lwgeom.c b/src/gaiageo/gg_lwgeom.c
deleted file mode 100644
index 08d2d69..0000000
--- a/src/gaiageo/gg_lwgeom.c
+++ /dev/null
@@ -1,2529 +0,0 @@
-/*
-
- gg_lwgeom.c -- Gaia LWGEOM support
-    
- version 4.3, 2015 June 29
-
- Author: Sandro Furieri a.furieri at lqt.it
-
- ------------------------------------------------------------------------------
- 
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
- 
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
- 
-Software distributed under the License is distributed on an "AS IS" basis,
-WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-for the specific language governing rights and limitations under the
-License.
-
-The Original Code is the SpatiaLite library
-
-The Initial Developer of the Original Code is Alessandro Furieri
- 
-Portions created by the Initial Developer are Copyright (C) 2012-2015
-the Initial Developer. All Rights Reserved.
-
-Contributor(s):
-
-Alternatively, the contents of this file may be used under the terms of
-either the GNU General Public License Version 2 or later (the "GPL"), or
-the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-in which case the provisions of the GPL or the LGPL are applicable instead
-of those above. If you wish to allow use of your version of this file only
-under the terms of either the GPL or the LGPL, and not to allow others to
-use your version of this file under the terms of the MPL, indicate your
-decision by deleting the provisions above and replace them with the notice
-and other provisions required by the GPL or the LGPL. If you do not delete
-the provisions above, a recipient may use your version of this file under
-the terms of any one of the MPL, the GPL or the LGPL.
- 
-*/
-
-/*
- 
-CREDITS:
-
-this module (wrapping liblwgeom APIs) has been entierely funded by:
-Regione Toscana - Settore Sistema Informativo Territoriale ed Ambientale
-
-*/
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <float.h>
-
-#if defined(_WIN32) && !defined(__MINGW32__)
-#include "config-msvc.h"
-#else
-#include "config.h"
-#endif
-
-#include <spatialite_private.h>
-#include <spatialite/sqlite.h>
-#include <spatialite.h>
-#include <spatialite/debug.h>
-
-#include <spatialite/gaiageo.h>
-
-#ifdef ENABLE_LWGEOM		/* enabling LWGEOM support */
-
-#include <liblwgeom.h>
-
-/* GLOBAL variables */
-char *gaia_lwgeom_error_msg = NULL;
-char *gaia_lwgeom_warning_msg = NULL;
-
-const char splitelwgeomversion[] = LIBLWGEOM_VERSION;
-
-SPATIALITE_PRIVATE const char *
-splite_lwgeom_version (void)
-{
-    return splitelwgeomversion;
-}
-
-static void
-lwgaia_noticereporter (const char *fmt, va_list ap)
-{
-    char *msg = sqlite3_vmprintf (fmt, ap);
-    if (msg == NULL)
-      {
-	  va_end (ap);
-	  return;
-      }
-    if (strlen (msg) > 1)
-	spatialite_e ("LWGEOM notice: %s\n", msg);
-    gaiaSetLwGeomWarningMsg (msg);
-    sqlite3_free (msg);
-}
-
-static void
-lwgaiatopo_noticereporter (const char *fmt, va_list ap)
-{
-    char *msg = sqlite3_vmprintf (fmt, ap);
-    if (msg == NULL)
-      {
-	  va_end (ap);
-	  return;
-      }
-    if (strlen (msg) > 1)
-	spatialite_e ("LWGEOM notice: %s\n", msg);
-    gaiaSetLwGeomWarningMsg (msg);
-    sqlite3_free (msg);
-}
-
-static void
-lwgaia_errorreporter (const char *fmt, va_list ap)
-{
-    char *msg = sqlite3_vmprintf (fmt, ap);
-    if (msg == NULL)
-      {
-	  va_end (ap);
-	  return;
-      }
-    if (strlen (msg) > 1)
-	spatialite_e ("LWGEOM error: %s\n", msg);
-    gaiaSetLwGeomErrorMsg (msg);
-    sqlite3_free (msg);
-}
-
-static void
-lwgaiatopo_errorreporter (const char *fmt, va_list ap)
-{
-    char *msg = sqlite3_vmprintf (fmt, ap);
-    if (msg == NULL)
-      {
-	  va_end (ap);
-	  return;
-      }
-    if (strlen (msg) > 1)
-	gaiaSetLwGeomErrorMsg (msg);
-    sqlite3_free (msg);
-}
-
-#ifndef POSTGIS_2_1
-/* liblwgeom initializion function: required by PostGIS 2.0.x */
-void
-lwgeom_init_allocators (void)
-{
-/* Set up liblwgeom to run in stand-alone mode using the
-* usual system memory handling functions. */
-    lwalloc_var = default_allocator;
-    lwrealloc_var = default_reallocator;
-    lwfree_var = default_freeor;
-    lwnotice_var = lwgaia_noticereporter;
-    lwerror_var = lwgaia_errorreporter;
-}
-#else
-/* liblwgeom initialization function: required by PostGIS 2.1.x */
-SPATIALITE_PRIVATE void
-splite_lwgeom_init (void)
-{
-    lwgeom_set_handlers (NULL, NULL, NULL, lwgaia_errorreporter,
-			 lwgaia_noticereporter);
-}
-
-SPATIALITE_PRIVATE void
-splite_lwgeomtopo_init (void)
-{
-    lwgeom_set_handlers (NULL, NULL, NULL, lwgaiatopo_errorreporter,
-			 lwgaiatopo_noticereporter);
-}
-#endif
-
-GAIAGEO_DECLARE void
-gaiaResetLwGeomMsg ()
-{
-/* resets the LWGEOM error and warning messages */
-    if (gaia_lwgeom_error_msg != NULL)
-	free (gaia_lwgeom_error_msg);
-    if (gaia_lwgeom_warning_msg != NULL)
-	free (gaia_lwgeom_warning_msg);
-    gaia_lwgeom_error_msg = NULL;
-    gaia_lwgeom_warning_msg = NULL;
-}
-
-GAIAGEO_DECLARE const char *
-gaiaGetLwGeomErrorMsg ()
-{
-/* setting the latest LWGEOM error message */
-    return gaia_lwgeom_error_msg;
-}
-
-GAIAGEO_DECLARE const char *
-gaiaGetLwGeomWarningMsg ()
-{
-/* return the latest LWGEOM error message */
-    return gaia_lwgeom_warning_msg;
-}
-
-GAIAGEO_DECLARE void
-gaiaSetLwGeomErrorMsg (const char *msg)
-{
-/* setting the latest LWGEOM error message */
-    int len;
-    if (gaia_lwgeom_error_msg != NULL)
-	free (gaia_lwgeom_error_msg);
-    gaia_lwgeom_error_msg = NULL;
-    if (msg == NULL)
-	return;
-    len = strlen (msg);
-    gaia_lwgeom_error_msg = malloc (len + 1);
-    strcpy (gaia_lwgeom_error_msg, msg);
-}
-
-GAIAGEO_DECLARE void
-gaiaSetLwGeomWarningMsg (const char *msg)
-{
-/* return the latest LWGEOM error message */
-    int len;
-    if (gaia_lwgeom_warning_msg != NULL)
-	free (gaia_lwgeom_warning_msg);
-    gaia_lwgeom_warning_msg = NULL;
-    if (msg == NULL)
-	return;
-    len = strlen (msg);
-    gaia_lwgeom_warning_msg = malloc (len + 1);
-    strcpy (gaia_lwgeom_warning_msg, msg);
-}
-
-static int
-check_unclosed_ring (gaiaRingPtr rng)
-{
-/* checks if a Ring is closed or not */
-    double x0;
-    double y0;
-    double z0 = 0.0;
-    double m0 = 0.0;
-    double x1;
-    double y1;
-    double z1 = 0.0;
-    double m1 = 0.0;
-    int last = rng->Points - 1;
-    if (rng->DimensionModel == GAIA_XY_Z)
-      {
-	  gaiaGetPointXYZ (rng->Coords, 0, &x0, &y0, &z0);
-      }
-    else if (rng->DimensionModel == GAIA_XY_M)
-      {
-	  gaiaGetPointXYM (rng->Coords, 0, &x0, &y0, &m0);
-      }
-    else if (rng->DimensionModel == GAIA_XY_Z_M)
-      {
-	  gaiaGetPointXYZM (rng->Coords, 0, &x0, &y0, &z0, &m0);
-      }
-    else
-      {
-	  gaiaGetPoint (rng->Coords, 0, &x0, &y0);
-      }
-    if (rng->DimensionModel == GAIA_XY_Z)
-      {
-	  gaiaGetPointXYZ (rng->Coords, last, &x1, &y1, &z1);
-      }
-    else if (rng->DimensionModel == GAIA_XY_M)
-      {
-	  gaiaGetPointXYM (rng->Coords, last, &x1, &y1, &m1);
-      }
-    else if (rng->DimensionModel == GAIA_XY_Z_M)
-      {
-	  gaiaGetPointXYZM (rng->Coords, last, &x1, &y1, &z1, &m1);
-      }
-    else
-      {
-	  gaiaGetPoint (rng->Coords, last, &x1, &y1);
-      }
-    if (x0 == x1 && y0 == y1 && z0 == z1 && m0 == m1)
-	return 0;
-    return 1;
-}
-
-static LWGEOM *
-toLWGeom (const gaiaGeomCollPtr gaia)
-{
-/* converting a GAIA Geometry into a LWGEOM Geometry */
-    int pts = 0;
-    int lns = 0;
-    int pgs = 0;
-    int has_z;
-    int has_m;
-    int ngeoms;
-    int numg;
-    int ib;
-    int iv;
-    int type;
-    double x = 0.0;
-    double y = 0.0;
-    double z = 0.0;
-    double m = 0.0;
-    int close_ring;
-    gaiaPointPtr pt;
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-    gaiaRingPtr rng;
-    POINTARRAY *pa;
-    POINTARRAY **ppaa;
-    POINT4D point;
-    LWGEOM **geoms;
-
-    if (!gaia)
-	return NULL;
-    pt = gaia->FirstPoint;
-    while (pt)
-      {
-	  /* counting how many POINTs are there */
-	  pts++;
-	  pt = pt->Next;
-      }
-    ln = gaia->FirstLinestring;
-    while (ln)
-      {
-	  /* counting how many LINESTRINGs are there */
-	  lns++;
-	  ln = ln->Next;
-      }
-    pg = gaia->FirstPolygon;
-    while (pg)
-      {
-	  /* counting how many POLYGONs are there */
-	  pgs++;
-	  pg = pg->Next;
-      }
-    if (pts == 0 && lns == 0 && pgs == 0)
-	return NULL;
-
-    if (pts == 1 && lns == 0 && pgs == 0)
-      {
-	  /* single Point */
-	  pt = gaia->FirstPoint;
-	  has_z = 0;
-	  has_m = 0;
-	  if (gaia->DimensionModel == GAIA_XY_Z
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_z = 1;
-	  if (gaia->DimensionModel == GAIA_XY_M
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_m = 1;
-	  pa = ptarray_construct (has_z, has_m, 1);
-	  point.x = pt->X;
-	  point.y = pt->Y;
-	  if (has_z)
-	      point.z = pt->Z;
-	  if (has_m)
-	      point.m = pt->M;
-	  ptarray_set_point4d (pa, 0, &point);
-	  return (LWGEOM *) lwpoint_construct (gaia->Srid, NULL, pa);
-      }
-    else if (pts == 0 && lns == 1 && pgs == 0)
-      {
-	  /* single Linestring */
-	  ln = gaia->FirstLinestring;
-	  has_z = 0;
-	  has_m = 0;
-	  if (gaia->DimensionModel == GAIA_XY_Z
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_z = 1;
-	  if (gaia->DimensionModel == GAIA_XY_M
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_m = 1;
-	  pa = ptarray_construct (has_z, has_m, ln->Points);
-	  for (iv = 0; iv < ln->Points; iv++)
-	    {
-		/* copying vertices */
-		if (gaia->DimensionModel == GAIA_XY_Z)
-		  {
-		      gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_M)
-		  {
-		      gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_Z_M)
-		  {
-		      gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
-		  }
-		else
-		  {
-		      gaiaGetPoint (ln->Coords, iv, &x, &y);
-		  }
-		point.x = x;
-		point.y = y;
-		if (has_z)
-		    point.z = z;
-		if (has_m)
-		    point.m = m;
-		ptarray_set_point4d (pa, iv, &point);
-	    }
-	  return (LWGEOM *) lwline_construct (gaia->Srid, NULL, pa);
-      }
-    else if (pts == 0 && lns == 0 && pgs == 1)
-      {
-	  /* single Polygon */
-	  pg = gaia->FirstPolygon;
-	  has_z = 0;
-	  has_m = 0;
-	  if (gaia->DimensionModel == GAIA_XY_Z
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_z = 1;
-	  if (gaia->DimensionModel == GAIA_XY_M
-	      || gaia->DimensionModel == GAIA_XY_Z_M)
-	      has_m = 1;
-	  ngeoms = pg->NumInteriors;
-	  ppaa = lwalloc (sizeof (POINTARRAY *) * (ngeoms + 1));
-	  rng = pg->Exterior;
-	  close_ring = check_unclosed_ring (rng);
-	  if (close_ring)
-	      ppaa[0] = ptarray_construct (has_z, has_m, rng->Points + 1);
-	  else
-	      ppaa[0] = ptarray_construct (has_z, has_m, rng->Points);
-	  for (iv = 0; iv < rng->Points; iv++)
-	    {
-		/* copying vertices - Exterior Ring */
-		if (gaia->DimensionModel == GAIA_XY_Z)
-		  {
-		      gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_M)
-		  {
-		      gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_Z_M)
-		  {
-		      gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
-		  }
-		else
-		  {
-		      gaiaGetPoint (rng->Coords, iv, &x, &y);
-		  }
-		point.x = x;
-		point.y = y;
-		if (has_z)
-		    point.z = z;
-		if (has_m)
-		    point.m = m;
-		ptarray_set_point4d (ppaa[0], iv, &point);
-	    }
-	  if (close_ring)
-	    {
-		/* making an unclosed ring to be closed */
-		if (gaia->DimensionModel == GAIA_XY_Z)
-		  {
-		      gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_M)
-		  {
-		      gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-		  }
-		else if (gaia->DimensionModel == GAIA_XY_Z_M)
-		  {
-		      gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
-		  }
-		else
-		  {
-		      gaiaGetPoint (rng->Coords, 0, &x, &y);
-		  }
-		point.x = x;
-		point.y = y;
-		if (has_z)
-		    point.z = z;
-		if (has_m)
-		    point.m = m;
-		ptarray_set_point4d (ppaa[0], rng->Points, &point);
-	    }
-	  for (ib = 0; ib < pg->NumInteriors; ib++)
-	    {
-		/* copying vertices - Interior Rings */
-		rng = pg->Interiors + ib;
-		close_ring = check_unclosed_ring (rng);
-		if (close_ring)
-		    ppaa[1 + ib] =
-			ptarray_construct (has_z, has_m, rng->Points + 1);
-		else
-		    ppaa[1 + ib] =
-			ptarray_construct (has_z, has_m, rng->Points);
-		for (iv = 0; iv < rng->Points; iv++)
-		  {
-		      if (gaia->DimensionModel == GAIA_XY_Z)
-			{
-			    gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_M)
-			{
-			    gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			{
-			    gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
-			}
-		      else
-			{
-			    gaiaGetPoint (rng->Coords, iv, &x, &y);
-			}
-		      point.x = x;
-		      point.y = y;
-		      if (has_z)
-			  point.z = z;
-		      if (has_m)
-			  point.m = m;
-		      ptarray_set_point4d (ppaa[1 + ib], iv, &point);
-		  }
-		if (close_ring)
-		  {
-		      /* making an unclosed ring to be closed */
-		      if (gaia->DimensionModel == GAIA_XY_Z)
-			{
-			    gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_M)
-			{
-			    gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			{
-			    gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
-			}
-		      else
-			{
-			    gaiaGetPoint (rng->Coords, 0, &x, &y);
-			}
-		      point.x = x;
-		      point.y = y;
-		      if (has_z)
-			  point.z = z;
-		      if (has_m)
-			  point.m = m;
-		      ptarray_set_point4d (ppaa[1 + ib], rng->Points, &point);
-		  }
-	    }
-	  return (LWGEOM *) lwpoly_construct (gaia->Srid, NULL, ngeoms + 1,
-					      ppaa);
-      }
-    else
-      {
-	  /* some Collection */
-	  switch (gaia->DeclaredType)
-	    {
-	    case GAIA_POINT:
-		type = POINTTYPE;
-		break;
-	    case GAIA_LINESTRING:
-		type = LINETYPE;
-		break;
-	    case GAIA_POLYGON:
-		type = POLYGONTYPE;
-		break;
-	    case GAIA_MULTIPOINT:
-		type = MULTIPOINTTYPE;
-		break;
-	    case GAIA_MULTILINESTRING:
-		type = MULTILINETYPE;
-		break;
-	    case GAIA_MULTIPOLYGON:
-		type = MULTIPOLYGONTYPE;
-		break;
-	    case GAIA_GEOMETRYCOLLECTION:
-		type = COLLECTIONTYPE;
-		break;
-	    default:
-		if (lns == 0 && pgs == 0)
-		    type = MULTIPOINTTYPE;
-		else if (pts == 0 && pgs == 0)
-		    type = MULTILINETYPE;
-		else if (pts == 0 && lns == 0)
-		    type = MULTIPOLYGONTYPE;
-		else
-		    type = COLLECTIONTYPE;
-		break;
-	    };
-	  numg = pts + lns + pgs;
-	  geoms = lwalloc (sizeof (LWGEOM *) * numg);
-
-	  numg = 0;
-	  pt = gaia->FirstPoint;
-	  while (pt)
-	    {
-		/* copying POINTs */
-		has_z = 0;
-		has_m = 0;
-		if (gaia->DimensionModel == GAIA_XY_Z
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_z = 1;
-		if (gaia->DimensionModel == GAIA_XY_M
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_m = 1;
-		pa = ptarray_construct (has_z, has_m, 1);
-		point.x = pt->X;
-		point.y = pt->Y;
-		if (has_z)
-		    point.z = pt->Z;
-		if (has_m)
-		    point.m = pt->M;
-		ptarray_set_point4d (pa, 0, &point);
-		geoms[numg++] =
-		    (LWGEOM *) lwpoint_construct (gaia->Srid, NULL, pa);
-		pt = pt->Next;
-	    }
-	  ln = gaia->FirstLinestring;
-	  while (ln)
-	    {
-		/* copying LINESTRINGs */
-		has_z = 0;
-		has_m = 0;
-		if (gaia->DimensionModel == GAIA_XY_Z
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_z = 1;
-		if (gaia->DimensionModel == GAIA_XY_M
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_m = 1;
-		pa = ptarray_construct (has_z, has_m, ln->Points);
-		for (iv = 0; iv < ln->Points; iv++)
-		  {
-		      /* copying vertices */
-		      if (gaia->DimensionModel == GAIA_XY_Z)
-			{
-			    gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_M)
-			{
-			    gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			{
-			    gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
-			}
-		      else
-			{
-			    gaiaGetPoint (ln->Coords, iv, &x, &y);
-			}
-		      point.x = x;
-		      point.y = y;
-		      if (has_z)
-			  point.z = z;
-		      if (has_m)
-			  point.m = m;
-		      ptarray_set_point4d (pa, iv, &point);
-		  }
-		geoms[numg++] =
-		    (LWGEOM *) lwline_construct (gaia->Srid, NULL, pa);
-		ln = ln->Next;
-	    }
-	  pg = gaia->FirstPolygon;
-	  while (pg)
-	    {
-		/* copying POLYGONs */
-		has_z = 0;
-		has_m = 0;
-		if (gaia->DimensionModel == GAIA_XY_Z
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_z = 1;
-		if (gaia->DimensionModel == GAIA_XY_M
-		    || gaia->DimensionModel == GAIA_XY_Z_M)
-		    has_m = 1;
-		ngeoms = pg->NumInteriors;
-		ppaa = lwalloc (sizeof (POINTARRAY *) * (ngeoms + 1));
-		rng = pg->Exterior;
-		close_ring = check_unclosed_ring (rng);
-		if (close_ring)
-		    ppaa[0] = ptarray_construct (has_z, has_m, rng->Points + 1);
-		else
-		    ppaa[0] = ptarray_construct (has_z, has_m, rng->Points);
-		for (iv = 0; iv < rng->Points; iv++)
-		  {
-		      /* copying vertices - Exterior Ring */
-		      if (gaia->DimensionModel == GAIA_XY_Z)
-			{
-			    gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_M)
-			{
-			    gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			{
-			    gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
-			}
-		      else
-			{
-			    gaiaGetPoint (rng->Coords, iv, &x, &y);
-			}
-		      point.x = x;
-		      point.y = y;
-		      if (has_z)
-			  point.z = z;
-		      if (has_m)
-			  point.m = m;
-		      ptarray_set_point4d (ppaa[0], iv, &point);
-		  }
-		if (close_ring)
-		  {
-		      /* making an unclosed ring to be closed */
-		      if (gaia->DimensionModel == GAIA_XY_Z)
-			{
-			    gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_M)
-			{
-			    gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-			}
-		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			{
-			    gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
-			}
-		      else
-			{
-			    gaiaGetPoint (rng->Coords, 0, &x, &y);
-			}
-		      point.x = x;
-		      point.y = y;
-		      if (has_z)
-			  point.z = z;
-		      if (has_m)
-			  point.m = m;
-		      ptarray_set_point4d (ppaa[0], rng->Points, &point);
-		  }
-		for (ib = 0; ib < pg->NumInteriors; ib++)
-		  {
-		      /* copying vertices - Interior Rings */
-		      rng = pg->Interiors + ib;
-		      close_ring = check_unclosed_ring (rng);
-		      if (close_ring)
-			  ppaa[1 + ib] =
-			      ptarray_construct (has_z, has_m, rng->Points + 1);
-		      else
-			  ppaa[1 + ib] =
-			      ptarray_construct (has_z, has_m, rng->Points);
-		      for (iv = 0; iv < rng->Points; iv++)
-			{
-			    if (gaia->DimensionModel == GAIA_XY_Z)
-			      {
-				  gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-			      }
-			    else if (gaia->DimensionModel == GAIA_XY_M)
-			      {
-				  gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-			      }
-			    else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			      {
-				  gaiaGetPointXYZM (rng->Coords, iv, &x, &y,
-						    &z, &m);
-			      }
-			    else
-			      {
-				  gaiaGetPoint (rng->Coords, iv, &x, &y);
-			      }
-			    point.x = x;
-			    point.y = y;
-			    if (has_z)
-				point.z = z;
-			    if (has_m)
-				point.m = m;
-			    ptarray_set_point4d (ppaa[1 + ib], iv, &point);
-			}
-		      if (close_ring)
-			{
-			    /* making an unclosed ring to be closed */
-			    if (gaia->DimensionModel == GAIA_XY_Z)
-			      {
-				  gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-			      }
-			    else if (gaia->DimensionModel == GAIA_XY_M)
-			      {
-				  gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-			      }
-			    else if (gaia->DimensionModel == GAIA_XY_Z_M)
-			      {
-				  gaiaGetPointXYZM (rng->Coords, 0, &x, &y,
-						    &z, &m);
-			      }
-			    else
-			      {
-				  gaiaGetPoint (rng->Coords, 0, &x, &y);
-			      }
-			    point.x = x;
-			    point.y = y;
-			    if (has_z)
-				point.z = z;
-			    if (has_m)
-				point.m = m;
-			    ptarray_set_point4d (ppaa[1 + ib], rng->Points,
-						 &point);
-			}
-		  }
-		geoms[numg++] =
-		    (LWGEOM *) lwpoly_construct (gaia->Srid, NULL, ngeoms + 1,
-						 ppaa);
-		pg = pg->Next;
-	    }
-	  return (LWGEOM *) lwcollection_construct (type, gaia->Srid, NULL,
-						    numg, geoms);
-      }
-    return NULL;
-}
-
-static gaiaGeomCollPtr
-fromLWGeomIncremental (gaiaGeomCollPtr gaia, const LWGEOM * lwgeom)
-{
-/* converting a LWGEOM Geometry into a GAIA Geometry */
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-    gaiaRingPtr rng;
-    int dimension_model = gaia->DimensionModel;
-    int declared_type = gaia->DeclaredType;
-    LWGEOM *lwg2 = NULL;
-    LWPOINT *lwp = NULL;
-    LWLINE *lwl = NULL;
-    LWPOLY *lwpoly = NULL;
-    LWCOLLECTION *lwc = NULL;
-    POINTARRAY *pa;
-    POINT4D pt4d;
-    int has_z;
-    int has_m;
-    int iv;
-    int ib;
-    int ngeoms;
-    int ng;
-    double x;
-    double y;
-    double z;
-    double m;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    switch (lwgeom->type)
-      {
-      case POINTTYPE:
-	  lwp = (LWPOINT *) lwgeom;
-	  has_z = 0;
-	  has_m = 0;
-	  pa = lwp->point;
-	  if (FLAGS_GET_Z (pa->flags))
-	      has_z = 1;
-	  if (FLAGS_GET_M (pa->flags))
-	      has_m = 1;
-	  getPoint4d_p (pa, 0, &pt4d);
-	  x = pt4d.x;
-	  y = pt4d.y;
-	  if (has_z)
-	      z = pt4d.z;
-	  else
-	      z = 0.0;
-	  if (has_m)
-	      m = pt4d.m;
-	  else
-	      m = 0.0;
-	  if (dimension_model == GAIA_XY_Z)
-	      gaiaAddPointToGeomCollXYZ (gaia, x, y, z);
-	  else if (dimension_model == GAIA_XY_M)
-	      gaiaAddPointToGeomCollXYM (gaia, x, y, m);
-	  else if (dimension_model == GAIA_XY_Z_M)
-	      gaiaAddPointToGeomCollXYZM (gaia, x, y, z, m);
-	  else
-	      gaiaAddPointToGeomColl (gaia, x, y);
-	  if (declared_type == GAIA_MULTIPOINT)
-	      gaia->DeclaredType = GAIA_MULTIPOINT;
-	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
-	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-	  else
-	      gaia->DeclaredType = GAIA_POINT;
-	  break;
-      case LINETYPE:
-	  lwl = (LWLINE *) lwgeom;
-	  has_z = 0;
-	  has_m = 0;
-	  pa = lwl->points;
-	  if (FLAGS_GET_Z (pa->flags))
-	      has_z = 1;
-	  if (FLAGS_GET_M (pa->flags))
-	      has_m = 1;
-	  ln = gaiaAddLinestringToGeomColl (gaia, pa->npoints);
-	  for (iv = 0; iv < pa->npoints; iv++)
-	    {
-		/* copying LINESTRING vertices */
-		getPoint4d_p (pa, iv, &pt4d);
-		x = pt4d.x;
-		y = pt4d.y;
-		if (has_z)
-		    z = pt4d.z;
-		else
-		    z = 0.0;
-		if (has_m)
-		    m = pt4d.m;
-		else
-		    m = 0.0;
-		if (dimension_model == GAIA_XY_Z)
-		  {
-		      gaiaSetPointXYZ (ln->Coords, iv, x, y, z);
-		  }
-		else if (dimension_model == GAIA_XY_M)
-		  {
-		      gaiaSetPointXYM (ln->Coords, iv, x, y, m);
-		  }
-		else if (dimension_model == GAIA_XY_Z_M)
-		  {
-		      gaiaSetPointXYZM (ln->Coords, iv, x, y, z, m);
-		  }
-		else
-		  {
-		      gaiaSetPoint (ln->Coords, iv, x, y);
-		  }
-	    }
-	  if (declared_type == GAIA_MULTILINESTRING)
-	      gaia->DeclaredType = GAIA_MULTILINESTRING;
-	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
-	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-	  else
-	      gaia->DeclaredType = GAIA_LINESTRING;
-	  break;
-      case POLYGONTYPE:
-	  lwpoly = (LWPOLY *) lwgeom;
-	  has_z = 0;
-	  has_m = 0;
-	  pa = lwpoly->rings[0];
-	  if (FLAGS_GET_Z (pa->flags))
-	      has_z = 1;
-	  if (FLAGS_GET_M (pa->flags))
-	      has_m = 1;
-	  pg = gaiaAddPolygonToGeomColl (gaia, pa->npoints, lwpoly->nrings - 1);
-	  rng = pg->Exterior;
-	  for (iv = 0; iv < pa->npoints; iv++)
-	    {
-		/* copying Exterion Ring vertices */
-		getPoint4d_p (pa, iv, &pt4d);
-		x = pt4d.x;
-		y = pt4d.y;
-		if (has_z)
-		    z = pt4d.z;
-		else
-		    z = 0.0;
-		if (has_m)
-		    m = pt4d.m;
-		else
-		    m = 0.0;
-		if (dimension_model == GAIA_XY_Z)
-		  {
-		      gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
-		  }
-		else if (dimension_model == GAIA_XY_M)
-		  {
-		      gaiaSetPointXYM (rng->Coords, iv, x, y, m);
-		  }
-		else if (dimension_model == GAIA_XY_Z_M)
-		  {
-		      gaiaSetPointXYZM (rng->Coords, iv, x, y, z, m);
-		  }
-		else
-		  {
-		      gaiaSetPoint (rng->Coords, iv, x, y);
-		  }
-	    }
-	  for (ib = 1; ib < lwpoly->nrings; ib++)
-	    {
-		has_z = 0;
-		has_m = 0;
-		pa = lwpoly->rings[ib];
-		if (FLAGS_GET_Z (pa->flags))
-		    has_z = 1;
-		if (FLAGS_GET_M (pa->flags))
-		    has_m = 1;
-		rng = gaiaAddInteriorRing (pg, ib - 1, pa->npoints);
-		for (iv = 0; iv < pa->npoints; iv++)
-		  {
-		      /* copying Exterion Ring vertices */
-		      getPoint4d_p (pa, iv, &pt4d);
-		      x = pt4d.x;
-		      y = pt4d.y;
-		      if (has_z)
-			  z = pt4d.z;
-		      else
-			  z = 0.0;
-		      if (has_m)
-			  m = pt4d.m;
-		      else
-			  m = 0.0;
-		      if (dimension_model == GAIA_XY_Z)
-			{
-			    gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
-			}
-		      else if (dimension_model == GAIA_XY_M)
-			{
-			    gaiaSetPointXYM (rng->Coords, iv, x, y, m);
-			}
-		      else if (dimension_model == GAIA_XY_Z_M)
-			{
-			    gaiaSetPointXYZM (rng->Coords, iv, x, y, z, m);
-			}
-		      else
-			{
-			    gaiaSetPoint (rng->Coords, iv, x, y);
-			}
-		  }
-	    }
-	  if (declared_type == GAIA_MULTIPOLYGON)
-	      gaia->DeclaredType = GAIA_MULTIPOLYGON;
-	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
-	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-	  else
-	      gaia->DeclaredType = GAIA_POLYGON;
-	  break;
-      case MULTIPOINTTYPE:
-      case MULTILINETYPE:
-      case MULTIPOLYGONTYPE:
-      case COLLECTIONTYPE:
-	  if (lwgeom->type == MULTIPOINTTYPE)
-	    {
-		if (declared_type == GAIA_GEOMETRYCOLLECTION)
-		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-		else
-		    gaia->DeclaredType = GAIA_MULTIPOINT;
-	    }
-	  else if (lwgeom->type == MULTILINETYPE)
-	    {
-		if (declared_type == GAIA_GEOMETRYCOLLECTION)
-		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-		else
-		    gaia->DeclaredType = GAIA_MULTILINESTRING;
-	    }
-	  else if (lwgeom->type == MULTIPOLYGONTYPE)
-	    {
-		if (declared_type == GAIA_GEOMETRYCOLLECTION)
-		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-		else
-		    gaia->DeclaredType = GAIA_MULTIPOLYGON;
-	    }
-	  else
-	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-
-	  lwc = (LWCOLLECTION *) lwgeom;
-	  ngeoms = lwc->ngeoms;
-	  if (ngeoms == 0)
-	    {
-		gaiaFreeGeomColl (gaia);
-		gaia = NULL;
-		break;
-	    }
-	  for (ng = 0; ng < ngeoms; ++ng)
-	    {
-		/* looping on elementary geometries */
-		lwg2 = lwc->geoms[ng];
-		switch (lwg2->type)
-		  {
-		  case POINTTYPE:
-		      lwp = (LWPOINT *) lwg2;
-		      has_z = 0;
-		      has_m = 0;
-		      pa = lwp->point;
-		      if (FLAGS_GET_Z (pa->flags))
-			  has_z = 1;
-		      if (FLAGS_GET_M (pa->flags))
-			  has_m = 1;
-		      getPoint4d_p (pa, 0, &pt4d);
-		      x = pt4d.x;
-		      y = pt4d.y;
-		      if (has_z)
-			  z = pt4d.z;
-		      else
-			  z = 0.0;
-		      if (has_m)
-			  m = pt4d.m;
-		      else
-			  m = 0.0;
-		      if (dimension_model == GAIA_XY_Z)
-			  gaiaAddPointToGeomCollXYZ (gaia, x, y, z);
-		      else if (dimension_model == GAIA_XY_M)
-			  gaiaAddPointToGeomCollXYM (gaia, x, y, m);
-		      else if (dimension_model == GAIA_XY_Z_M)
-			  gaiaAddPointToGeomCollXYZM (gaia, x, y, z, m);
-		      else
-			  gaiaAddPointToGeomColl (gaia, x, y);
-		      break;
-		  case LINETYPE:
-		      lwl = (LWLINE *) lwg2;
-		      has_z = 0;
-		      has_m = 0;
-		      pa = lwl->points;
-		      if (FLAGS_GET_Z (pa->flags))
-			  has_z = 1;
-		      if (FLAGS_GET_M (pa->flags))
-			  has_m = 1;
-		      ln = gaiaAddLinestringToGeomColl (gaia, pa->npoints);
-		      for (iv = 0; iv < pa->npoints; iv++)
-			{
-			    /* copying LINESTRING vertices */
-			    getPoint4d_p (pa, iv, &pt4d);
-			    x = pt4d.x;
-			    y = pt4d.y;
-			    if (has_z)
-				z = pt4d.z;
-			    else
-				z = 0.0;
-			    if (has_m)
-				m = pt4d.m;
-			    else
-				m = 0.0;
-			    if (dimension_model == GAIA_XY_Z)
-			      {
-				  gaiaSetPointXYZ (ln->Coords, iv, x, y, z);
-			      }
-			    else if (dimension_model == GAIA_XY_M)
-			      {
-				  gaiaSetPointXYM (ln->Coords, iv, x, y, m);
-			      }
-			    else if (dimension_model == GAIA_XY_Z_M)
-			      {
-				  gaiaSetPointXYZM (ln->Coords, iv, x, y, z, m);
-			      }
-			    else
-			      {
-				  gaiaSetPoint (ln->Coords, iv, x, y);
-			      }
-			}
-		      break;
-		  case POLYGONTYPE:
-		      lwpoly = (LWPOLY *) lwg2;
-		      has_z = 0;
-		      has_m = 0;
-		      pa = lwpoly->rings[0];
-		      if (FLAGS_GET_Z (pa->flags))
-			  has_z = 1;
-		      if (FLAGS_GET_M (pa->flags))
-			  has_m = 1;
-		      pg = gaiaAddPolygonToGeomColl (gaia, pa->npoints,
-						     lwpoly->nrings - 1);
-		      rng = pg->Exterior;
-		      for (iv = 0; iv < pa->npoints; iv++)
-			{
-			    /* copying Exterion Ring vertices */
-			    getPoint4d_p (pa, iv, &pt4d);
-			    x = pt4d.x;
-			    y = pt4d.y;
-			    if (has_z)
-				z = pt4d.z;
-			    else
-				z = 0.0;
-			    if (has_m)
-				m = pt4d.m;
-			    else
-				m = 0.0;
-			    if (dimension_model == GAIA_XY_Z)
-			      {
-				  gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
-			      }
-			    else if (dimension_model == GAIA_XY_M)
-			      {
-				  gaiaSetPointXYM (rng->Coords, iv, x, y, m);
-			      }
-			    else if (dimension_model == GAIA_XY_Z_M)
-			      {
-				  gaiaSetPointXYZM (rng->Coords, iv, x, y, z,
-						    m);
-			      }
-			    else
-			      {
-				  gaiaSetPoint (rng->Coords, iv, x, y);
-			      }
-			}
-		      for (ib = 1; ib < lwpoly->nrings; ib++)
-			{
-			    has_z = 0;
-			    has_m = 0;
-			    pa = lwpoly->rings[ib];
-			    if (FLAGS_GET_Z (pa->flags))
-				has_z = 1;
-			    if (FLAGS_GET_M (pa->flags))
-				has_m = 1;
-			    rng = gaiaAddInteriorRing (pg, ib - 1, pa->npoints);
-			    for (iv = 0; iv < pa->npoints; iv++)
-			      {
-				  /* copying Exterion Ring vertices */
-				  getPoint4d_p (pa, iv, &pt4d);
-				  x = pt4d.x;
-				  y = pt4d.y;
-				  if (has_z)
-				      z = pt4d.z;
-				  else
-				      z = 0.0;
-				  if (has_m)
-				      m = pt4d.m;
-				  else
-				      m = 0.0;
-				  if (dimension_model == GAIA_XY_Z)
-				    {
-					gaiaSetPointXYZ (rng->Coords, iv, x,
-							 y, z);
-				    }
-				  else if (dimension_model == GAIA_XY_M)
-				    {
-					gaiaSetPointXYM (rng->Coords, iv, x,
-							 y, m);
-				    }
-				  else if (dimension_model == GAIA_XY_Z_M)
-				    {
-					gaiaSetPointXYZM (rng->Coords, iv, x,
-							  y, z, m);
-				    }
-				  else
-				    {
-					gaiaSetPoint (rng->Coords, iv, x, y);
-				    }
-			      }
-			}
-		      break;
-		  };
-	    }
-	  break;
-      default:
-	  gaiaFreeGeomColl (gaia);
-	  gaia = NULL;
-	  break;
-      };
-
-    return gaia;
-}
-
-static gaiaGeomCollPtr
-fromLWGeom (const LWGEOM * lwgeom, const int dimension_model,
-	    const int declared_type)
-{
-/* converting a LWGEOM Geometry into a GAIA Geometry */
-    gaiaGeomCollPtr gaia = NULL;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    if (dimension_model == GAIA_XY_Z)
-	gaia = gaiaAllocGeomCollXYZ ();
-    else if (dimension_model == GAIA_XY_M)
-	gaia = gaiaAllocGeomCollXYM ();
-    else if (dimension_model == GAIA_XY_Z_M)
-	gaia = gaiaAllocGeomCollXYZM ();
-    else
-	gaia = gaiaAllocGeomColl ();
-    gaia->DeclaredType = declared_type;
-    fromLWGeomIncremental (gaia, lwgeom);
-
-    return gaia;
-}
-
-static int
-check_valid_type (const LWGEOM * lwgeom, int declared_type)
-{
-/* checking if the geometry type is a valid one */
-    int ret = 0;
-    switch (lwgeom->type)
-      {
-      case POINTTYPE:
-      case MULTIPOINTTYPE:
-	  if (declared_type == GAIA_POINT || declared_type == GAIA_POINTZ
-	      || declared_type == GAIA_POINTM || declared_type == GAIA_POINTZM)
-	      ret = 1;
-	  if (declared_type == GAIA_MULTIPOINT
-	      || declared_type == GAIA_MULTIPOINTZ
-	      || declared_type == GAIA_MULTIPOINTM
-	      || declared_type == GAIA_MULTIPOINTZM)
-	      ret = 1;
-	  break;
-      case LINETYPE:
-      case MULTILINETYPE:
-	  if (declared_type == GAIA_LINESTRING
-	      || declared_type == GAIA_LINESTRINGZ
-	      || declared_type == GAIA_LINESTRINGM
-	      || declared_type == GAIA_LINESTRINGZM)
-	      ret = 1;
-	  if (declared_type == GAIA_MULTILINESTRING
-	      || declared_type == GAIA_MULTILINESTRINGZ
-	      || declared_type == GAIA_MULTILINESTRINGM
-	      || declared_type == GAIA_MULTILINESTRINGZM)
-	      ret = 1;
-	  break;
-      case POLYGONTYPE:
-      case MULTIPOLYGONTYPE:
-	  if (declared_type == GAIA_POLYGON || declared_type == GAIA_POLYGONZ
-	      || declared_type == GAIA_POLYGONM
-	      || declared_type == GAIA_POLYGONZM)
-	      ret = 1;
-	  if (declared_type == GAIA_MULTIPOLYGON
-	      || declared_type == GAIA_MULTIPOLYGONZ
-	      || declared_type == GAIA_MULTIPOLYGONM
-	      || declared_type == GAIA_MULTIPOLYGONZM)
-	      ret = 1;
-	  break;
-      case COLLECTIONTYPE:
-	  if (declared_type == GAIA_GEOMETRYCOLLECTION
-	      || declared_type == GAIA_GEOMETRYCOLLECTIONZ
-	      || declared_type == GAIA_GEOMETRYCOLLECTIONM
-	      || declared_type == GAIA_GEOMETRYCOLLECTIONZM)
-	      ret = 1;
-	  break;
-      };
-    return ret;
-}
-
-static gaiaGeomCollPtr
-fromLWGeomValidated (const LWGEOM * lwgeom, const int dimension_model,
-		     const int declared_type)
-{
-/* 
-/ converting a LWGEOM Geometry into a GAIA Geometry 
-/ first collection - validated items
-*/
-    gaiaGeomCollPtr gaia = NULL;
-    LWGEOM *lwg2 = NULL;
-    LWCOLLECTION *lwc = NULL;
-    int ngeoms;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    switch (lwgeom->type)
-      {
-      case COLLECTIONTYPE:
-	  lwc = (LWCOLLECTION *) lwgeom;
-	  ngeoms = lwc->ngeoms;
-	  if (ngeoms <= 2)
-	    {
-		lwg2 = lwc->geoms[0];
-		if (check_valid_type (lwg2, declared_type))
-		    gaia = fromLWGeom (lwg2, dimension_model, declared_type);
-	    }
-	  break;
-      default:
-	  if (check_valid_type (lwgeom, declared_type))
-	      gaia = fromLWGeom (lwgeom, dimension_model, declared_type);
-	  if (gaia == NULL)
-	    {
-		/* Andrea Peri: 2013-05-02 returning anyway the LWGEOM geometry,
-		   / even if it has a mismatching type */
-		int type = -1;
-		switch (lwgeom->type)
-		  {
-		  case POINTTYPE:
-		      type = GAIA_POINT;
-		      break;
-		  case LINETYPE:
-		      type = GAIA_LINESTRING;
-		      break;
-		  case POLYGONTYPE:
-		      type = GAIA_POLYGON;
-		      break;
-		  case MULTIPOINTTYPE:
-		      type = GAIA_MULTIPOINT;
-		      break;
-		  case MULTILINETYPE:
-		      type = GAIA_MULTILINESTRING;
-		      break;
-		  case MULTIPOLYGONTYPE:
-		      type = GAIA_MULTIPOLYGON;
-		      break;
-		  };
-		if (type >= 0)
-		    gaia = fromLWGeom (lwgeom, dimension_model, type);
-	    }
-	  break;
-      }
-    return gaia;
-}
-
-static gaiaGeomCollPtr
-fromLWGeomDiscarded (const LWGEOM * lwgeom, const int dimension_model,
-		     const int declared_type)
-{
-/* 
-/ converting a LWGEOM Geometry into a GAIA Geometry 
-/ second collection - discarded items
-*/
-    gaiaGeomCollPtr gaia = NULL;
-    LWGEOM *lwg2 = NULL;
-    LWCOLLECTION *lwc = NULL;
-    int ngeoms;
-    int ig;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    if (lwgeom->type == COLLECTIONTYPE)
-      {
-	  if (dimension_model == GAIA_XY_Z)
-	      gaia = gaiaAllocGeomCollXYZ ();
-	  else if (dimension_model == GAIA_XY_M)
-	      gaia = gaiaAllocGeomCollXYM ();
-	  else if (dimension_model == GAIA_XY_Z_M)
-	      gaia = gaiaAllocGeomCollXYZM ();
-	  else
-	      gaia = gaiaAllocGeomColl ();
-	  lwc = (LWCOLLECTION *) lwgeom;
-	  ngeoms = lwc->ngeoms;
-	  for (ig = 0; ig < ngeoms; ig++)
-	    {
-		lwg2 = lwc->geoms[ig];
-		if (!check_valid_type (lwg2, declared_type))
-		    fromLWGeomIncremental (gaia, lwg2);
-	    }
-      }
-/*
-Andrea Peri: 2013-05-02
-when a single geometry is returned by LWGEOM it's always "valid"
-and there are no discarded items at all
-
-    else if (!check_valid_type (lwgeom, declared_type))
-	gaia = fromLWGeom (lwgeom, dimension_model, declared_type);
-*/
-    return gaia;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaMakeValid (gaiaGeomCollPtr geom)
-{
-/* wrapping LWGEOM MakeValid [collecting valid items] */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    gaiaGeomCollPtr result = NULL;
-
-    if (!geom)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom);
-    g2 = lwgeom_make_valid (g1);
-    if (!g2)
-      {
-	  lwgeom_free (g1);
-	  goto done;
-      }
-    result = fromLWGeomValidated (g2, geom->DimensionModel, geom->DeclaredType);
-    spatialite_init_geos ();
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    result->Srid = geom->Srid;
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaMakeValidDiscarded (gaiaGeomCollPtr geom)
-{
-/* wrapping LWGEOM MakeValid [collecting discarder items] */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    gaiaGeomCollPtr result = NULL;
-
-    if (!geom)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom);
-    g2 = lwgeom_make_valid (g1);
-    if (!g2)
-      {
-	  lwgeom_free (g1);
-	  goto done;
-      }
-    result = fromLWGeomDiscarded (g2, geom->DimensionModel, geom->DeclaredType);
-    spatialite_init_geos ();
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    result->Srid = geom->Srid;
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaSegmentize (gaiaGeomCollPtr geom, double dist)
-{
-/* wrapping LWGEOM Segmentize */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    gaiaGeomCollPtr result = NULL;
-
-    if (!geom)
-	return NULL;
-    if (dist <= 0.0)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom);
-    g2 = lwgeom_segmentize2d (g1, dist);
-    if (!g2)
-      {
-	  lwgeom_free (g1);
-	  goto done;
-      }
-    result = fromLWGeom (g2, geom->DimensionModel, geom->DeclaredType);
-    spatialite_init_geos ();
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    result->Srid = geom->Srid;
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-static int
-check_split_args (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
-{
-/* testing Split arguments */
-    gaiaPointPtr pt;
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-    int i_lns = 0;
-    int i_pgs = 0;
-    int b_pts = 0;
-    int b_lns = 0;
-
-    if (!input)
-	return 0;
-    if (!blade)
-	return 0;
-
-/* testing the Input type */
-    if (input->FirstPoint != NULL)
-      {
-	  /* Point(s) on Input is forbidden !!!! */
-	  return 0;
-      }
-    ln = input->FirstLinestring;
-    while (ln)
-      {
-	  /* counting how many Linestrings are there */
-	  i_lns++;
-	  ln = ln->Next;
-      }
-    pg = input->FirstPolygon;
-    while (pg)
-      {
-	  /* counting how many Polygons are there */
-	  i_pgs++;
-	  pg = pg->Next;
-      }
-    if (i_lns + i_pgs == 0)
-      {
-	  /* empty Input */
-	  return 0;
-      }
-
-/* testing the Blade type */
-    pt = blade->FirstPoint;
-    while (pt)
-      {
-	  /* counting how many Points are there */
-	  b_pts++;
-	  pt = pt->Next;
-      }
-    ln = blade->FirstLinestring;
-    while (ln)
-      {
-	  /* counting how many Linestrings are there */
-	  b_lns++;
-	  ln = ln->Next;
-      }
-    if (blade->FirstPolygon != NULL)
-      {
-	  /* Polygon(s) on Blade is forbidden !!!! */
-	  return 0;
-      }
-    if (b_pts + b_lns == 0)
-      {
-	  /* empty Blade */
-	  return 0;
-      }
-    if (b_pts >= 1 && b_lns >= 1)
-      {
-	  /* invalid Blade [point + linestring] */
-	  return 0;
-      }
-
-/* compatibility check */
-    if (b_lns >= 1)
-      {
-	  /* Linestring blade is always valid */
-	  return 1;
-      }
-    if (i_lns >= 1 && b_pts >= 1)
-      {
-	  /* Linestring or MultiLinestring input and Point blade is allowed */
-	  return 1;
-      }
-
-    return 0;
-}
-
-static void
-set_split_gtype (gaiaGeomCollPtr geom)
-{
-/* assignign the actual geometry type */
-    gaiaPointPtr pt;
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-    int pts = 0;
-    int lns = 0;
-    int pgs = 0;
-
-    pt = geom->FirstPoint;
-    while (pt)
-      {
-	  /* counting how many Points are there */
-	  pts++;
-	  pt = pt->Next;
-      }
-    ln = geom->FirstLinestring;
-    while (ln)
-      {
-	  /* counting how many Linestrings are there */
-	  lns++;
-	  ln = ln->Next;
-      }
-    pg = geom->FirstPolygon;
-    while (pg)
-      {
-	  /* counting how many Polygons are there */
-	  pgs++;
-	  pg = pg->Next;
-      }
-
-    if (pts == 1 && lns == 0 && pgs == 0)
-      {
-	  geom->DeclaredType = GAIA_POINT;
-	  return;
-      }
-    if (pts > 1 && lns == 0 && pgs == 0)
-      {
-	  geom->DeclaredType = GAIA_MULTIPOINT;
-	  return;
-      }
-    if (pts == 0 && lns == 1 && pgs == 0)
-      {
-	  geom->DeclaredType = GAIA_LINESTRING;
-	  return;
-      }
-    if (pts == 0 && lns > 1 && pgs == 0)
-      {
-	  geom->DeclaredType = GAIA_MULTILINESTRING;
-	  return;
-      }
-    if (pts == 0 && lns == 0 && pgs == 1)
-      {
-	  geom->DeclaredType = GAIA_POLYGON;
-	  return;
-      }
-    if (pts == 0 && lns == 0 && pgs > 1)
-      {
-	  geom->DeclaredType = GAIA_MULTIPOLYGON;
-	  return;
-      }
-    geom->DeclaredType = GAIA_GEOMETRYCOLLECTION;
-}
-
-static LWGEOM *
-toLWGeomLinestring (gaiaLinestringPtr ln, int srid)
-{
-/* converting a GAIA Linestring into a LWGEOM Geometry */
-    int iv;
-    double x = 0.0;
-    double y = 0.0;
-    double z = 0.0;
-    double m = 0.0;
-    int has_z = 0;
-    int has_m = 0;
-    POINTARRAY *pa;
-    POINT4D point;
-
-    if (ln->DimensionModel == GAIA_XY_Z || ln->DimensionModel == GAIA_XY_Z_M)
-	has_z = 1;
-    if (ln->DimensionModel == GAIA_XY_M || ln->DimensionModel == GAIA_XY_Z_M)
-	has_m = 1;
-    pa = ptarray_construct (has_z, has_m, ln->Points);
-    for (iv = 0; iv < ln->Points; iv++)
-      {
-	  /* copying vertices */
-	  if (ln->DimensionModel == GAIA_XY_Z)
-	    {
-		gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
-	    }
-	  else if (ln->DimensionModel == GAIA_XY_M)
-	    {
-		gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
-	    }
-	  else if (ln->DimensionModel == GAIA_XY_Z_M)
-	    {
-		gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
-	    }
-	  else
-	    {
-		gaiaGetPoint (ln->Coords, iv, &x, &y);
-	    }
-	  point.x = x;
-	  point.y = y;
-	  if (has_z)
-	      point.z = z;
-	  if (has_m)
-	      point.m = m;
-	  ptarray_set_point4d (pa, iv, &point);
-      }
-    return (LWGEOM *) lwline_construct (srid, NULL, pa);
-}
-
-static LWGEOM *
-toLWGeomPolygon (gaiaPolygonPtr pg, int srid)
-{
-/* converting a GAIA Linestring into a LWGEOM Geometry */
-    int iv;
-    int ib;
-    double x = 0.0;
-    double y = 0.0;
-    double z = 0.0;
-    double m = 0.0;
-    int ngeoms;
-    int has_z = 0;
-    int has_m = 0;
-    int close_ring;
-    gaiaRingPtr rng;
-    POINTARRAY **ppaa;
-    POINT4D point;
-
-    if (pg->DimensionModel == GAIA_XY_Z || pg->DimensionModel == GAIA_XY_Z_M)
-	has_z = 1;
-    if (pg->DimensionModel == GAIA_XY_M || pg->DimensionModel == GAIA_XY_Z_M)
-	has_m = 1;
-    ngeoms = pg->NumInteriors;
-    ppaa = lwalloc (sizeof (POINTARRAY *) * (ngeoms + 1));
-    rng = pg->Exterior;
-    close_ring = check_unclosed_ring (rng);
-    if (close_ring)
-	ppaa[0] = ptarray_construct (has_z, has_m, rng->Points + 1);
-    else
-	ppaa[0] = ptarray_construct (has_z, has_m, rng->Points);
-    for (iv = 0; iv < rng->Points; iv++)
-      {
-	  /* copying vertices - Exterior Ring */
-	  if (pg->DimensionModel == GAIA_XY_Z)
-	    {
-		gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-	    }
-	  else if (pg->DimensionModel == GAIA_XY_M)
-	    {
-		gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-	    }
-	  else if (pg->DimensionModel == GAIA_XY_Z_M)
-	    {
-		gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
-	    }
-	  else
-	    {
-		gaiaGetPoint (rng->Coords, iv, &x, &y);
-	    }
-	  point.x = x;
-	  point.y = y;
-	  if (has_z)
-	      point.z = z;
-	  if (has_m)
-	      point.m = m;
-	  ptarray_set_point4d (ppaa[0], iv, &point);
-      }
-    if (close_ring)
-      {
-	  /* making an unclosed ring to be closed */
-	  if (pg->DimensionModel == GAIA_XY_Z)
-	    {
-		gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-	    }
-	  else if (pg->DimensionModel == GAIA_XY_M)
-	    {
-		gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-	    }
-	  else if (pg->DimensionModel == GAIA_XY_Z_M)
-	    {
-		gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
-	    }
-	  else
-	    {
-		gaiaGetPoint (rng->Coords, 0, &x, &y);
-	    }
-	  point.x = x;
-	  point.y = y;
-	  if (has_z)
-	      point.z = z;
-	  if (has_m)
-	      point.m = m;
-	  ptarray_set_point4d (ppaa[0], rng->Points, &point);
-      }
-    for (ib = 0; ib < pg->NumInteriors; ib++)
-      {
-	  /* copying vertices - Interior Rings */
-	  rng = pg->Interiors + ib;
-	  close_ring = check_unclosed_ring (rng);
-	  if (close_ring)
-	      ppaa[1 + ib] = ptarray_construct (has_z, has_m, rng->Points + 1);
-	  else
-	      ppaa[1 + ib] = ptarray_construct (has_z, has_m, rng->Points);
-	  for (iv = 0; iv < rng->Points; iv++)
-	    {
-		if (pg->DimensionModel == GAIA_XY_Z)
-		  {
-		      gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
-		  }
-		else if (pg->DimensionModel == GAIA_XY_M)
-		  {
-		      gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
-		  }
-		else if (pg->DimensionModel == GAIA_XY_Z_M)
-		  {
-		      gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
-		  }
-		else
-		  {
-		      gaiaGetPoint (rng->Coords, iv, &x, &y);
-		  }
-		point.x = x;
-		point.y = y;
-		if (has_z)
-		    point.z = z;
-		if (has_m)
-		    point.m = m;
-		ptarray_set_point4d (ppaa[1 + ib], iv, &point);
-	    }
-	  if (close_ring)
-	    {
-		/* making an unclosed ring to be closed */
-		if (pg->DimensionModel == GAIA_XY_Z)
-		  {
-		      gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
-		  }
-		else if (pg->DimensionModel == GAIA_XY_M)
-		  {
-		      gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
-		  }
-		else if (pg->DimensionModel == GAIA_XY_Z_M)
-		  {
-		      gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
-		  }
-		else
-		  {
-		      gaiaGetPoint (rng->Coords, 0, &x, &y);
-		  }
-		point.x = x;
-		point.y = y;
-		if (has_z)
-		    point.z = z;
-		if (has_m)
-		    point.m = m;
-		ptarray_set_point4d (ppaa[0], rng->Points, &point);
-	    }
-      }
-    return (LWGEOM *) lwpoly_construct (srid, NULL, ngeoms + 1, ppaa);
-}
-
-static gaiaGeomCollPtr
-fromLWGeomLeft (gaiaGeomCollPtr gaia, const LWGEOM * lwgeom)
-{
-/* 
-/ converting a LWGEOM Geometry into a GAIA Geometry 
-/ collecting "left side" items
-*/
-    LWGEOM *lwg2 = NULL;
-    LWCOLLECTION *lwc = NULL;
-    int ngeoms;
-    int ig;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    if (lwgeom->type == COLLECTIONTYPE)
-      {
-	  lwc = (LWCOLLECTION *) lwgeom;
-	  ngeoms = lwc->ngeoms;
-	  for (ig = 0; ig < ngeoms; ig += 2)
-	    {
-		lwg2 = lwc->geoms[ig];
-		fromLWGeomIncremental (gaia, lwg2);
-	    }
-      }
-    else
-	gaia = fromLWGeom (lwgeom, gaia->DimensionModel, gaia->DeclaredType);
-
-    return gaia;
-}
-
-static gaiaGeomCollPtr
-fromLWGeomRight (gaiaGeomCollPtr gaia, const LWGEOM * lwgeom)
-{
-/* 
-/ converting a LWGEOM Geometry into a GAIA Geometry 
-/ collecting "right side" items
-*/
-    LWGEOM *lwg2 = NULL;
-    LWCOLLECTION *lwc = NULL;
-    int ngeoms;
-    int ig;
-
-    if (lwgeom == NULL)
-	return NULL;
-    if (lwgeom_is_empty (lwgeom))
-	return NULL;
-
-    if (lwgeom->type == COLLECTIONTYPE)
-      {
-	  lwc = (LWCOLLECTION *) lwgeom;
-	  ngeoms = lwc->ngeoms;
-	  for (ig = 1; ig < ngeoms; ig += 2)
-	    {
-		lwg2 = lwc->geoms[ig];
-		fromLWGeomIncremental (gaia, lwg2);
-	    }
-      }
-
-    return gaia;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaSplit (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
-{
-/* wrapping LWGEOM Split */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    LWGEOM *g3;
-    gaiaGeomCollPtr result = NULL;
-
-    if (!check_split_args (input, blade))
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (input);
-    g2 = toLWGeom (blade);
-    g3 = lwgeom_split (g1, g2);
-    if (!g3)
-      {
-	  lwgeom_free (g1);
-	  lwgeom_free (g2);
-	  goto done;
-      }
-    result = fromLWGeom (g3, input->DimensionModel, input->DeclaredType);
-    spatialite_init_geos ();
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    lwgeom_free (g3);
-    if (result == NULL)
-	goto done;
-    result->Srid = input->Srid;
-    set_split_gtype (result);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaSplitLeft (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
-{
-/* wrapping LWGEOM Split [left half] */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    LWGEOM *g3;
-    gaiaGeomCollPtr result = NULL;
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-
-    if (!check_split_args (input, blade))
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    if (input->DimensionModel == GAIA_XY_Z)
-	result = gaiaAllocGeomCollXYZ ();
-    else if (input->DimensionModel == GAIA_XY_M)
-	result = gaiaAllocGeomCollXYM ();
-    else if (input->DimensionModel == GAIA_XY_Z_M)
-	result = gaiaAllocGeomCollXYZM ();
-    else
-	result = gaiaAllocGeomColl ();
-
-    g2 = toLWGeom (blade);
-
-    ln = input->FirstLinestring;
-    while (ln)
-      {
-	  /* splitting some Linestring */
-	  g1 = toLWGeomLinestring (ln, input->Srid);
-	  g3 = lwgeom_split (g1, g2);
-	  if (g3)
-	    {
-		result = fromLWGeomLeft (result, g3);
-		lwgeom_free (g3);
-	    }
-	  spatialite_init_geos ();
-	  lwgeom_free (g1);
-	  ln = ln->Next;
-      }
-    pg = input->FirstPolygon;
-    while (pg)
-      {
-	  /* splitting some Polygon */
-	  g1 = toLWGeomPolygon (pg, input->Srid);
-	  g3 = lwgeom_split (g1, g2);
-	  if (g3)
-	    {
-		result = fromLWGeomLeft (result, g3);
-		lwgeom_free (g3);
-	    }
-	  spatialite_init_geos ();
-	  lwgeom_free (g1);
-	  pg = pg->Next;
-      }
-
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    if (result->FirstPoint == NULL && result->FirstLinestring == NULL
-	&& result->FirstPolygon == NULL)
-      {
-	  gaiaFreeGeomColl (result);
-	  result = NULL;
-	  goto done;
-      }
-    result->Srid = input->Srid;
-    set_split_gtype (result);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaSplitRight (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
-{
-/* wrapping LWGEOM Split [right half] */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    LWGEOM *g3;
-    gaiaGeomCollPtr result = NULL;
-    gaiaLinestringPtr ln;
-    gaiaPolygonPtr pg;
-
-    if (!check_split_args (input, blade))
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    if (input->DimensionModel == GAIA_XY_Z)
-	result = gaiaAllocGeomCollXYZ ();
-    else if (input->DimensionModel == GAIA_XY_M)
-	result = gaiaAllocGeomCollXYM ();
-    else if (input->DimensionModel == GAIA_XY_Z_M)
-	result = gaiaAllocGeomCollXYZM ();
-    else
-	result = gaiaAllocGeomColl ();
-
-    g2 = toLWGeom (blade);
-
-    ln = input->FirstLinestring;
-    while (ln)
-      {
-	  /* splitting some Linestring */
-	  g1 = toLWGeomLinestring (ln, input->Srid);
-	  g3 = lwgeom_split (g1, g2);
-	  if (g3)
-	    {
-		result = fromLWGeomRight (result, g3);
-		lwgeom_free (g3);
-	    }
-	  spatialite_init_geos ();
-	  lwgeom_free (g1);
-	  ln = ln->Next;
-      }
-    pg = input->FirstPolygon;
-    while (pg)
-      {
-	  /* splitting some Polygon */
-	  g1 = toLWGeomPolygon (pg, input->Srid);
-	  g3 = lwgeom_split (g1, g2);
-	  if (g3)
-	    {
-		result = fromLWGeomRight (result, g3);
-		lwgeom_free (g3);
-	    }
-	  spatialite_init_geos ();
-	  lwgeom_free (g1);
-	  pg = pg->Next;
-      }
-
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    if (result->FirstPoint == NULL && result->FirstLinestring == NULL
-	&& result->FirstPolygon == NULL)
-      {
-	  gaiaFreeGeomColl (result);
-	  result = NULL;
-	  goto done;
-      }
-    result->Srid = input->Srid;
-    set_split_gtype (result);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-GAIAGEO_DECLARE int
-gaiaAzimuth (double xa, double ya, double xb, double yb, double *azimuth)
-{
-/* wrapping LWGEOM Azimuth */
-    POINT2D pt1;
-    POINT2D pt2;
-    double az;
-    int ret = 1;
-    pt1.x = xa;
-    pt1.y = ya;
-    pt2.x = xb;
-    pt2.y = yb;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    if (!azimuth_pt_pt (&pt1, &pt2, &az))
-	ret = 0;
-    *azimuth = az;
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE int
-gaiaEllipsoidAzimuth (double xa, double ya, double xb, double yb, double a,
-		      double b, double *azimuth)
-{
-/* wrapping LWGEOM AzimuthSpheroid */
-    LWPOINT *pt1 = lwpoint_make2d (0, xa, ya);
-    LWPOINT *pt2 = lwpoint_make2d (0, xb, yb);
-    SPHEROID ellips;
-    int ret = 1;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    spheroid_init (&ellips, a, b);
-    *azimuth = lwgeom_azumith_spheroid (pt1, pt2, &ellips);
-    lwpoint_free (pt1);
-    lwpoint_free (pt2);
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE int
-gaiaProjectedPoint (double x1, double y1, double a, double b, double distance,
-		    double azimuth, double *x2, double *y2)
-{
-/* wrapping LWGEOM Project */
-    LWPOINT *pt1 = lwpoint_make2d (0, x1, y1);
-    LWPOINT *pt2;
-    SPHEROID ellips;
-    int ret = 0;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    spheroid_init (&ellips, a, b);
-    pt2 = lwgeom_project_spheroid (pt1, &ellips, distance, azimuth);
-    lwpoint_free (pt1);
-    if (pt2 != NULL)
-      {
-	  *x2 = lwpoint_get_x (pt2);
-	  *y2 = lwpoint_get_y (pt2);
-	  lwpoint_free (pt2);
-	  ret = 1;
-      }
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE int
-gaiaGeodesicArea (gaiaGeomCollPtr geom, double a, double b, int use_ellipsoid,
-		  double *area)
-{
-/* wrapping LWGEOM AreaSphere and AreaSpheroid */
-    LWGEOM *g = toLWGeom (geom);
-    SPHEROID ellips;
-    GBOX gbox;
-    double tolerance = 1e-12;
-    int ret = 1;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    spheroid_init (&ellips, a, b);
-    if (g == NULL)
-      {
-	  ret = 0;
-	  goto done;
-      }
-    lwgeom_calculate_gbox_geodetic (g, &gbox);
-    if (use_ellipsoid)
-      {
-	  /* testing for "forbidden" calculations on the ellipsoid */
-	  if ((gbox.zmax + tolerance) >= 1.0 || (gbox.zmin - tolerance) <= -1.0)
-	      use_ellipsoid = 0;	/* can't circle the poles */
-	  if (gbox.zmax > 0.0 && gbox.zmin < 0.0)
-	      use_ellipsoid = 0;	/* can't cross the equator */
-      }
-    if (use_ellipsoid)
-	*area = lwgeom_area_spheroid (g, &ellips);
-    else
-	*area = lwgeom_area_sphere (g, &ellips);
-    lwgeom_free (g);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE char *
-gaiaGeoHash (gaiaGeomCollPtr geom, int precision)
-{
-/* wrapping LWGEOM GeoHash */
-    LWGEOM *g;
-    char *result;
-    char *geo_hash = NULL;
-    int len;
-
-    if (!geom)
-	return NULL;
-    gaiaMbrGeometry (geom);
-    if (geom->MinX < -180.0 || geom->MaxX > 180.0 || geom->MinY < -90.0
-	|| geom->MaxY > 90.0)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g = toLWGeom (geom);
-    result = lwgeom_geohash (g, precision);
-    lwgeom_free (g);
-    if (result == NULL)
-	goto done;
-    len = strlen (result);
-    if (len == 0)
-      {
-	  lwfree (result);
-	  goto done;
-      }
-    geo_hash = malloc (len + 1);
-    strcpy (geo_hash, result);
-    lwfree (result);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return geo_hash;
-}
-
-GAIAGEO_DECLARE char *
-gaiaAsX3D (gaiaGeomCollPtr geom, const char *srs, int precision, int options,
-	   const char *defid)
-{
-/* wrapping LWGEOM AsX3D */
-    LWGEOM *g;
-    char *result;
-    char *x3d = NULL;
-    int len;
-
-    if (!geom)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    gaiaMbrGeometry (geom);
-    g = toLWGeom (geom);
-    result = lwgeom_to_x3d3 (g, (char *) srs, precision, options, defid);
-    lwgeom_free (g);
-    if (result == NULL)
-	goto done;
-    len = strlen (result);
-    if (len == 0)
-      {
-	  lwfree (result);
-	  goto done;
-      }
-    x3d = malloc (len + 1);
-    strcpy (x3d, result);
-    lwfree (result);
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return x3d;
-}
-
-GAIAGEO_DECLARE int
-gaia3DDistance (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double *dist)
-{
-/* wrapping LWGEOM mindistance3d */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    double d;
-    int ret = 1;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom1);
-    g2 = toLWGeom (geom2);
-
-    d = lwgeom_mindistance3d (g1, g2);
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    *dist = d;
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE int
-gaiaMaxDistance (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double *dist)
-{
-/* wrapping LWGEOM maxdistance2d */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    double d;
-    int ret = 1;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom1);
-    g2 = toLWGeom (geom2);
-
-    d = lwgeom_maxdistance2d (g1, g2);
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    *dist = d;
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE int
-gaia3DMaxDistance (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, double *dist)
-{
-/* wrapping LWGEOM maxdistance2d */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    double d;
-    int ret = 1;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom1);
-    g2 = toLWGeom (geom2);
-
-    d = lwgeom_maxdistance3d (g1, g2);
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    *dist = d;
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-static LWLINE *
-linestring2lwline (gaiaLinestringPtr ln, int srid)
-{
-/* converting a Linestring into an LWLINE */
-    POINTARRAY *pa;
-    POINT4D point;
-    int iv;
-    double x;
-    double y;
-    double z;
-    double m;
-    int has_z = 0;
-
-    if (ln->DimensionModel == GAIA_XY_Z || ln->DimensionModel == GAIA_XY_Z_M)
-	has_z = 1;
-
-    pa = ptarray_construct (has_z, 0, ln->Points);
-    for (iv = 0; iv < ln->Points; iv++)
-      {
-	  /* copying vertices */
-	  if (ln->DimensionModel == GAIA_XY_Z)
-	    {
-		gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
-	    }
-	  else if (ln->DimensionModel == GAIA_XY_M)
-	    {
-		gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
-	    }
-	  else if (ln->DimensionModel == GAIA_XY_Z_M)
-	    {
-		gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
-	    }
-	  else
-	    {
-		gaiaGetPoint (ln->Coords, iv, &x, &y);
-	    }
-	  point.x = x;
-	  point.y = y;
-	  if (has_z)
-	      point.z = z;
-	  else
-	      point.z = 0.0;
-	  point.m = 0.0;
-	  ptarray_set_point4d (pa, iv, &point);
-      }
-    return lwline_construct (srid, NULL, pa);
-}
-
-GAIAGEO_DECLARE int
-gaia3dLength (gaiaGeomCollPtr geom, double *length)
-{
-/* wrapping LWGEOM lwline_length */
-    LWLINE *line;
-    gaiaLinestringPtr ln;
-    double l = 0.0;
-    int ret = 0;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    ln = geom->FirstLinestring;
-    while (ln != NULL)
-      {
-	  ret = 1;
-	  line = linestring2lwline (ln, geom->Srid);
-	  l += lwgeom_length ((LWGEOM *) line);
-	  lwline_free (line);
-	  ln = ln->Next;
-      }
-    *length = l;
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return ret;
-}
-
-GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaNodeLines (gaiaGeomCollPtr geom)
-{
-/* wrapping LWGEOM lwgeom_node */
-    LWGEOM *g1;
-    LWGEOM *g2;
-    gaiaGeomCollPtr result = NULL;
-
-    if (!geom)
-	return NULL;
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    g1 = toLWGeom (geom);
-    g2 = lwgeom_node (g1);
-    if (!g2)
-      {
-	  lwgeom_free (g1);
-	  goto done;
-      }
-    result = fromLWGeom (g2, geom->DimensionModel, geom->DeclaredType);
-    spatialite_init_geos ();
-    lwgeom_free (g1);
-    lwgeom_free (g2);
-    if (result == NULL)
-	goto done;
-    result->Srid = geom->Srid;
-
-  done:
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-    return result;
-}
-
-#endif /* end enabling LWGEOM support */
diff --git a/src/gaiageo/gg_relations.c b/src/gaiageo/gg_relations.c
index 81370c0..cda32b1 100644
--- a/src/gaiageo/gg_relations.c
+++ b/src/gaiageo/gg_relations.c
@@ -2879,7 +2879,7 @@ gaiaIsValidReason_r (const void *p_cache, gaiaGeomCollPtr geom)
 }
 
 GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaIsValidDetail (gaiaGeomCollPtr geom)
+gaiaIsValidDetailEx (gaiaGeomCollPtr geom, int esri_flag)
 {
 /* return a Geometry detail causing a Geometry to be invalid */
     gaiaGeomCollPtr detail = NULL;
@@ -2895,7 +2895,9 @@ gaiaIsValidDetail (gaiaGeomCollPtr geom)
     if (gaiaIsNotClosedGeomColl (geom))
 	return NULL;
     g = gaiaToGeos (geom);
-    GEOSisValidDetail (g, 0, &reason, &d);
+    if (esri_flag)
+	esri_flag = 1;		/* normalizing to exactly 1 */
+    GEOSisValidDetail (g, esri_flag, &reason, &d);
     GEOSGeom_destroy (g);
     if (reason != NULL)
 	GEOSFree (reason);
@@ -2911,7 +2913,14 @@ gaiaIsValidDetail (gaiaGeomCollPtr geom)
 }
 
 GAIAGEO_DECLARE gaiaGeomCollPtr
-gaiaIsValidDetail_r (const void *p_cache, gaiaGeomCollPtr geom)
+gaiaIsValidDetail (gaiaGeomCollPtr geom)
+{
+/* return a Geometry detail causing a Geometry to be invalid */
+    return gaiaIsValidDetailEx (geom, 0);
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaIsValidDetailEx_r (const void *p_cache, gaiaGeomCollPtr geom, int esri_flag)
 {
 /* return a Geometry detail causing a Geometry to be invalid */
     char *reason = NULL;
@@ -2937,7 +2946,9 @@ gaiaIsValidDetail_r (const void *p_cache, gaiaGeomCollPtr geom)
     if (gaiaIsNotClosedGeomColl_r (cache, geom))
 	return NULL;
     g = gaiaToGeos_r (cache, geom);
-    GEOSisValidDetail_r (handle, g, 0, &reason, &d);
+    if (esri_flag)
+	esri_flag = 1;		/* normalizing to exactly 1 */
+    GEOSisValidDetail_r (handle, g, esri_flag, &reason, &d);
     GEOSGeom_destroy_r (handle, g);
     if (reason != NULL)
 	GEOSFree_r (handle, reason);
@@ -2948,6 +2959,13 @@ gaiaIsValidDetail_r (const void *p_cache, gaiaGeomCollPtr geom)
     return detail;
 }
 
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaIsValidDetail_r (const void *p_cache, gaiaGeomCollPtr geom)
+{
+/* return a Geometry detail causing a Geometry to be invalid */
+    return gaiaIsValidDetailEx_r (p_cache, geom, 0);
+}
+
 GAIAGEO_DECLARE int
 gaiaIsClosedGeom_r (const void *cache, gaiaGeomCollPtr geom)
 {
@@ -3561,7 +3579,7 @@ gaiaPolygonizeCommon (const void *cache, GEOSContextHandle_t handle,
     int lns = 0;
     int pgs = 0;
     int items;
-    int error;
+    int error = 0;
     double x;
     double y;
     double z;
diff --git a/src/gaiageo/gg_relations_ext.c b/src/gaiageo/gg_relations_ext.c
index b802643..0a0e2b7 100644
--- a/src/gaiageo/gg_relations_ext.c
+++ b/src/gaiageo/gg_relations_ext.c
@@ -1969,8 +1969,8 @@ gaiaLineSubstringCommon (struct splite_internal_cache *cache,
     for (iv = 0; iv < ln->Points; iv++)
       {
 
-	  double x0;
-	  double y0;
+	  double x0 = 0.0;
+	  double y0 = 0.0;
 	  switch (ln->DimensionModel)
 	    {
 	    case GAIA_XY_Z:
@@ -2572,9 +2572,9 @@ buildGeosSegments (GEOSContextHandle_t handle, const gaiaGeomCollPtr gaia)
     double y;
     double z;
     double m;
-    double x0;
-    double y0;
-    double z0;
+    double x0 = 0.0;
+    double y0 = 0.0;
+    double z0 = 0.0;
     gaiaLinestringPtr ln;
     gaiaPolygonPtr pg;
     gaiaRingPtr rng;
@@ -2900,12 +2900,12 @@ gaiaShortestLineCommon (struct splite_internal_cache *cache,
     int it1;
     int it2;
     unsigned int dims;
-    double x_ini;
-    double y_ini;
-    double z_ini;
-    double x_fin;
-    double y_fin;
-    double z_fin;
+    double x_ini = 0.0;
+    double y_ini = 0.0;
+    double z_ini = 0.0;
+    double x_fin = 0.0;
+    double y_fin = 0.0;
+    double z_fin = 0.0;
     double dist;
     double min_dist = DBL_MAX;
     double projection;
@@ -3934,6 +3934,8 @@ extractSubLine (gaiaGeomCollPtr result, gaiaLinestringPtr ln, int i_start,
 
     for (iv = i_start; iv <= i_end; iv++)
       {
+	  m = 0.0;
+	  z = 0.0;
 	  if (ln->DimensionModel == GAIA_XY_Z)
 	    {
 		gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
diff --git a/src/gaiageo/gg_rttopo.c b/src/gaiageo/gg_rttopo.c
new file mode 100644
index 0000000..c0cfefc
--- /dev/null
+++ b/src/gaiageo/gg_rttopo.c
@@ -0,0 +1,2613 @@
+/*
+
+ gg_rttopo.c -- Gaia RTTOPO support
+    
+ version 4.5, 2016 April 18
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+ 
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ 
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+ 
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+ 
+Portions created by the Initial Developer are Copyright (C) 2012-2015
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+ 
+*/
+
+/*
+ 
+CREDITS:
+
+this module (wrapping liblwgeom APIs) has been entierely funded by:
+Regione Toscana - Settore Sistema Informativo Territoriale ed Ambientale
+
+HISTORY:
+this module was previously name gg_lwgeom.c and was based on liblwgeom;
+the current version depends on the newer RTTOPO support
+
+*/
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#if defined(_WIN32) && !defined(__MINGW32__)
+#include "config-msvc.h"
+#else
+#include "config.h"
+#endif
+
+#include <spatialite_private.h>
+#include <spatialite/sqlite.h>
+#include <spatialite.h>
+#include <spatialite/debug.h>
+
+#include <spatialite/gaiageo.h>
+
+#ifdef ENABLE_RTTOPO		/* enabling RTTOPO support */
+
+#include <librttopo_geom.h>
+
+SPATIALITE_PRIVATE const char *
+splite_rttopo_version (void)
+{
+    return rtgeom_version ();
+}
+
+GAIAGEO_DECLARE void
+gaiaResetRtTopoMsg (const void *p_cache)
+{
+/* Resets the RTTOPO error and warning messages to an empty state */
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    if (cache == NULL)
+	return;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return;
+
+    if (cache->gaia_rttopo_error_msg)
+	free (cache->gaia_rttopo_error_msg);
+    if (cache->gaia_rttopo_warning_msg)
+	free (cache->gaia_rttopo_warning_msg);
+    cache->gaia_rttopo_error_msg = NULL;
+    cache->gaia_rttopo_warning_msg = NULL;
+}
+
+GAIAGEO_DECLARE const char *
+gaiaGetRtTopoErrorMsg (const void *p_cache)
+{
+/* Return the latest RTTOPO error message (if any) */
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+
+    return cache->gaia_rttopo_error_msg;
+}
+
+GAIAGEO_DECLARE void
+gaiaSetRtTopoErrorMsg (const void *p_cache, const char *msg)
+{
+/* Sets the RTTOPO error message */
+    int len;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    if (cache == NULL)
+	return;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return;
+
+    if (cache->gaia_rttopo_error_msg)
+	free (cache->gaia_rttopo_error_msg);
+    cache->gaia_rttopo_error_msg = NULL;
+    if (msg == NULL)
+	return;
+
+    len = strlen (msg);
+    cache->gaia_rttopo_error_msg = malloc (len + 1);
+    strcpy (cache->gaia_rttopo_error_msg, msg);
+}
+
+GAIAGEO_DECLARE const char *
+gaiaGetRtTopoWarningMsg (const void *p_cache)
+{
+/* Return the latest RTTOPO warning message (if any) */
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+
+    return cache->gaia_rttopo_warning_msg;
+}
+
+GAIAGEO_DECLARE void
+gaiaSetRtTopoWarningMsg (const void *p_cache, const char *msg)
+{
+/* Sets the RTTOPO warning message */
+    int len;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    if (cache == NULL)
+	return;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return;
+
+    if (cache->gaia_rttopo_warning_msg)
+	free (cache->gaia_rttopo_warning_msg);
+    cache->gaia_rttopo_warning_msg = NULL;
+    if (msg == NULL)
+	return;
+
+    len = strlen (msg);
+    cache->gaia_rttopo_warning_msg = malloc (len + 1);
+    strcpy (cache->gaia_rttopo_warning_msg, msg);
+}
+
+static int
+check_unclosed_ring (gaiaRingPtr rng)
+{
+/* checks if a Ring is closed or not */
+    double x0;
+    double y0;
+    double z0 = 0.0;
+    double m0 = 0.0;
+    double x1;
+    double y1;
+    double z1 = 0.0;
+    double m1 = 0.0;
+    int last = rng->Points - 1;
+    if (rng->DimensionModel == GAIA_XY_Z)
+      {
+	  gaiaGetPointXYZ (rng->Coords, 0, &x0, &y0, &z0);
+      }
+    else if (rng->DimensionModel == GAIA_XY_M)
+      {
+	  gaiaGetPointXYM (rng->Coords, 0, &x0, &y0, &m0);
+      }
+    else if (rng->DimensionModel == GAIA_XY_Z_M)
+      {
+	  gaiaGetPointXYZM (rng->Coords, 0, &x0, &y0, &z0, &m0);
+      }
+    else
+      {
+	  gaiaGetPoint (rng->Coords, 0, &x0, &y0);
+      }
+    if (rng->DimensionModel == GAIA_XY_Z)
+      {
+	  gaiaGetPointXYZ (rng->Coords, last, &x1, &y1, &z1);
+      }
+    else if (rng->DimensionModel == GAIA_XY_M)
+      {
+	  gaiaGetPointXYM (rng->Coords, last, &x1, &y1, &m1);
+      }
+    else if (rng->DimensionModel == GAIA_XY_Z_M)
+      {
+	  gaiaGetPointXYZM (rng->Coords, last, &x1, &y1, &z1, &m1);
+      }
+    else
+      {
+	  gaiaGetPoint (rng->Coords, last, &x1, &y1);
+      }
+    if (x0 == x1 && y0 == y1 && z0 == z1 && m0 == m1)
+	return 0;
+    return 1;
+}
+
+static RTGEOM *
+toRTGeom (const RTCTX * ctx, const gaiaGeomCollPtr gaia)
+{
+/* converting a GAIA Geometry into a RTGEOM Geometry */
+    int pts = 0;
+    int lns = 0;
+    int pgs = 0;
+    int has_z;
+    int has_m;
+    int ngeoms;
+    int numg;
+    int ib;
+    int iv;
+    int type;
+    double x = 0.0;
+    double y = 0.0;
+    double z = 0.0;
+    double m = 0.0;
+    int close_ring;
+    gaiaPointPtr pt;
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+    gaiaRingPtr rng;
+    RTPOINTARRAY *pa;
+    RTPOINTARRAY **ppaa;
+    RTPOINT4D point;
+    RTGEOM **geoms;
+
+    if (!gaia)
+	return NULL;
+    pt = gaia->FirstPoint;
+    while (pt)
+      {
+	  /* counting how many POINTs are there */
+	  pts++;
+	  pt = pt->Next;
+      }
+    ln = gaia->FirstLinestring;
+    while (ln)
+      {
+	  /* counting how many LINESTRINGs are there */
+	  lns++;
+	  ln = ln->Next;
+      }
+    pg = gaia->FirstPolygon;
+    while (pg)
+      {
+	  /* counting how many POLYGONs are there */
+	  pgs++;
+	  pg = pg->Next;
+      }
+    if (pts == 0 && lns == 0 && pgs == 0)
+	return NULL;
+
+    if (pts == 1 && lns == 0 && pgs == 0)
+      {
+	  /* single Point */
+	  pt = gaia->FirstPoint;
+	  has_z = 0;
+	  has_m = 0;
+	  if (gaia->DimensionModel == GAIA_XY_Z
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_z = 1;
+	  if (gaia->DimensionModel == GAIA_XY_M
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_m = 1;
+	  pa = ptarray_construct (ctx, has_z, has_m, 1);
+	  point.x = pt->X;
+	  point.y = pt->Y;
+	  if (has_z)
+	      point.z = pt->Z;
+	  if (has_m)
+	      point.m = pt->M;
+	  ptarray_set_point4d (ctx, pa, 0, &point);
+	  return (RTGEOM *) rtpoint_construct (ctx, gaia->Srid, NULL, pa);
+      }
+    else if (pts == 0 && lns == 1 && pgs == 0)
+      {
+	  /* single Linestring */
+	  ln = gaia->FirstLinestring;
+	  has_z = 0;
+	  has_m = 0;
+	  if (gaia->DimensionModel == GAIA_XY_Z
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_z = 1;
+	  if (gaia->DimensionModel == GAIA_XY_M
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_m = 1;
+	  pa = ptarray_construct (ctx, has_z, has_m, ln->Points);
+	  for (iv = 0; iv < ln->Points; iv++)
+	    {
+		/* copying vertices */
+		if (gaia->DimensionModel == GAIA_XY_Z)
+		  {
+		      gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_M)
+		  {
+		      gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_Z_M)
+		  {
+		      gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
+		  }
+		else
+		  {
+		      gaiaGetPoint (ln->Coords, iv, &x, &y);
+		  }
+		point.x = x;
+		point.y = y;
+		if (has_z)
+		    point.z = z;
+		if (has_m)
+		    point.m = m;
+		ptarray_set_point4d (ctx, pa, iv, &point);
+	    }
+	  return (RTGEOM *) rtline_construct (ctx, gaia->Srid, NULL, pa);
+      }
+    else if (pts == 0 && lns == 0 && pgs == 1)
+      {
+	  /* single Polygon */
+	  pg = gaia->FirstPolygon;
+	  has_z = 0;
+	  has_m = 0;
+	  if (gaia->DimensionModel == GAIA_XY_Z
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_z = 1;
+	  if (gaia->DimensionModel == GAIA_XY_M
+	      || gaia->DimensionModel == GAIA_XY_Z_M)
+	      has_m = 1;
+	  ngeoms = pg->NumInteriors;
+	  ppaa = rtalloc (ctx, sizeof (RTPOINTARRAY *) * (ngeoms + 1));
+	  rng = pg->Exterior;
+	  close_ring = check_unclosed_ring (rng);
+	  if (close_ring)
+	      ppaa[0] = ptarray_construct (ctx, has_z, has_m, rng->Points + 1);
+	  else
+	      ppaa[0] = ptarray_construct (ctx, has_z, has_m, rng->Points);
+	  for (iv = 0; iv < rng->Points; iv++)
+	    {
+		/* copying vertices - Exterior Ring */
+		if (gaia->DimensionModel == GAIA_XY_Z)
+		  {
+		      gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_M)
+		  {
+		      gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_Z_M)
+		  {
+		      gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
+		  }
+		else
+		  {
+		      gaiaGetPoint (rng->Coords, iv, &x, &y);
+		  }
+		point.x = x;
+		point.y = y;
+		if (has_z)
+		    point.z = z;
+		if (has_m)
+		    point.m = m;
+		ptarray_set_point4d (ctx, ppaa[0], iv, &point);
+	    }
+	  if (close_ring)
+	    {
+		/* making an unclosed ring to be closed */
+		if (gaia->DimensionModel == GAIA_XY_Z)
+		  {
+		      gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_M)
+		  {
+		      gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+		  }
+		else if (gaia->DimensionModel == GAIA_XY_Z_M)
+		  {
+		      gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
+		  }
+		else
+		  {
+		      gaiaGetPoint (rng->Coords, 0, &x, &y);
+		  }
+		point.x = x;
+		point.y = y;
+		if (has_z)
+		    point.z = z;
+		if (has_m)
+		    point.m = m;
+		ptarray_set_point4d (ctx, ppaa[0], rng->Points, &point);
+	    }
+	  for (ib = 0; ib < pg->NumInteriors; ib++)
+	    {
+		/* copying vertices - Interior Rings */
+		rng = pg->Interiors + ib;
+		close_ring = check_unclosed_ring (rng);
+		if (close_ring)
+		    ppaa[1 + ib] =
+			ptarray_construct (ctx, has_z, has_m, rng->Points + 1);
+		else
+		    ppaa[1 + ib] =
+			ptarray_construct (ctx, has_z, has_m, rng->Points);
+		for (iv = 0; iv < rng->Points; iv++)
+		  {
+		      if (gaia->DimensionModel == GAIA_XY_Z)
+			{
+			    gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_M)
+			{
+			    gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			{
+			    gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
+			}
+		      else
+			{
+			    gaiaGetPoint (rng->Coords, iv, &x, &y);
+			}
+		      point.x = x;
+		      point.y = y;
+		      if (has_z)
+			  point.z = z;
+		      if (has_m)
+			  point.m = m;
+		      ptarray_set_point4d (ctx, ppaa[1 + ib], iv, &point);
+		  }
+		if (close_ring)
+		  {
+		      /* making an unclosed ring to be closed */
+		      if (gaia->DimensionModel == GAIA_XY_Z)
+			{
+			    gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_M)
+			{
+			    gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			{
+			    gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
+			}
+		      else
+			{
+			    gaiaGetPoint (rng->Coords, 0, &x, &y);
+			}
+		      point.x = x;
+		      point.y = y;
+		      if (has_z)
+			  point.z = z;
+		      if (has_m)
+			  point.m = m;
+		      ptarray_set_point4d (ctx, ppaa[1 + ib], rng->Points,
+					   &point);
+		  }
+	    }
+	  return (RTGEOM *) rtpoly_construct (ctx, gaia->Srid, NULL, ngeoms + 1,
+					      ppaa);
+      }
+    else
+      {
+	  /* some Collection */
+	  switch (gaia->DeclaredType)
+	    {
+	    case GAIA_POINT:
+		type = RTPOINTTYPE;
+		break;
+	    case GAIA_LINESTRING:
+		type = RTLINETYPE;
+		break;
+	    case GAIA_POLYGON:
+		type = RTPOLYGONTYPE;
+		break;
+	    case GAIA_MULTIPOINT:
+		type = RTMULTIPOINTTYPE;
+		break;
+	    case GAIA_MULTILINESTRING:
+		type = RTMULTILINETYPE;
+		break;
+	    case GAIA_MULTIPOLYGON:
+		type = RTMULTIPOLYGONTYPE;
+		break;
+	    case GAIA_GEOMETRYCOLLECTION:
+		type = RTCOLLECTIONTYPE;
+		break;
+	    default:
+		if (lns == 0 && pgs == 0)
+		    type = RTMULTIPOINTTYPE;
+		else if (pts == 0 && pgs == 0)
+		    type = RTMULTILINETYPE;
+		else if (pts == 0 && lns == 0)
+		    type = RTMULTIPOLYGONTYPE;
+		else
+		    type = RTCOLLECTIONTYPE;
+		break;
+	    };
+	  numg = pts + lns + pgs;
+	  geoms = rtalloc (ctx, sizeof (RTGEOM *) * numg);
+
+	  numg = 0;
+	  pt = gaia->FirstPoint;
+	  while (pt)
+	    {
+		/* copying POINTs */
+		has_z = 0;
+		has_m = 0;
+		if (gaia->DimensionModel == GAIA_XY_Z
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_z = 1;
+		if (gaia->DimensionModel == GAIA_XY_M
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_m = 1;
+		pa = ptarray_construct (ctx, has_z, has_m, 1);
+		point.x = pt->X;
+		point.y = pt->Y;
+		if (has_z)
+		    point.z = pt->Z;
+		if (has_m)
+		    point.m = pt->M;
+		ptarray_set_point4d (ctx, pa, 0, &point);
+		geoms[numg++] =
+		    (RTGEOM *) rtpoint_construct (ctx, gaia->Srid, NULL, pa);
+		pt = pt->Next;
+	    }
+	  ln = gaia->FirstLinestring;
+	  while (ln)
+	    {
+		/* copying LINESTRINGs */
+		has_z = 0;
+		has_m = 0;
+		if (gaia->DimensionModel == GAIA_XY_Z
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_z = 1;
+		if (gaia->DimensionModel == GAIA_XY_M
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_m = 1;
+		pa = ptarray_construct (ctx, has_z, has_m, ln->Points);
+		for (iv = 0; iv < ln->Points; iv++)
+		  {
+		      /* copying vertices */
+		      if (gaia->DimensionModel == GAIA_XY_Z)
+			{
+			    gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_M)
+			{
+			    gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			{
+			    gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
+			}
+		      else
+			{
+			    gaiaGetPoint (ln->Coords, iv, &x, &y);
+			}
+		      point.x = x;
+		      point.y = y;
+		      if (has_z)
+			  point.z = z;
+		      if (has_m)
+			  point.m = m;
+		      ptarray_set_point4d (ctx, pa, iv, &point);
+		  }
+		geoms[numg++] =
+		    (RTGEOM *) rtline_construct (ctx, gaia->Srid, NULL, pa);
+		ln = ln->Next;
+	    }
+	  pg = gaia->FirstPolygon;
+	  while (pg)
+	    {
+		/* copying POLYGONs */
+		has_z = 0;
+		has_m = 0;
+		if (gaia->DimensionModel == GAIA_XY_Z
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_z = 1;
+		if (gaia->DimensionModel == GAIA_XY_M
+		    || gaia->DimensionModel == GAIA_XY_Z_M)
+		    has_m = 1;
+		ngeoms = pg->NumInteriors;
+		ppaa = rtalloc (ctx, sizeof (RTPOINTARRAY *) * (ngeoms + 1));
+		rng = pg->Exterior;
+		close_ring = check_unclosed_ring (rng);
+		if (close_ring)
+		    ppaa[0] =
+			ptarray_construct (ctx, has_z, has_m, rng->Points + 1);
+		else
+		    ppaa[0] =
+			ptarray_construct (ctx, has_z, has_m, rng->Points);
+		for (iv = 0; iv < rng->Points; iv++)
+		  {
+		      /* copying vertices - Exterior Ring */
+		      if (gaia->DimensionModel == GAIA_XY_Z)
+			{
+			    gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_M)
+			{
+			    gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			{
+			    gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
+			}
+		      else
+			{
+			    gaiaGetPoint (rng->Coords, iv, &x, &y);
+			}
+		      point.x = x;
+		      point.y = y;
+		      if (has_z)
+			  point.z = z;
+		      if (has_m)
+			  point.m = m;
+		      ptarray_set_point4d (ctx, ppaa[0], iv, &point);
+		  }
+		if (close_ring)
+		  {
+		      /* making an unclosed ring to be closed */
+		      if (gaia->DimensionModel == GAIA_XY_Z)
+			{
+			    gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_M)
+			{
+			    gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+			}
+		      else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			{
+			    gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
+			}
+		      else
+			{
+			    gaiaGetPoint (rng->Coords, 0, &x, &y);
+			}
+		      point.x = x;
+		      point.y = y;
+		      if (has_z)
+			  point.z = z;
+		      if (has_m)
+			  point.m = m;
+		      ptarray_set_point4d (ctx, ppaa[0], rng->Points, &point);
+		  }
+		for (ib = 0; ib < pg->NumInteriors; ib++)
+		  {
+		      /* copying vertices - Interior Rings */
+		      rng = pg->Interiors + ib;
+		      close_ring = check_unclosed_ring (rng);
+		      if (close_ring)
+			  ppaa[1 + ib] =
+			      ptarray_construct (ctx, has_z, has_m,
+						 rng->Points + 1);
+		      else
+			  ppaa[1 + ib] =
+			      ptarray_construct (ctx, has_z, has_m,
+						 rng->Points);
+		      for (iv = 0; iv < rng->Points; iv++)
+			{
+			    if (gaia->DimensionModel == GAIA_XY_Z)
+			      {
+				  gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+			      }
+			    else if (gaia->DimensionModel == GAIA_XY_M)
+			      {
+				  gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+			      }
+			    else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			      {
+				  gaiaGetPointXYZM (rng->Coords, iv, &x, &y,
+						    &z, &m);
+			      }
+			    else
+			      {
+				  gaiaGetPoint (rng->Coords, iv, &x, &y);
+			      }
+			    point.x = x;
+			    point.y = y;
+			    if (has_z)
+				point.z = z;
+			    if (has_m)
+				point.m = m;
+			    ptarray_set_point4d (ctx, ppaa[1 + ib], iv, &point);
+			}
+		      if (close_ring)
+			{
+			    /* making an unclosed ring to be closed */
+			    if (gaia->DimensionModel == GAIA_XY_Z)
+			      {
+				  gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+			      }
+			    else if (gaia->DimensionModel == GAIA_XY_M)
+			      {
+				  gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+			      }
+			    else if (gaia->DimensionModel == GAIA_XY_Z_M)
+			      {
+				  gaiaGetPointXYZM (rng->Coords, 0, &x, &y,
+						    &z, &m);
+			      }
+			    else
+			      {
+				  gaiaGetPoint (rng->Coords, 0, &x, &y);
+			      }
+			    point.x = x;
+			    point.y = y;
+			    if (has_z)
+				point.z = z;
+			    if (has_m)
+				point.m = m;
+			    ptarray_set_point4d (ctx, ppaa[1 + ib], rng->Points,
+						 &point);
+			}
+		  }
+		geoms[numg++] =
+		    (RTGEOM *) rtpoly_construct (ctx, gaia->Srid, NULL,
+						 ngeoms + 1, ppaa);
+		pg = pg->Next;
+	    }
+	  return (RTGEOM *) rtcollection_construct (ctx, type, gaia->Srid, NULL,
+						    numg, geoms);
+      }
+    return NULL;
+}
+
+static gaiaGeomCollPtr
+fromRTGeomIncremental (const RTCTX * ctx, gaiaGeomCollPtr gaia,
+		       const RTGEOM * rtgeom)
+{
+/* converting a RTGEOM Geometry into a GAIA Geometry */
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+    gaiaRingPtr rng;
+    int dimension_model = gaia->DimensionModel;
+    int declared_type = gaia->DeclaredType;
+    RTGEOM *rtg2 = NULL;
+    RTPOINT *rtp = NULL;
+    RTLINE *rtl = NULL;
+    RTPOLY *rtpoly = NULL;
+    RTCOLLECTION *rtc = NULL;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
+    int has_z;
+    int has_m;
+    int iv;
+    int ib;
+    int ngeoms;
+    int ng;
+    double x;
+    double y;
+    double z;
+    double m;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    switch (rtgeom->type)
+      {
+      case RTPOINTTYPE:
+	  rtp = (RTPOINT *) rtgeom;
+	  has_z = 0;
+	  has_m = 0;
+	  pa = rtp->point;
+	  if (RTFLAGS_GET_Z (pa->flags))
+	      has_z = 1;
+	  if (RTFLAGS_GET_M (pa->flags))
+	      has_m = 1;
+	  rt_getPoint4d_p (ctx, pa, 0, &pt4d);
+	  x = pt4d.x;
+	  y = pt4d.y;
+	  if (has_z)
+	      z = pt4d.z;
+	  else
+	      z = 0.0;
+	  if (has_m)
+	      m = pt4d.m;
+	  else
+	      m = 0.0;
+	  if (dimension_model == GAIA_XY_Z)
+	      gaiaAddPointToGeomCollXYZ (gaia, x, y, z);
+	  else if (dimension_model == GAIA_XY_M)
+	      gaiaAddPointToGeomCollXYM (gaia, x, y, m);
+	  else if (dimension_model == GAIA_XY_Z_M)
+	      gaiaAddPointToGeomCollXYZM (gaia, x, y, z, m);
+	  else
+	      gaiaAddPointToGeomColl (gaia, x, y);
+	  if (declared_type == GAIA_MULTIPOINT)
+	      gaia->DeclaredType = GAIA_MULTIPOINT;
+	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
+	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+	  else
+	      gaia->DeclaredType = GAIA_POINT;
+	  break;
+      case RTLINETYPE:
+	  rtl = (RTLINE *) rtgeom;
+	  has_z = 0;
+	  has_m = 0;
+	  pa = rtl->points;
+	  if (RTFLAGS_GET_Z (pa->flags))
+	      has_z = 1;
+	  if (RTFLAGS_GET_M (pa->flags))
+	      has_m = 1;
+	  ln = gaiaAddLinestringToGeomColl (gaia, pa->npoints);
+	  for (iv = 0; iv < pa->npoints; iv++)
+	    {
+		/* copying LINESTRING vertices */
+		rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+		x = pt4d.x;
+		y = pt4d.y;
+		if (has_z)
+		    z = pt4d.z;
+		else
+		    z = 0.0;
+		if (has_m)
+		    m = pt4d.m;
+		else
+		    m = 0.0;
+		if (dimension_model == GAIA_XY_Z)
+		  {
+		      gaiaSetPointXYZ (ln->Coords, iv, x, y, z);
+		  }
+		else if (dimension_model == GAIA_XY_M)
+		  {
+		      gaiaSetPointXYM (ln->Coords, iv, x, y, m);
+		  }
+		else if (dimension_model == GAIA_XY_Z_M)
+		  {
+		      gaiaSetPointXYZM (ln->Coords, iv, x, y, z, m);
+		  }
+		else
+		  {
+		      gaiaSetPoint (ln->Coords, iv, x, y);
+		  }
+	    }
+	  if (declared_type == GAIA_MULTILINESTRING)
+	      gaia->DeclaredType = GAIA_MULTILINESTRING;
+	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
+	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+	  else
+	      gaia->DeclaredType = GAIA_LINESTRING;
+	  break;
+      case RTPOLYGONTYPE:
+	  rtpoly = (RTPOLY *) rtgeom;
+	  has_z = 0;
+	  has_m = 0;
+	  pa = rtpoly->rings[0];
+	  if (RTFLAGS_GET_Z (pa->flags))
+	      has_z = 1;
+	  if (RTFLAGS_GET_M (pa->flags))
+	      has_m = 1;
+	  pg = gaiaAddPolygonToGeomColl (gaia, pa->npoints, rtpoly->nrings - 1);
+	  rng = pg->Exterior;
+	  for (iv = 0; iv < pa->npoints; iv++)
+	    {
+		/* copying Exterion Ring vertices */
+		rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+		x = pt4d.x;
+		y = pt4d.y;
+		if (has_z)
+		    z = pt4d.z;
+		else
+		    z = 0.0;
+		if (has_m)
+		    m = pt4d.m;
+		else
+		    m = 0.0;
+		if (dimension_model == GAIA_XY_Z)
+		  {
+		      gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
+		  }
+		else if (dimension_model == GAIA_XY_M)
+		  {
+		      gaiaSetPointXYM (rng->Coords, iv, x, y, m);
+		  }
+		else if (dimension_model == GAIA_XY_Z_M)
+		  {
+		      gaiaSetPointXYZM (rng->Coords, iv, x, y, z, m);
+		  }
+		else
+		  {
+		      gaiaSetPoint (rng->Coords, iv, x, y);
+		  }
+	    }
+	  for (ib = 1; ib < rtpoly->nrings; ib++)
+	    {
+		has_z = 0;
+		has_m = 0;
+		pa = rtpoly->rings[ib];
+		if (RTFLAGS_GET_Z (pa->flags))
+		    has_z = 1;
+		if (RTFLAGS_GET_M (pa->flags))
+		    has_m = 1;
+		rng = gaiaAddInteriorRing (pg, ib - 1, pa->npoints);
+		for (iv = 0; iv < pa->npoints; iv++)
+		  {
+		      /* copying Exterion Ring vertices */
+		      rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+		      x = pt4d.x;
+		      y = pt4d.y;
+		      if (has_z)
+			  z = pt4d.z;
+		      else
+			  z = 0.0;
+		      if (has_m)
+			  m = pt4d.m;
+		      else
+			  m = 0.0;
+		      if (dimension_model == GAIA_XY_Z)
+			{
+			    gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
+			}
+		      else if (dimension_model == GAIA_XY_M)
+			{
+			    gaiaSetPointXYM (rng->Coords, iv, x, y, m);
+			}
+		      else if (dimension_model == GAIA_XY_Z_M)
+			{
+			    gaiaSetPointXYZM (rng->Coords, iv, x, y, z, m);
+			}
+		      else
+			{
+			    gaiaSetPoint (rng->Coords, iv, x, y);
+			}
+		  }
+	    }
+	  if (declared_type == GAIA_MULTIPOLYGON)
+	      gaia->DeclaredType = GAIA_MULTIPOLYGON;
+	  else if (declared_type == GAIA_GEOMETRYCOLLECTION)
+	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+	  else
+	      gaia->DeclaredType = GAIA_POLYGON;
+	  break;
+      case RTMULTIPOINTTYPE:
+      case RTMULTILINETYPE:
+      case RTMULTIPOLYGONTYPE:
+      case RTCOLLECTIONTYPE:
+	  if (rtgeom->type == RTMULTIPOINTTYPE)
+	    {
+		if (declared_type == GAIA_GEOMETRYCOLLECTION)
+		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+		else
+		    gaia->DeclaredType = GAIA_MULTIPOINT;
+	    }
+	  else if (rtgeom->type == RTMULTILINETYPE)
+	    {
+		if (declared_type == GAIA_GEOMETRYCOLLECTION)
+		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+		else
+		    gaia->DeclaredType = GAIA_MULTILINESTRING;
+	    }
+	  else if (rtgeom->type == RTMULTIPOLYGONTYPE)
+	    {
+		if (declared_type == GAIA_GEOMETRYCOLLECTION)
+		    gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+		else
+		    gaia->DeclaredType = GAIA_MULTIPOLYGON;
+	    }
+	  else
+	      gaia->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+
+	  rtc = (RTCOLLECTION *) rtgeom;
+	  ngeoms = rtc->ngeoms;
+	  if (ngeoms == 0)
+	    {
+		gaiaFreeGeomColl (gaia);
+		gaia = NULL;
+		break;
+	    }
+	  for (ng = 0; ng < ngeoms; ++ng)
+	    {
+		/* looping on elementary geometries */
+		rtg2 = rtc->geoms[ng];
+		switch (rtg2->type)
+		  {
+		  case RTPOINTTYPE:
+		      rtp = (RTPOINT *) rtg2;
+		      has_z = 0;
+		      has_m = 0;
+		      pa = rtp->point;
+		      if (RTFLAGS_GET_Z (pa->flags))
+			  has_z = 1;
+		      if (RTFLAGS_GET_M (pa->flags))
+			  has_m = 1;
+		      rt_getPoint4d_p (ctx, pa, 0, &pt4d);
+		      x = pt4d.x;
+		      y = pt4d.y;
+		      if (has_z)
+			  z = pt4d.z;
+		      else
+			  z = 0.0;
+		      if (has_m)
+			  m = pt4d.m;
+		      else
+			  m = 0.0;
+		      if (dimension_model == GAIA_XY_Z)
+			  gaiaAddPointToGeomCollXYZ (gaia, x, y, z);
+		      else if (dimension_model == GAIA_XY_M)
+			  gaiaAddPointToGeomCollXYM (gaia, x, y, m);
+		      else if (dimension_model == GAIA_XY_Z_M)
+			  gaiaAddPointToGeomCollXYZM (gaia, x, y, z, m);
+		      else
+			  gaiaAddPointToGeomColl (gaia, x, y);
+		      break;
+		  case RTLINETYPE:
+		      rtl = (RTLINE *) rtg2;
+		      has_z = 0;
+		      has_m = 0;
+		      pa = rtl->points;
+		      if (RTFLAGS_GET_Z (pa->flags))
+			  has_z = 1;
+		      if (RTFLAGS_GET_M (pa->flags))
+			  has_m = 1;
+		      ln = gaiaAddLinestringToGeomColl (gaia, pa->npoints);
+		      for (iv = 0; iv < pa->npoints; iv++)
+			{
+			    /* copying LINESTRING vertices */
+			    rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+			    x = pt4d.x;
+			    y = pt4d.y;
+			    if (has_z)
+				z = pt4d.z;
+			    else
+				z = 0.0;
+			    if (has_m)
+				m = pt4d.m;
+			    else
+				m = 0.0;
+			    if (dimension_model == GAIA_XY_Z)
+			      {
+				  gaiaSetPointXYZ (ln->Coords, iv, x, y, z);
+			      }
+			    else if (dimension_model == GAIA_XY_M)
+			      {
+				  gaiaSetPointXYM (ln->Coords, iv, x, y, m);
+			      }
+			    else if (dimension_model == GAIA_XY_Z_M)
+			      {
+				  gaiaSetPointXYZM (ln->Coords, iv, x, y, z, m);
+			      }
+			    else
+			      {
+				  gaiaSetPoint (ln->Coords, iv, x, y);
+			      }
+			}
+		      break;
+		  case RTPOLYGONTYPE:
+		      rtpoly = (RTPOLY *) rtg2;
+		      has_z = 0;
+		      has_m = 0;
+		      pa = rtpoly->rings[0];
+		      if (RTFLAGS_GET_Z (pa->flags))
+			  has_z = 1;
+		      if (RTFLAGS_GET_M (pa->flags))
+			  has_m = 1;
+		      pg = gaiaAddPolygonToGeomColl (gaia, pa->npoints,
+						     rtpoly->nrings - 1);
+		      rng = pg->Exterior;
+		      for (iv = 0; iv < pa->npoints; iv++)
+			{
+			    /* copying Exterion Ring vertices */
+			    rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+			    x = pt4d.x;
+			    y = pt4d.y;
+			    if (has_z)
+				z = pt4d.z;
+			    else
+				z = 0.0;
+			    if (has_m)
+				m = pt4d.m;
+			    else
+				m = 0.0;
+			    if (dimension_model == GAIA_XY_Z)
+			      {
+				  gaiaSetPointXYZ (rng->Coords, iv, x, y, z);
+			      }
+			    else if (dimension_model == GAIA_XY_M)
+			      {
+				  gaiaSetPointXYM (rng->Coords, iv, x, y, m);
+			      }
+			    else if (dimension_model == GAIA_XY_Z_M)
+			      {
+				  gaiaSetPointXYZM (rng->Coords, iv, x, y, z,
+						    m);
+			      }
+			    else
+			      {
+				  gaiaSetPoint (rng->Coords, iv, x, y);
+			      }
+			}
+		      for (ib = 1; ib < rtpoly->nrings; ib++)
+			{
+			    has_z = 0;
+			    has_m = 0;
+			    pa = rtpoly->rings[ib];
+			    if (RTFLAGS_GET_Z (pa->flags))
+				has_z = 1;
+			    if (RTFLAGS_GET_M (pa->flags))
+				has_m = 1;
+			    rng = gaiaAddInteriorRing (pg, ib - 1, pa->npoints);
+			    for (iv = 0; iv < pa->npoints; iv++)
+			      {
+				  /* copying Exterion Ring vertices */
+				  rt_getPoint4d_p (ctx, pa, iv, &pt4d);
+				  x = pt4d.x;
+				  y = pt4d.y;
+				  if (has_z)
+				      z = pt4d.z;
+				  else
+				      z = 0.0;
+				  if (has_m)
+				      m = pt4d.m;
+				  else
+				      m = 0.0;
+				  if (dimension_model == GAIA_XY_Z)
+				    {
+					gaiaSetPointXYZ (rng->Coords, iv, x,
+							 y, z);
+				    }
+				  else if (dimension_model == GAIA_XY_M)
+				    {
+					gaiaSetPointXYM (rng->Coords, iv, x,
+							 y, m);
+				    }
+				  else if (dimension_model == GAIA_XY_Z_M)
+				    {
+					gaiaSetPointXYZM (rng->Coords, iv, x,
+							  y, z, m);
+				    }
+				  else
+				    {
+					gaiaSetPoint (rng->Coords, iv, x, y);
+				    }
+			      }
+			}
+		      break;
+		  };
+	    }
+	  break;
+      default:
+	  gaiaFreeGeomColl (gaia);
+	  gaia = NULL;
+	  break;
+      };
+
+    return gaia;
+}
+
+static gaiaGeomCollPtr
+fromRTGeom (const RTCTX * ctx, const RTGEOM * rtgeom, const int dimension_model,
+	    const int declared_type)
+{
+/* converting a RTGEOM Geometry into a GAIA Geometry */
+    gaiaGeomCollPtr gaia = NULL;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    if (dimension_model == GAIA_XY_Z)
+	gaia = gaiaAllocGeomCollXYZ ();
+    else if (dimension_model == GAIA_XY_M)
+	gaia = gaiaAllocGeomCollXYM ();
+    else if (dimension_model == GAIA_XY_Z_M)
+	gaia = gaiaAllocGeomCollXYZM ();
+    else
+	gaia = gaiaAllocGeomColl ();
+    gaia->DeclaredType = declared_type;
+    fromRTGeomIncremental (ctx, gaia, rtgeom);
+
+    return gaia;
+}
+
+static int
+check_valid_type (const RTGEOM * rtgeom, int declared_type)
+{
+/* checking if the geometry type is a valid one */
+    int ret = 0;
+    switch (rtgeom->type)
+      {
+      case RTPOINTTYPE:
+      case RTMULTIPOINTTYPE:
+	  if (declared_type == GAIA_POINT || declared_type == GAIA_POINTZ
+	      || declared_type == GAIA_POINTM || declared_type == GAIA_POINTZM)
+	      ret = 1;
+	  if (declared_type == GAIA_MULTIPOINT
+	      || declared_type == GAIA_MULTIPOINTZ
+	      || declared_type == GAIA_MULTIPOINTM
+	      || declared_type == GAIA_MULTIPOINTZM)
+	      ret = 1;
+	  break;
+      case RTLINETYPE:
+      case RTMULTILINETYPE:
+	  if (declared_type == GAIA_LINESTRING
+	      || declared_type == GAIA_LINESTRINGZ
+	      || declared_type == GAIA_LINESTRINGM
+	      || declared_type == GAIA_LINESTRINGZM)
+	      ret = 1;
+	  if (declared_type == GAIA_MULTILINESTRING
+	      || declared_type == GAIA_MULTILINESTRINGZ
+	      || declared_type == GAIA_MULTILINESTRINGM
+	      || declared_type == GAIA_MULTILINESTRINGZM)
+	      ret = 1;
+	  break;
+      case RTPOLYGONTYPE:
+      case RTMULTIPOLYGONTYPE:
+	  if (declared_type == GAIA_POLYGON || declared_type == GAIA_POLYGONZ
+	      || declared_type == GAIA_POLYGONM
+	      || declared_type == GAIA_POLYGONZM)
+	      ret = 1;
+	  if (declared_type == GAIA_MULTIPOLYGON
+	      || declared_type == GAIA_MULTIPOLYGONZ
+	      || declared_type == GAIA_MULTIPOLYGONM
+	      || declared_type == GAIA_MULTIPOLYGONZM)
+	      ret = 1;
+	  break;
+      case RTCOLLECTIONTYPE:
+	  if (declared_type == GAIA_GEOMETRYCOLLECTION
+	      || declared_type == GAIA_GEOMETRYCOLLECTIONZ
+	      || declared_type == GAIA_GEOMETRYCOLLECTIONM
+	      || declared_type == GAIA_GEOMETRYCOLLECTIONZM)
+	      ret = 1;
+	  break;
+      };
+    return ret;
+}
+
+static gaiaGeomCollPtr
+fromRTGeomValidated (const RTCTX * ctx, const RTGEOM * rtgeom,
+		     const int dimension_model, const int declared_type)
+{
+/* 
+/ converting a RTGEOM Geometry into a GAIA Geometry 
+/ first collection - validated items
+*/
+    gaiaGeomCollPtr gaia = NULL;
+    RTGEOM *rtg2 = NULL;
+    RTCOLLECTION *rtc = NULL;
+    int ngeoms;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    switch (rtgeom->type)
+      {
+      case RTCOLLECTIONTYPE:
+	  rtc = (RTCOLLECTION *) rtgeom;
+	  ngeoms = rtc->ngeoms;
+	  if (ngeoms <= 2)
+	    {
+		rtg2 = rtc->geoms[0];
+		if (check_valid_type (rtg2, declared_type))
+		    gaia =
+			fromRTGeom (ctx, rtg2, dimension_model, declared_type);
+	    }
+	  break;
+      default:
+	  if (check_valid_type (rtgeom, declared_type))
+	      gaia = fromRTGeom (ctx, rtgeom, dimension_model, declared_type);
+	  if (gaia == NULL)
+	    {
+		/* Andrea Peri: 2013-05-02 returning anyway the RTGEOM geometry,
+		   / even if it has a mismatching type */
+		int type = -1;
+		switch (rtgeom->type)
+		  {
+		  case RTPOINTTYPE:
+		      type = GAIA_POINT;
+		      break;
+		  case RTLINETYPE:
+		      type = GAIA_LINESTRING;
+		      break;
+		  case RTPOLYGONTYPE:
+		      type = GAIA_POLYGON;
+		      break;
+		  case RTMULTIPOINTTYPE:
+		      type = GAIA_MULTIPOINT;
+		      break;
+		  case RTMULTILINETYPE:
+		      type = GAIA_MULTILINESTRING;
+		      break;
+		  case RTMULTIPOLYGONTYPE:
+		      type = GAIA_MULTIPOLYGON;
+		      break;
+		  };
+		if (type >= 0)
+		    gaia = fromRTGeom (ctx, rtgeom, dimension_model, type);
+	    }
+	  break;
+      }
+    return gaia;
+}
+
+static gaiaGeomCollPtr
+fromRTGeomDiscarded (const RTCTX * ctx, const RTGEOM * rtgeom,
+		     const int dimension_model, const int declared_type)
+{
+/* 
+/ converting a RTGEOM Geometry into a GAIA Geometry 
+/ second collection - discarded items
+*/
+    gaiaGeomCollPtr gaia = NULL;
+    RTGEOM *rtg2 = NULL;
+    RTCOLLECTION *rtc = NULL;
+    int ngeoms;
+    int ig;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    if (rtgeom->type == RTCOLLECTIONTYPE)
+      {
+	  if (dimension_model == GAIA_XY_Z)
+	      gaia = gaiaAllocGeomCollXYZ ();
+	  else if (dimension_model == GAIA_XY_M)
+	      gaia = gaiaAllocGeomCollXYM ();
+	  else if (dimension_model == GAIA_XY_Z_M)
+	      gaia = gaiaAllocGeomCollXYZM ();
+	  else
+	      gaia = gaiaAllocGeomColl ();
+	  rtc = (RTCOLLECTION *) rtgeom;
+	  ngeoms = rtc->ngeoms;
+	  for (ig = 0; ig < ngeoms; ig++)
+	    {
+		rtg2 = rtc->geoms[ig];
+		if (!check_valid_type (rtg2, declared_type))
+		    fromRTGeomIncremental (ctx, gaia, rtg2);
+	    }
+      }
+/*
+Andrea Peri: 2013-05-02
+when a single geometry is returned by RTGEOM it's always "valid"
+and there are no discarded items at all
+
+    else if (!check_valid_type (lwgeom, declared_type))
+	gaia = fromRTGeom (lwgeom, dimension_model, declared_type);
+*/
+    return gaia;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaMakeValid (const void *p_cache, gaiaGeomCollPtr geom)
+{
+/* wrapping RTGEOM MakeValid [collecting valid items] */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    gaiaGeomCollPtr result = NULL;
+
+    if (!geom)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g1 = toRTGeom (ctx, geom);
+    g2 = rtgeom_make_valid (ctx, g1);
+    if (!g2)
+      {
+	  rtgeom_free (ctx, g1);
+	  goto done;
+      }
+    result =
+	fromRTGeomValidated (ctx, g2, geom->DimensionModel, geom->DeclaredType);
+    spatialite_init_geos ();
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    result->Srid = geom->Srid;
+
+  done:
+    return result;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaMakeValidDiscarded (const void *p_cache, gaiaGeomCollPtr geom)
+{
+/* wrapping RTGEOM MakeValid [collecting discarder items] */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    gaiaGeomCollPtr result = NULL;
+
+    if (!geom)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g1 = toRTGeom (ctx, geom);
+    g2 = rtgeom_make_valid (ctx, g1);
+    if (!g2)
+      {
+	  rtgeom_free (ctx, g1);
+	  goto done;
+      }
+    result =
+	fromRTGeomDiscarded (ctx, g2, geom->DimensionModel, geom->DeclaredType);
+    spatialite_init_geos ();
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    result->Srid = geom->Srid;
+
+  done:
+    return result;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaSegmentize (const void *p_cache, gaiaGeomCollPtr geom, double dist)
+{
+/* wrapping RTGEOM Segmentize */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    gaiaGeomCollPtr result = NULL;
+
+    if (!geom)
+	return NULL;
+    if (dist <= 0.0)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g1 = toRTGeom (ctx, geom);
+    g2 = rtgeom_segmentize2d (ctx, g1, dist);
+    if (!g2)
+      {
+	  rtgeom_free (ctx, g1);
+	  goto done;
+      }
+    result = fromRTGeom (ctx, g2, geom->DimensionModel, geom->DeclaredType);
+    spatialite_init_geos ();
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    result->Srid = geom->Srid;
+
+  done:
+    return result;
+}
+
+static int
+check_split_args (gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
+{
+/* testing Split arguments */
+    gaiaPointPtr pt;
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+    int i_lns = 0;
+    int i_pgs = 0;
+    int b_pts = 0;
+    int b_lns = 0;
+
+    if (!input)
+	return 0;
+    if (!blade)
+	return 0;
+
+/* testing the Input type */
+    if (input->FirstPoint != NULL)
+      {
+	  /* Point(s) on Input is forbidden !!!! */
+	  return 0;
+      }
+    ln = input->FirstLinestring;
+    while (ln)
+      {
+	  /* counting how many Linestrings are there */
+	  i_lns++;
+	  ln = ln->Next;
+      }
+    pg = input->FirstPolygon;
+    while (pg)
+      {
+	  /* counting how many Polygons are there */
+	  i_pgs++;
+	  pg = pg->Next;
+      }
+    if (i_lns + i_pgs == 0)
+      {
+	  /* empty Input */
+	  return 0;
+      }
+
+/* testing the Blade type */
+    pt = blade->FirstPoint;
+    while (pt)
+      {
+	  /* counting how many Points are there */
+	  b_pts++;
+	  pt = pt->Next;
+      }
+    ln = blade->FirstLinestring;
+    while (ln)
+      {
+	  /* counting how many Linestrings are there */
+	  b_lns++;
+	  ln = ln->Next;
+      }
+    if (blade->FirstPolygon != NULL)
+      {
+	  /* Polygon(s) on Blade is forbidden !!!! */
+	  return 0;
+      }
+    if (b_pts + b_lns == 0)
+      {
+	  /* empty Blade */
+	  return 0;
+      }
+    if (b_pts >= 1 && b_lns >= 1)
+      {
+	  /* invalid Blade [point + linestring] */
+	  return 0;
+      }
+
+/* compatibility check */
+    if (b_lns >= 1)
+      {
+	  /* Linestring blade is always valid */
+	  return 1;
+      }
+    if (i_lns >= 1 && b_pts >= 1)
+      {
+	  /* Linestring or MultiLinestring input and Point blade is allowed */
+	  return 1;
+      }
+
+    return 0;
+}
+
+static void
+set_split_gtype (gaiaGeomCollPtr geom)
+{
+/* assignign the actual geometry type */
+    gaiaPointPtr pt;
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+    int pts = 0;
+    int lns = 0;
+    int pgs = 0;
+
+    pt = geom->FirstPoint;
+    while (pt)
+      {
+	  /* counting how many Points are there */
+	  pts++;
+	  pt = pt->Next;
+      }
+    ln = geom->FirstLinestring;
+    while (ln)
+      {
+	  /* counting how many Linestrings are there */
+	  lns++;
+	  ln = ln->Next;
+      }
+    pg = geom->FirstPolygon;
+    while (pg)
+      {
+	  /* counting how many Polygons are there */
+	  pgs++;
+	  pg = pg->Next;
+      }
+
+    if (pts == 1 && lns == 0 && pgs == 0)
+      {
+	  geom->DeclaredType = GAIA_POINT;
+	  return;
+      }
+    if (pts > 1 && lns == 0 && pgs == 0)
+      {
+	  geom->DeclaredType = GAIA_MULTIPOINT;
+	  return;
+      }
+    if (pts == 0 && lns == 1 && pgs == 0)
+      {
+	  geom->DeclaredType = GAIA_LINESTRING;
+	  return;
+      }
+    if (pts == 0 && lns > 1 && pgs == 0)
+      {
+	  geom->DeclaredType = GAIA_MULTILINESTRING;
+	  return;
+      }
+    if (pts == 0 && lns == 0 && pgs == 1)
+      {
+	  geom->DeclaredType = GAIA_POLYGON;
+	  return;
+      }
+    if (pts == 0 && lns == 0 && pgs > 1)
+      {
+	  geom->DeclaredType = GAIA_MULTIPOLYGON;
+	  return;
+      }
+    geom->DeclaredType = GAIA_GEOMETRYCOLLECTION;
+}
+
+static RTGEOM *
+toRTGeomLinestring (const RTCTX * ctx, gaiaLinestringPtr ln, int srid)
+{
+/* converting a GAIA Linestring into a RTGEOM Geometry */
+    int iv;
+    double x = 0.0;
+    double y = 0.0;
+    double z = 0.0;
+    double m = 0.0;
+    int has_z = 0;
+    int has_m = 0;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
+
+    if (ln->DimensionModel == GAIA_XY_Z || ln->DimensionModel == GAIA_XY_Z_M)
+	has_z = 1;
+    if (ln->DimensionModel == GAIA_XY_M || ln->DimensionModel == GAIA_XY_Z_M)
+	has_m = 1;
+    pa = ptarray_construct (ctx, has_z, has_m, ln->Points);
+    for (iv = 0; iv < ln->Points; iv++)
+      {
+	  /* copying vertices */
+	  if (ln->DimensionModel == GAIA_XY_Z)
+	    {
+		gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
+	    }
+	  else if (ln->DimensionModel == GAIA_XY_M)
+	    {
+		gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
+	    }
+	  else if (ln->DimensionModel == GAIA_XY_Z_M)
+	    {
+		gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
+	    }
+	  else
+	    {
+		gaiaGetPoint (ln->Coords, iv, &x, &y);
+	    }
+	  point.x = x;
+	  point.y = y;
+	  if (has_z)
+	      point.z = z;
+	  if (has_m)
+	      point.m = m;
+	  ptarray_set_point4d (ctx, pa, iv, &point);
+      }
+    return (RTGEOM *) rtline_construct (ctx, srid, NULL, pa);
+}
+
+static RTGEOM *
+toRTGeomPolygon (const RTCTX * ctx, gaiaPolygonPtr pg, int srid)
+{
+/* converting a GAIA Linestring into a RTGEOM Geometry */
+    int iv;
+    int ib;
+    double x = 0.0;
+    double y = 0.0;
+    double z = 0.0;
+    double m = 0.0;
+    int ngeoms;
+    int has_z = 0;
+    int has_m = 0;
+    int close_ring;
+    gaiaRingPtr rng;
+    RTPOINTARRAY **ppaa;
+    RTPOINT4D point;
+
+    if (pg->DimensionModel == GAIA_XY_Z || pg->DimensionModel == GAIA_XY_Z_M)
+	has_z = 1;
+    if (pg->DimensionModel == GAIA_XY_M || pg->DimensionModel == GAIA_XY_Z_M)
+	has_m = 1;
+    ngeoms = pg->NumInteriors;
+    ppaa = rtalloc (ctx, sizeof (RTPOINTARRAY *) * (ngeoms + 1));
+    rng = pg->Exterior;
+    close_ring = check_unclosed_ring (rng);
+    if (close_ring)
+	ppaa[0] = ptarray_construct (ctx, has_z, has_m, rng->Points + 1);
+    else
+	ppaa[0] = ptarray_construct (ctx, has_z, has_m, rng->Points);
+    for (iv = 0; iv < rng->Points; iv++)
+      {
+	  /* copying vertices - Exterior Ring */
+	  if (pg->DimensionModel == GAIA_XY_Z)
+	    {
+		gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+	    }
+	  else if (pg->DimensionModel == GAIA_XY_M)
+	    {
+		gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+	    }
+	  else if (pg->DimensionModel == GAIA_XY_Z_M)
+	    {
+		gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
+	    }
+	  else
+	    {
+		gaiaGetPoint (rng->Coords, iv, &x, &y);
+	    }
+	  point.x = x;
+	  point.y = y;
+	  if (has_z)
+	      point.z = z;
+	  if (has_m)
+	      point.m = m;
+	  ptarray_set_point4d (ctx, ppaa[0], iv, &point);
+      }
+    if (close_ring)
+      {
+	  /* making an unclosed ring to be closed */
+	  if (pg->DimensionModel == GAIA_XY_Z)
+	    {
+		gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+	    }
+	  else if (pg->DimensionModel == GAIA_XY_M)
+	    {
+		gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+	    }
+	  else if (pg->DimensionModel == GAIA_XY_Z_M)
+	    {
+		gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
+	    }
+	  else
+	    {
+		gaiaGetPoint (rng->Coords, 0, &x, &y);
+	    }
+	  point.x = x;
+	  point.y = y;
+	  if (has_z)
+	      point.z = z;
+	  if (has_m)
+	      point.m = m;
+	  ptarray_set_point4d (ctx, ppaa[0], rng->Points, &point);
+      }
+    for (ib = 0; ib < pg->NumInteriors; ib++)
+      {
+	  /* copying vertices - Interior Rings */
+	  rng = pg->Interiors + ib;
+	  close_ring = check_unclosed_ring (rng);
+	  if (close_ring)
+	      ppaa[1 + ib] =
+		  ptarray_construct (ctx, has_z, has_m, rng->Points + 1);
+	  else
+	      ppaa[1 + ib] = ptarray_construct (ctx, has_z, has_m, rng->Points);
+	  for (iv = 0; iv < rng->Points; iv++)
+	    {
+		if (pg->DimensionModel == GAIA_XY_Z)
+		  {
+		      gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z);
+		  }
+		else if (pg->DimensionModel == GAIA_XY_M)
+		  {
+		      gaiaGetPointXYM (rng->Coords, iv, &x, &y, &m);
+		  }
+		else if (pg->DimensionModel == GAIA_XY_Z_M)
+		  {
+		      gaiaGetPointXYZM (rng->Coords, iv, &x, &y, &z, &m);
+		  }
+		else
+		  {
+		      gaiaGetPoint (rng->Coords, iv, &x, &y);
+		  }
+		point.x = x;
+		point.y = y;
+		if (has_z)
+		    point.z = z;
+		if (has_m)
+		    point.m = m;
+		ptarray_set_point4d (ctx, ppaa[1 + ib], iv, &point);
+	    }
+	  if (close_ring)
+	    {
+		/* making an unclosed ring to be closed */
+		if (pg->DimensionModel == GAIA_XY_Z)
+		  {
+		      gaiaGetPointXYZ (rng->Coords, 0, &x, &y, &z);
+		  }
+		else if (pg->DimensionModel == GAIA_XY_M)
+		  {
+		      gaiaGetPointXYM (rng->Coords, 0, &x, &y, &m);
+		  }
+		else if (pg->DimensionModel == GAIA_XY_Z_M)
+		  {
+		      gaiaGetPointXYZM (rng->Coords, 0, &x, &y, &z, &m);
+		  }
+		else
+		  {
+		      gaiaGetPoint (rng->Coords, 0, &x, &y);
+		  }
+		point.x = x;
+		point.y = y;
+		if (has_z)
+		    point.z = z;
+		if (has_m)
+		    point.m = m;
+		ptarray_set_point4d (ctx, ppaa[0], rng->Points, &point);
+	    }
+      }
+    return (RTGEOM *) rtpoly_construct (ctx, srid, NULL, ngeoms + 1, ppaa);
+}
+
+static gaiaGeomCollPtr
+fromRTGeomLeft (const RTCTX * ctx, gaiaGeomCollPtr gaia, const RTGEOM * rtgeom)
+{
+/* 
+/ converting a RTGEOM Geometry into a GAIA Geometry 
+/ collecting "left side" items
+*/
+    RTGEOM *rtg2 = NULL;
+    RTCOLLECTION *rtc = NULL;
+    int ngeoms;
+    int ig;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    if (rtgeom->type == RTCOLLECTIONTYPE)
+      {
+	  rtc = (RTCOLLECTION *) rtgeom;
+	  ngeoms = rtc->ngeoms;
+	  for (ig = 0; ig < ngeoms; ig += 2)
+	    {
+		rtg2 = rtc->geoms[ig];
+		fromRTGeomIncremental (ctx, gaia, rtg2);
+	    }
+      }
+    else
+	gaia =
+	    fromRTGeom (ctx, rtgeom, gaia->DimensionModel, gaia->DeclaredType);
+
+    return gaia;
+}
+
+static gaiaGeomCollPtr
+fromRTGeomRight (const RTCTX * ctx, gaiaGeomCollPtr gaia, const RTGEOM * rtgeom)
+{
+/* 
+/ converting a RTGEOM Geometry into a GAIA Geometry 
+/ collecting "right side" items
+*/
+    RTGEOM *rtg2 = NULL;
+    RTCOLLECTION *rtc = NULL;
+    int ngeoms;
+    int ig;
+
+    if (rtgeom == NULL)
+	return NULL;
+    if (rtgeom_is_empty (ctx, rtgeom))
+	return NULL;
+
+    if (rtgeom->type == RTCOLLECTIONTYPE)
+      {
+	  rtc = (RTCOLLECTION *) rtgeom;
+	  ngeoms = rtc->ngeoms;
+	  for (ig = 1; ig < ngeoms; ig += 2)
+	    {
+		rtg2 = rtc->geoms[ig];
+		fromRTGeomIncremental (ctx, gaia, rtg2);
+	    }
+      }
+
+    return gaia;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaSplit (const void *p_cache, gaiaGeomCollPtr input, gaiaGeomCollPtr blade)
+{
+/* wrapping RTGEOM Split */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    RTGEOM *g3;
+    gaiaGeomCollPtr result = NULL;
+
+    if (!check_split_args (input, blade))
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g1 = toRTGeom (ctx, input);
+    g2 = toRTGeom (ctx, blade);
+    g3 = rtgeom_split (ctx, g1, g2);
+    if (!g3)
+      {
+	  rtgeom_free (ctx, g1);
+	  rtgeom_free (ctx, g2);
+	  goto done;
+      }
+    result = fromRTGeom (ctx, g3, input->DimensionModel, input->DeclaredType);
+    spatialite_init_geos ();
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    rtgeom_free (ctx, g3);
+    if (result == NULL)
+	goto done;
+    result->Srid = input->Srid;
+    set_split_gtype (result);
+
+  done:
+    return result;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaSplitLeft (const void *p_cache, gaiaGeomCollPtr input,
+	       gaiaGeomCollPtr blade)
+{
+/* wrapping RTGEOM Split [left half] */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    RTGEOM *g3;
+    gaiaGeomCollPtr result = NULL;
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+
+    if (!check_split_args (input, blade))
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    if (input->DimensionModel == GAIA_XY_Z)
+	result = gaiaAllocGeomCollXYZ ();
+    else if (input->DimensionModel == GAIA_XY_M)
+	result = gaiaAllocGeomCollXYM ();
+    else if (input->DimensionModel == GAIA_XY_Z_M)
+	result = gaiaAllocGeomCollXYZM ();
+    else
+	result = gaiaAllocGeomColl ();
+
+    g2 = toRTGeom (ctx, blade);
+
+    ln = input->FirstLinestring;
+    while (ln)
+      {
+	  /* splitting some Linestring */
+	  g1 = toRTGeomLinestring (ctx, ln, input->Srid);
+	  g3 = rtgeom_split (ctx, g1, g2);
+	  if (g3)
+	    {
+		result = fromRTGeomLeft (ctx, result, g3);
+		rtgeom_free (ctx, g3);
+	    }
+	  spatialite_init_geos ();
+	  rtgeom_free (ctx, g1);
+	  ln = ln->Next;
+      }
+    pg = input->FirstPolygon;
+    while (pg)
+      {
+	  /* splitting some Polygon */
+	  g1 = toRTGeomPolygon (ctx, pg, input->Srid);
+	  g3 = rtgeom_split (ctx, g1, g2);
+	  if (g3)
+	    {
+		result = fromRTGeomLeft (ctx, result, g3);
+		rtgeom_free (ctx, g3);
+	    }
+	  spatialite_init_geos ();
+	  rtgeom_free (ctx, g1);
+	  pg = pg->Next;
+      }
+
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    if (result->FirstPoint == NULL && result->FirstLinestring == NULL
+	&& result->FirstPolygon == NULL)
+      {
+	  gaiaFreeGeomColl (result);
+	  result = NULL;
+	  goto done;
+      }
+    result->Srid = input->Srid;
+    set_split_gtype (result);
+
+  done:
+    return result;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaSplitRight (const void *p_cache, gaiaGeomCollPtr input,
+		gaiaGeomCollPtr blade)
+{
+/* wrapping RTGEOM Split [right half] */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    RTGEOM *g3;
+    gaiaGeomCollPtr result = NULL;
+    gaiaLinestringPtr ln;
+    gaiaPolygonPtr pg;
+
+    if (!check_split_args (input, blade))
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    if (input->DimensionModel == GAIA_XY_Z)
+	result = gaiaAllocGeomCollXYZ ();
+    else if (input->DimensionModel == GAIA_XY_M)
+	result = gaiaAllocGeomCollXYM ();
+    else if (input->DimensionModel == GAIA_XY_Z_M)
+	result = gaiaAllocGeomCollXYZM ();
+    else
+	result = gaiaAllocGeomColl ();
+
+    g2 = toRTGeom (ctx, blade);
+
+    ln = input->FirstLinestring;
+    while (ln)
+      {
+	  /* splitting some Linestring */
+	  g1 = toRTGeomLinestring (ctx, ln, input->Srid);
+	  g3 = rtgeom_split (ctx, g1, g2);
+	  if (g3)
+	    {
+		result = fromRTGeomRight (ctx, result, g3);
+		rtgeom_free (ctx, g3);
+	    }
+	  spatialite_init_geos ();
+	  rtgeom_free (ctx, g1);
+	  ln = ln->Next;
+      }
+    pg = input->FirstPolygon;
+    while (pg)
+      {
+	  /* splitting some Polygon */
+	  g1 = toRTGeomPolygon (ctx, pg, input->Srid);
+	  g3 = rtgeom_split (ctx, g1, g2);
+	  if (g3)
+	    {
+		result = fromRTGeomRight (ctx, result, g3);
+		rtgeom_free (ctx, g3);
+	    }
+	  spatialite_init_geos ();
+	  rtgeom_free (ctx, g1);
+	  pg = pg->Next;
+      }
+
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    if (result->FirstPoint == NULL && result->FirstLinestring == NULL
+	&& result->FirstPolygon == NULL)
+      {
+	  gaiaFreeGeomColl (result);
+	  result = NULL;
+	  goto done;
+      }
+    result->Srid = input->Srid;
+    set_split_gtype (result);
+
+  done:
+    return result;
+}
+
+GAIAGEO_DECLARE int
+gaiaAzimuth (const void *p_cache, double xa, double ya, double xb, double yb,
+	     double *azimuth)
+{
+/* wrapping RTGEOM Azimuth */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTPOINT2D pt1;
+    RTPOINT2D pt2;
+    double az;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    pt1.x = xa;
+    pt1.y = ya;
+    pt2.x = xb;
+    pt2.y = yb;
+
+    if (!azimuth_pt_pt (ctx, &pt1, &pt2, &az))
+	ret = 0;
+    *azimuth = az;
+
+    return ret;
+}
+
+GAIAGEO_DECLARE int
+gaiaEllipsoidAzimuth (const void *p_cache, double xa, double ya, double xb,
+		      double yb, double a, double b, double *azimuth)
+{
+/* wrapping RTGEOM AzimuthSpheroid */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTPOINT *pt1;
+    RTPOINT *pt2;
+    SPHEROID ellips;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    pt1 = rtpoint_make2d (ctx, 0, xa, ya);
+    pt2 = rtpoint_make2d (ctx, 0, xb, yb);
+    spheroid_init (ctx, &ellips, a, b);
+    *azimuth = rtgeom_azumith_spheroid (ctx, pt1, pt2, &ellips);
+    rtpoint_free (ctx, pt1);
+    rtpoint_free (ctx, pt2);
+
+    return ret;
+}
+
+GAIAGEO_DECLARE int
+gaiaProjectedPoint (const void *p_cache, double x1, double y1, double a,
+		    double b, double distance, double azimuth, double *x2,
+		    double *y2)
+{
+/* wrapping RTGEOM Project */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTPOINT *pt1;
+    RTPOINT *pt2;
+    SPHEROID ellips;
+    int ret = 0;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    pt1 = rtpoint_make2d (ctx, 0, x1, y1);
+    spheroid_init (ctx, &ellips, a, b);
+    pt2 = rtgeom_project_spheroid (ctx, pt1, &ellips, distance, azimuth);
+    rtpoint_free (ctx, pt1);
+    if (pt2 != NULL)
+      {
+	  *x2 = rtpoint_get_x (ctx, pt2);
+	  *y2 = rtpoint_get_y (ctx, pt2);
+	  rtpoint_free (ctx, pt2);
+	  ret = 1;
+      }
+
+    return ret;
+}
+
+GAIAGEO_DECLARE int
+gaiaGeodesicArea (const void *p_cache, gaiaGeomCollPtr geom, double a, double b,
+		  int use_ellipsoid, double *area)
+{
+/* wrapping RTGEOM AreaSphere and AreaSpheroid */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g;
+    SPHEROID ellips;
+    RTGBOX gbox;
+    double tolerance = 1e-12;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    g = toRTGeom (ctx, geom);
+    spheroid_init (ctx, &ellips, a, b);
+    if (g == NULL)
+      {
+	  ret = 0;
+	  goto done;
+      }
+    rtgeom_calculate_gbox_geodetic (ctx, g, &gbox);
+    if (use_ellipsoid)
+      {
+	  /* testing for "forbidden" calculations on the ellipsoid */
+	  if ((gbox.zmax + tolerance) >= 1.0 || (gbox.zmin - tolerance) <= -1.0)
+	      use_ellipsoid = 0;	/* can't circle the poles */
+	  if (gbox.zmax > 0.0 && gbox.zmin < 0.0)
+	      use_ellipsoid = 0;	/* can't cross the equator */
+      }
+    if (use_ellipsoid)
+	*area = rtgeom_area_spheroid (ctx, g, &ellips);
+    else
+	*area = rtgeom_area_sphere (ctx, g, &ellips);
+    rtgeom_free (ctx, g);
+
+  done:
+    return ret;
+}
+
+GAIAGEO_DECLARE char *
+gaiaGeoHash (const void *p_cache, gaiaGeomCollPtr geom, int precision)
+{
+/* wrapping RTGEOM GeoHash */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g;
+    char *result;
+    char *geo_hash = NULL;
+    int len;
+
+    if (!geom)
+	return NULL;
+    gaiaMbrGeometry (geom);
+    if (geom->MinX < -180.0 || geom->MaxX > 180.0 || geom->MinY < -90.0
+	|| geom->MaxY > 90.0)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g = toRTGeom (ctx, geom);
+    result = rtgeom_geohash (ctx, g, precision);
+    rtgeom_free (ctx, g);
+    if (result == NULL)
+	goto done;
+    len = strlen (result);
+    if (len == 0)
+      {
+	  rtfree (ctx, result);
+	  goto done;
+      }
+    geo_hash = malloc (len + 1);
+    strcpy (geo_hash, result);
+    rtfree (ctx, result);
+
+  done:
+    return geo_hash;
+}
+
+GAIAGEO_DECLARE char *
+gaiaAsX3D (const void *p_cache, gaiaGeomCollPtr geom, const char *srs,
+	   int precision, int options, const char *defid)
+{
+/* wrapping RTGEOM AsX3D */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g;
+    char *result;
+    char *x3d = NULL;
+    int len;
+
+    if (!geom)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    gaiaMbrGeometry (geom);
+    g = toRTGeom (ctx, geom);
+    result = rtgeom_to_x3d3 (ctx, g, (char *) srs, precision, options, defid);
+    rtgeom_free (ctx, g);
+    if (result == NULL)
+	goto done;
+    len = strlen (result);
+    if (len == 0)
+      {
+	  rtfree (ctx, result);
+	  goto done;
+      }
+    x3d = malloc (len + 1);
+    strcpy (x3d, result);
+    rtfree (ctx, result);
+
+  done:
+    return x3d;
+}
+
+GAIAGEO_DECLARE int
+gaia3DDistance (const void *p_cache, gaiaGeomCollPtr geom1,
+		gaiaGeomCollPtr geom2, double *dist)
+{
+/* wrapping RTGEOM mindistance3d */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    double d;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    g1 = toRTGeom (ctx, geom1);
+    g2 = toRTGeom (ctx, geom2);
+
+    d = rtgeom_mindistance3d (ctx, g1, g2);
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    *dist = d;
+
+    return ret;
+}
+
+GAIAGEO_DECLARE int
+gaiaMaxDistance (const void *p_cache, gaiaGeomCollPtr geom1,
+		 gaiaGeomCollPtr geom2, double *dist)
+{
+/* wrapping RTGEOM maxdistance2d */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    double d;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    g1 = toRTGeom (ctx, geom1);
+    g2 = toRTGeom (ctx, geom2);
+
+    d = rtgeom_maxdistance2d (ctx, g1, g2);
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    *dist = d;
+
+    return ret;
+}
+
+GAIAGEO_DECLARE int
+gaia3DMaxDistance (const void *p_cache, gaiaGeomCollPtr geom1,
+		   gaiaGeomCollPtr geom2, double *dist)
+{
+/* wrapping RTGEOM maxdistance2d */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    double d;
+    int ret = 1;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    g1 = toRTGeom (ctx, geom1);
+    g2 = toRTGeom (ctx, geom2);
+
+    d = rtgeom_maxdistance3d (ctx, g1, g2);
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    *dist = d;
+
+    return ret;
+}
+
+static RTLINE *
+linestring2rtline (const RTCTX * ctx, gaiaLinestringPtr ln, int srid)
+{
+/* converting a Linestring into an RTLINE */
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
+    int iv;
+    double x;
+    double y;
+    double z;
+    double m;
+    int has_z = 0;
+
+    if (ln->DimensionModel == GAIA_XY_Z || ln->DimensionModel == GAIA_XY_Z_M)
+	has_z = 1;
+
+    pa = ptarray_construct (ctx, has_z, 0, ln->Points);
+    for (iv = 0; iv < ln->Points; iv++)
+      {
+	  /* copying vertices */
+	  if (ln->DimensionModel == GAIA_XY_Z)
+	    {
+		gaiaGetPointXYZ (ln->Coords, iv, &x, &y, &z);
+	    }
+	  else if (ln->DimensionModel == GAIA_XY_M)
+	    {
+		gaiaGetPointXYM (ln->Coords, iv, &x, &y, &m);
+	    }
+	  else if (ln->DimensionModel == GAIA_XY_Z_M)
+	    {
+		gaiaGetPointXYZM (ln->Coords, iv, &x, &y, &z, &m);
+	    }
+	  else
+	    {
+		gaiaGetPoint (ln->Coords, iv, &x, &y);
+	    }
+	  point.x = x;
+	  point.y = y;
+	  if (has_z)
+	      point.z = z;
+	  else
+	      point.z = 0.0;
+	  point.m = 0.0;
+	  ptarray_set_point4d (ctx, pa, iv, &point);
+      }
+    return rtline_construct (ctx, srid, NULL, pa);
+}
+
+GAIAGEO_DECLARE int
+gaia3dLength (const void *p_cache, gaiaGeomCollPtr geom, double *length)
+{
+/* wrapping RTGEOM rtline_length */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTLINE *line;
+    gaiaLinestringPtr ln;
+    double l = 0.0;
+    int ret = 0;
+
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    ln = geom->FirstLinestring;
+    while (ln != NULL)
+      {
+	  ret = 1;
+	  line = linestring2rtline (ctx, ln, geom->Srid);
+	  l += rtgeom_length (ctx, (RTGEOM *) line);
+	  rtline_free (ctx, line);
+	  ln = ln->Next;
+      }
+    *length = l;
+
+    return ret;
+}
+
+GAIAGEO_DECLARE gaiaGeomCollPtr
+gaiaNodeLines (const void *p_cache, gaiaGeomCollPtr geom)
+{
+/* wrapping RTGEOM rtgeom_node */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache =
+	(struct splite_internal_cache *) p_cache;
+    RTGEOM *g1;
+    RTGEOM *g2;
+    gaiaGeomCollPtr result = NULL;
+
+    if (!geom)
+	return NULL;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
+
+    g1 = toRTGeom (ctx, geom);
+    g2 = rtgeom_node (ctx, g1);
+    if (!g2)
+      {
+	  rtgeom_free (ctx, g1);
+	  goto done;
+      }
+    result = fromRTGeom (ctx, g2, geom->DimensionModel, geom->DeclaredType);
+    spatialite_init_geos ();
+    rtgeom_free (ctx, g1);
+    rtgeom_free (ctx, g2);
+    if (result == NULL)
+	goto done;
+    result->Srid = geom->Srid;
+
+  done:
+    return result;
+}
+
+#endif /* end enabling RTTOPO support */
diff --git a/src/gaiageo/gg_transform.c b/src/gaiageo/gg_transform.c
index 67e9476..d1d6356 100644
--- a/src/gaiageo/gg_transform.c
+++ b/src/gaiageo/gg_transform.c
@@ -270,6 +270,8 @@ gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y)
 	  /* shifting LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -311,6 +313,8 @@ gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y)
     while (polyg)
       {
 	  /* shifting POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -431,6 +435,8 @@ gaiaShiftCoords3D (gaiaGeomCollPtr geom, double shift_x, double shift_y,
 	  /* shifting LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -473,6 +479,8 @@ gaiaShiftCoords3D (gaiaGeomCollPtr geom, double shift_x, double shift_y,
     while (polyg)
       {
 	  /* shifting POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -593,6 +601,8 @@ gaiaShiftLongitude (gaiaGeomCollPtr geom)
 	  /* shifting LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -636,6 +646,8 @@ gaiaShiftLongitude (gaiaGeomCollPtr geom)
     while (polyg)
       {
 	  /* shifting POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -955,6 +967,8 @@ gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y)
 	  /* scaling LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -996,6 +1010,8 @@ gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y)
     while (polyg)
       {
 	  /* scaling POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -1119,6 +1135,8 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle)
 	  /* rotating LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -1160,6 +1178,8 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle)
     while (polyg)
       {
 	  /* rotating POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -1202,6 +1222,8 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle)
 	  for (ib = 0; ib < polyg->NumInteriors; ib++)
 	    {
 		/* rotating the INTERIOR RINGs */
+		m = 0.0;
+		z = 0.0;
 		ring = polyg->Interiors + ib;
 		for (iv = 0; iv < ring->Points; iv++)
 		  {
@@ -1443,6 +1465,8 @@ gaiaSwapCoords (gaiaGeomCollPtr geom)
 	  /* swapping LINESTRINGs */
 	  for (iv = 0; iv < line->Points; iv++)
 	    {
+		m = 0.0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z);
@@ -1485,6 +1509,8 @@ gaiaSwapCoords (gaiaGeomCollPtr geom)
     while (polyg)
       {
 	  /* swapping POLYGONs */
+	  m = 0.0;
+	  z = 0.0;
 	  ring = polyg->Exterior;
 	  for (iv = 0; iv < ring->Points; iv++)
 	    {
@@ -1528,6 +1554,8 @@ gaiaSwapCoords (gaiaGeomCollPtr geom)
 	  for (ib = 0; ib < polyg->NumInteriors; ib++)
 	    {
 		/* swapping the INTERIOR RINGs */
+		m = 0.0;
+		z = 0.0;
 		ring = polyg->Interiors + ib;
 		for (iv = 0; iv < ring->Points; iv++)
 		  {
diff --git a/src/gaiageo/gg_wkt.c b/src/gaiageo/gg_wkt.c
index 93950e5..0e94392 100644
--- a/src/gaiageo/gg_wkt.c
+++ b/src/gaiageo/gg_wkt.c
@@ -3459,6 +3459,7 @@ gaiaOutGml (gaiaOutBufferPtr out_buf, int version, int precision,
 	    {
 		/* exporting vertices */
 		has_z = 0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      has_z = 1;
@@ -3636,6 +3637,7 @@ gaiaOutGml (gaiaOutBufferPtr out_buf, int version, int precision,
 	    {
 		/* exporting vertices [Interior Ring] */
 		has_z = 0;
+		z = 0.0;
 		if (ring->DimensionModel == GAIA_XY_Z)
 		  {
 		      has_z = 1;
@@ -3748,6 +3750,7 @@ gaiaOutGml (gaiaOutBufferPtr out_buf, int version, int precision,
 		  {
 		      /* exporting vertices [Interior Ring] */
 		      has_z = 0;
+		      z = 0.0;
 		      if (ring->DimensionModel == GAIA_XY_Z)
 			{
 			    has_z = 1;
@@ -3919,7 +3922,7 @@ gaiaOutGeoJSON (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision,
     char *buf_x;
     char *buf_y;
     char *buf_m;
-    char *buf_z;
+    char *buf_z = NULL;
     char endJson[16];
     if (!geom)
 	return;
@@ -4142,6 +4145,7 @@ gaiaOutGeoJSON (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision,
 	    {
 		/* exporting vertices */
 		has_z = 0;
+		z = 0.0;
 		if (line->DimensionModel == GAIA_XY_Z)
 		  {
 		      has_z = 1;
@@ -4227,6 +4231,7 @@ gaiaOutGeoJSON (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision,
 	    {
 		/* exporting vertices [Interior Ring] */
 		has_z = 0;
+		z = 0.0;
 		if (ring->DimensionModel == GAIA_XY_Z)
 		  {
 		      has_z = 1;
@@ -4291,6 +4296,7 @@ gaiaOutGeoJSON (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision,
 		  {
 		      /* exporting vertices [Interior Ring] */
 		      has_z = 0;
+		      z = 0.0;
 		      if (ring->DimensionModel == GAIA_XY_Z)
 			{
 			    has_z = 1;
diff --git a/src/gaiageo/gg_xml.c b/src/gaiageo/gg_xml.c
index af0c88d..0797da3 100644
--- a/src/gaiageo/gg_xml.c
+++ b/src/gaiageo/gg_xml.c
@@ -1487,7 +1487,7 @@ gaiaXmlToBlob (const void *p_cache, const unsigned char *xml, int xml_len,
     char *abstract = NULL;
     unsigned char *geometry = NULL;
     uLong crc;
-    Bytef *zip_buf;
+    Bytef *zip_buf = NULL;
     unsigned char *buf;
     unsigned char *ptr;
     unsigned char flags = 0x00;
@@ -1650,17 +1650,17 @@ gaiaXmlToBlob (const void *p_cache, const unsigned char *xml, int xml_len,
 /* computing the XmlBLOB size */
     len = 39;			/* fixed header-footer size */
     if (schemaURI)
-	uri_len = strlen ((const char *) schemaURI);
+	uri_len = (short) strlen ((const char *) schemaURI);
     if (fileIdentifier)
-	fileid_len = strlen ((const char *) fileIdentifier);
+	fileid_len = (short) strlen ((const char *) fileIdentifier);
     if (parentIdentifier)
 	parentid_len = strlen ((const char *) parentIdentifier);
     if (name)
-	name_len = strlen ((const char *) name);
+	name_len = (short) strlen ((const char *) name);
     if (title)
-	title_len = strlen ((const char *) title);
+	title_len = (short) strlen ((const char *) title);
     if (abstract)
-	abstract_len = strlen ((const char *) abstract);
+	abstract_len = (short) strlen ((const char *) abstract);
     len += zip_len;
     len += uri_len;
     len += fileid_len;
@@ -1805,7 +1805,7 @@ gaiaXmlBlobCompression (const unsigned char *blob,
     int little_endian = 0;
     unsigned char flag;
     int in_xml_len;
-    int in_zip_len;
+    int in_zip_len = 0;
     short uri_len;
     short fileid_len;
     short parentid_len;
@@ -1816,7 +1816,7 @@ gaiaXmlBlobCompression (const unsigned char *blob,
     int out_xml_len;
     int out_zip_len;
     uLong crc;
-    Bytef *zip_buf;
+    Bytef *zip_buf = NULL;
     int len;
     char *schemaURI;
     char *fileIdentifier;
@@ -1831,7 +1831,7 @@ gaiaXmlBlobCompression (const unsigned char *blob,
     int is_sld_style = 0;
     int is_svg = 0;
     int is_gpx = 0;
-    unsigned char *xml;
+    unsigned char *xml = NULL;
     unsigned char *buf;
     unsigned char *ptr;
     unsigned char flags;
@@ -4304,7 +4304,7 @@ parse_gpx_trkpt_children (xmlNodePtr node, sqlite3_stmt * stmt, double *z,
 /* parsing the children of a GPX <trkpt> tag */
     xmlNode *text;
     *z = 0.0;
-    *m = 1721059.500000;		/* 0000-01-01T00:00:00Z */
+    *m = 1721059.500000;	/* 0000-01-01T00:00:00Z */
 
     while (node)
       {
diff --git a/src/gaiageo/lex.Ewkt.c b/src/gaiageo/lex.Ewkt.c
index fed73c6..5161ca8 100644
--- a/src/gaiageo/lex.Ewkt.c
+++ b/src/gaiageo/lex.Ewkt.c
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -53,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -169,11 +170,17 @@ typedef void *yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -191,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -213,7 +215,7 @@ struct yy_buffer_state
     /* Number of characters read into yy_ch_buf, not including EOB
      * characters.
      */
-    int yy_n_chars;
+    yy_size_t yy_n_chars;
 
     /* Whether we "own" the buffer - i.e., we know we created it,
      * and can realloc() it to grow it, and should free() it to
@@ -294,7 +296,7 @@ static void Ewkt_init_buffer (YY_BUFFER_STATE b, FILE * file,
 YY_BUFFER_STATE Ewkt_scan_buffer (char *base, yy_size_t size,
 				  yyscan_t yyscanner);
 YY_BUFFER_STATE Ewkt_scan_string (yyconst char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE Ewkt_scan_bytes (yyconst char *bytes, int len,
+YY_BUFFER_STATE Ewkt_scan_bytes (yyconst char *bytes, yy_size_t len,
 				 yyscan_t yyscanner);
 
 void *Ewktalloc (yy_size_t, yyscan_t yyscanner);
@@ -358,17 +360,23 @@ struct yy_trans_info
     flex_int32_t yy_verify;
     flex_int32_t yy_nxt;
 };
-static yyconst flex_int16_t yy_accept[93] = { 0,
+static yyconst flex_int16_t yy_accept[150] = { 0,
     0, 0, 23, 21, 19, 20, 3, 4, 21, 2,
-    21, 1, 21, 21, 21, 21, 1, 1, 1, 1,
-    0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
-    0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 5, 0, 0, 0, 0, 0, 6, 0,
-    0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
-    10, 0, 0, 0, 0, 0, 0, 7, 0, 11,
-    0, 0, 8, 0, 12, 0, 0, 0, 15, 0,
-    0, 16, 0, 0, 0, 13, 0, 14, 0, 17,
-    18, 0
+    21, 1, 1, 21, 21, 21, 21, 1, 1, 1,
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 5, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+
+    0, 6, 0, 1, 1, 1, 1, 0, 0, 0,
+    0, 9, 0, 0, 0, 0, 0, 10, 0, 0,
+    0, 0, 0, 0, 7, 0, 11, 0, 0, 8,
+    0, 12, 0, 0, 0, 15, 0, 0, 16, 0,
+    0, 0, 13, 0, 14, 0, 17, 18, 0
 };
 
 static yyconst flex_int32_t yy_ec[256] = { 0,
@@ -409,86 +417,120 @@ static yyconst flex_int32_t yy_meta[39] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1
 };
 
-static yyconst flex_int16_t yy_base[93] = { 0,
-    0, 0, 187, 188, 188, 188, 188, 188, 174, 188,
-    173, 30, 29, 28, 20, 26, 36, 38, 172, 40,
-    33, 35, 38, 45, 171, 166, 165, 38, 49, 40,
-    46, 40, 164, 163, 57, 49, 57, 50, 66, 58,
-    59, 72, 66, 70, 69, 70, 78, 79, 188, 81,
-    75, 86, 90, 94, 94, 104, 99, 105, 101, 95,
-    188, 102, 112, 105, 105, 115, 120, 120, 115, 122,
-    125, 129, 188, 125, 188, 129, 135, 134, 137, 143,
-    138, 188, 134, 150, 150, 149, 148, 188, 154, 156,
-    188, 188
+static yyconst flex_int16_t yy_base[150] = { 0,
+    0, 0, 284, 285, 285, 285, 285, 285, 30, 285,
+    32, 273, 34, 33, 33, 25, 31, 272, 41, 271,
+    45, 46, 270, 56, 67, 46, 52, 55, 65, 64,
+    269, 79, 76, 268, 89, 90, 91, 267, 266, 265,
+    75, 80, 82, 90, 84, 103, 100, 264, 263, 262,
+    117, 104, 261, 260, 259, 258, 257, 256, 123, 255,
+    108, 103, 114, 110, 122, 254, 253, 252, 131, 251,
+    250, 249, 248, 137, 247, 246, 245, 244, 243, 242,
+    114, 118, 129, 135, 134, 241, 240, 237, 235, 234,
+    233, 231, 230, 229, 227, 226, 154, 133, 135, 142,
+
+    139, 285, 142, 109, 105, 71, 42, 136, 147, 146,
+    164, 152, 161, 159, 168, 164, 159, 285, 166, 172,
+    166, 166, 176, 176, 180, 178, 188, 188, 192, 285,
+    188, 285, 192, 199, 198, 197, 204, 199, 285, 195,
+    206, 210, 212, 214, 285, 217, 219, 285, 285
 };
 
-static yyconst flex_int16_t yy_def[93] = { 0,
-    92, 1, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 0
+static yyconst flex_int16_t yy_def[150] = { 0,
+    149, 1, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 0
 };
 
-static yyconst flex_int16_t yy_nxt[227] = { 0,
-    4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
-    4, 4, 13, 4, 14, 15, 4, 4, 16, 4,
-    4, 4, 4, 4, 4, 4, 13, 4, 14, 15,
-    4, 4, 16, 4, 4, 4, 4, 4, 19, 20,
-    21, 22, 23, 24, 25, 17, 26, 18, 19, 20,
-    28, 29, 30, 35, 21, 22, 23, 24, 31, 32,
-    36, 37, 38, 39, 28, 29, 30, 35, 40, 41,
-    42, 43, 31, 32, 36, 37, 38, 39, 44, 45,
-    46, 49, 40, 41, 42, 43, 47, 50, 51, 52,
-    48, 53, 44, 45, 46, 49, 54, 55, 56, 57,
-
-    47, 50, 51, 52, 48, 53, 58, 59, 60, 61,
-    54, 55, 56, 57, 62, 63, 64, 65, 66, 67,
-    58, 59, 60, 61, 68, 69, 70, 71, 62, 63,
-    64, 65, 66, 67, 72, 73, 74, 75, 68, 69,
-    70, 71, 76, 77, 78, 79, 80, 81, 72, 73,
-    74, 75, 82, 83, 84, 85, 76, 77, 78, 79,
-    80, 81, 86, 87, 88, 89, 82, 83, 84, 85,
-    90, 91, 34, 33, 27, 34, 86, 87, 88, 89,
-    33, 27, 18, 17, 90, 91, 92, 3, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92
+static yyconst flex_int16_t yy_nxt[324] = { 0,
+    4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+    4, 4, 14, 4, 15, 16, 4, 4, 17, 4,
+    4, 4, 4, 4, 4, 4, 14, 4, 15, 16,
+    4, 4, 17, 4, 4, 4, 4, 4, 18, 19,
+    20, 21, 23, 24, 26, 25, 27, 28, 29, 31,
+    19, 107, 32, 34, 21, 22, 35, 36, 26, 25,
+    27, 28, 29, 41, 23, 24, 32, 25, 42, 43,
+    35, 36, 38, 30, 39, 46, 40, 41, 44, 45,
+    106, 25, 42, 43, 48, 33, 49, 51, 50, 46,
+    61, 62, 44, 45, 53, 56, 54, 57, 55, 58,
+
+    37, 51, 59, 63, 61, 62, 64, 65, 66, 47,
+    67, 69, 68, 52, 105, 74, 59, 63, 104, 81,
+    64, 65, 71, 82, 72, 69, 73, 83, 78, 74,
+    79, 84, 80, 81, 85, 98, 88, 82, 89, 99,
+    90, 83, 93, 100, 94, 84, 95, 101, 85, 98,
+    102, 103, 108, 99, 109, 110, 111, 100, 112, 113,
+    114, 101, 115, 97, 102, 103, 108, 118, 109, 110,
+    111, 119, 112, 113, 114, 120, 115, 116, 117, 121,
+    122, 118, 123, 124, 125, 119, 126, 127, 128, 120,
+    129, 116, 117, 121, 122, 130, 123, 124, 125, 131,
+
+    126, 127, 128, 132, 129, 133, 134, 135, 136, 130,
+    137, 138, 139, 131, 140, 141, 142, 132, 143, 133,
+    134, 135, 136, 144, 137, 138, 139, 145, 140, 141,
+    142, 146, 143, 147, 148, 96, 95, 144, 107, 106,
+    92, 145, 91, 90, 105, 146, 104, 147, 148, 87,
+    86, 80, 97, 96, 77, 76, 75, 73, 92, 91,
+    70, 68, 87, 86, 60, 58, 77, 76, 55, 55,
+    75, 50, 50, 70, 40, 40, 60, 52, 47, 37,
+    33, 30, 22, 149, 3, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149
 };
 
-static yyconst flex_int16_t yy_chk[227] = { 0,
+static yyconst flex_int16_t yy_chk[324] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 12, 12,
-    13, 14, 15, 16, 17, 17, 18, 18, 20, 20,
-    21, 22, 23, 28, 13, 14, 15, 16, 24, 24,
-    29, 30, 31, 32, 21, 22, 23, 28, 35, 36,
-    37, 38, 24, 24, 29, 30, 31, 32, 39, 40,
-    41, 43, 35, 36, 37, 38, 42, 44, 45, 46,
-    42, 47, 39, 40, 41, 43, 48, 50, 51, 52,
-
-    42, 44, 45, 46, 42, 47, 53, 54, 54, 55,
-    48, 50, 51, 52, 56, 57, 58, 59, 60, 62,
-    53, 54, 54, 55, 63, 64, 65, 66, 56, 57,
-    58, 59, 60, 62, 67, 68, 69, 70, 63, 64,
-    65, 66, 71, 72, 74, 76, 77, 78, 67, 68,
-    69, 70, 79, 80, 81, 83, 71, 72, 74, 76,
-    77, 78, 84, 85, 86, 87, 79, 80, 81, 83,
-    89, 90, 34, 33, 27, 26, 84, 85, 86, 87,
-    25, 19, 11, 9, 89, 90, 3, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    92, 92, 92, 92, 92, 92
+    1, 1, 1, 1, 1, 1, 1, 1, 9, 9,
+    11, 11, 13, 13, 14, 13, 15, 16, 17, 19,
+    19, 107, 19, 21, 21, 22, 21, 22, 14, 13,
+    15, 16, 17, 26, 24, 24, 19, 24, 27, 28,
+    21, 22, 25, 30, 25, 30, 25, 26, 29, 29,
+    106, 24, 27, 28, 32, 33, 32, 33, 32, 30,
+    41, 42, 29, 29, 35, 36, 35, 36, 35, 36,
+
+    37, 33, 37, 43, 41, 42, 44, 45, 46, 47,
+    46, 47, 46, 52, 105, 52, 37, 43, 104, 61,
+    44, 45, 51, 62, 51, 47, 51, 63, 59, 52,
+    59, 64, 59, 61, 65, 81, 69, 62, 69, 82,
+    69, 63, 74, 83, 74, 64, 74, 83, 65, 81,
+    84, 85, 98, 82, 99, 100, 101, 83, 103, 108,
+    109, 83, 110, 97, 84, 85, 98, 112, 99, 100,
+    101, 113, 103, 108, 109, 114, 110, 111, 111, 115,
+    116, 112, 117, 119, 120, 113, 121, 122, 123, 114,
+    124, 111, 111, 115, 116, 125, 117, 119, 120, 126,
+
+    121, 122, 123, 127, 124, 128, 129, 131, 133, 125,
+    134, 135, 136, 126, 137, 138, 140, 127, 141, 128,
+    129, 131, 133, 142, 134, 135, 136, 143, 137, 138,
+    140, 144, 141, 146, 147, 96, 95, 142, 94, 93,
+    92, 143, 91, 90, 89, 144, 88, 146, 147, 87,
+    86, 80, 79, 78, 77, 76, 75, 73, 72, 71,
+    70, 68, 67, 66, 60, 58, 57, 56, 55, 54,
+    53, 50, 49, 48, 40, 39, 38, 34, 31, 23,
+    20, 18, 12, 3, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+    149, 149, 149
 };
 
 /* The intent behind this definition is that it'll catch
@@ -498,6 +540,7 @@ static yyconst flex_int16_t yy_chk[227] = { 0,
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "ewktLexer.l"
 /* 
  EwktLexer.l -- EWKT parser - FLEX config
   
@@ -550,6 +593,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  Flex would match both POINT and POINTM, but since POINTM is the longer
 *  of the two tokens, FLEX will match POINTM.
 */
+#line 600 "lex.Ewkt.c"
 
 #define INITIAL 0
 
@@ -576,8 +620,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max;	/**< capacity of stack. */
     YY_BUFFER_STATE *yy_buffer_stack;  /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -624,7 +668,7 @@ FILE *Ewktget_out (yyscan_t yyscanner);
 
 void Ewktset_out (FILE * out_str, yyscan_t yyscanner);
 
-int Ewktget_leng (yyscan_t yyscanner);
+yy_size_t Ewktget_leng (yyscan_t yyscanner);
 
 char *Ewktget_text (yyscan_t yyscanner);
 
@@ -687,7 +731,7 @@ static int input (yyscan_t yyscanner);
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		unsigned n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -797,315 +841,352 @@ YY_DECL
 	  Ewkt_load_buffer_state (yyscanner);
       }
 
-    while (1)			/* loops until end-of-file is reached */
-      {
-	  yy_cp = yyg->yy_c_buf_p;
+    {
+#line 59 "ewktLexer.l"
 
-	  /* Support of yytext. */
-	  *yy_cp = yyg->yy_hold_char;
+#line 850 "lex.Ewkt.c"
 
-	  /* yy_bp points to the position in yy_ch_buf of the start of
-	   * the current run.
-	   */
-	  yy_bp = yy_cp;
+	while (1)		/* loops until end-of-file is reached */
+	  {
+	      yy_cp = yyg->yy_c_buf_p;
 
-	  yy_current_state = yyg->yy_start;
-	yy_match:
-	  do
-	    {
-		register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
-		if (yy_accept[yy_current_state])
-		  {
-		      yyg->yy_last_accepting_state = yy_current_state;
-		      yyg->yy_last_accepting_cpos = yy_cp;
-		  }
-		while (yy_chk[yy_base[yy_current_state] + yy_c] !=
-		       yy_current_state)
-		  {
-		      yy_current_state = (int) yy_def[yy_current_state];
-		      if (yy_current_state >= 93)
-			  yy_c = yy_meta[(unsigned int) yy_c];
-		  }
-		yy_current_state =
-		    yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		++yy_cp;
-	    }
-	  while (yy_base[yy_current_state] != 188);
-
-	yy_find_action:
-	  yy_act = yy_accept[yy_current_state];
-	  if (yy_act == 0)
-	    {			/* have to back up */
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		yy_act = yy_accept[yy_current_state];
-	    }
+	      /* Support of yytext. */
+	      *yy_cp = yyg->yy_hold_char;
 
-	  YY_DO_BEFORE_ACTION;
+	      /* yy_bp points to the position in yy_ch_buf of the start of
+	       * the current run.
+	       */
+	      yy_bp = yy_cp;
 
-	do_action:		/* This label is used only to access EOF actions. */
-
-	  switch (yy_act)
-	    {			/* beginning of action switch */
-	    case 0:		/* must back up */
-		/* undo the effects of YY_DO_BEFORE_ACTION */
-		*yy_cp = yyg->yy_hold_char;
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		goto yy_find_action;
-
-	    case 1:
-		YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->ewkt_col +=
-			(int) strlen (yytext);
-		    Ewktget_extra (yyscanner)->EwktLval.dval = atof (yytext);
-		    return EWKT_NUM;
-		}
-		YY_BREAK case 2:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_COMMA;
-		}
-		YY_BREAK case 3:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_OPEN_BRACKET;
-		}
-		YY_BREAK case 4:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_CLOSE_BRACKET;
-		}
-		YY_BREAK case 5:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_POINT;
-		}
-		YY_BREAK case 6:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_POINT_M;
-		}
-		YY_BREAK case 7:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_LINESTRING;
-		}
-		YY_BREAK case 8:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_LINESTRING_M;
-		}
-		YY_BREAK case 9:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_POLYGON;
-		}
-		YY_BREAK case 10:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_POLYGON_M;
-		}
-		YY_BREAK case 11:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTIPOINT;
-		}
-		YY_BREAK case 12:YY_RULE_SETUP
+	      yy_current_state = yyg->yy_start;
+	    yy_match:
+	      do
 		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTIPOINT_M;
-		}
-		YY_BREAK case 13:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTILINESTRING;
-		}
-		YY_BREAK case 14:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTILINESTRING_M;
-		}
-		YY_BREAK case 15:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTIPOLYGON;
-		}
-		YY_BREAK case 16:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_MULTIPOLYGON_M;
-		}
-		YY_BREAK case 17:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_GEOMETRYCOLLECTION;
-		}
-		YY_BREAK case 18:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->EwktLval.dval = 0;
-		    return EWKT_GEOMETRYCOLLECTION_M;
-		}
-		YY_BREAK case 19:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->ewkt_col +=
-			(int) strlen (yytext);
-		}		/* ignore but count white space */
-		YY_BREAK case 20:
-/* rule 20 can match eol */
-		  YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->ewkt_col = 0;
-		    Ewktget_extra (yyscanner)->ewkt_line++;
+		    register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
+		    if (yy_accept[yy_current_state])
+		      {
+			  yyg->yy_last_accepting_state = yy_current_state;
+			  yyg->yy_last_accepting_cpos = yy_cp;
+		      }
+		    while (yy_chk[yy_base[yy_current_state] + yy_c] !=
+			   yy_current_state)
+		      {
+			  yy_current_state = (int) yy_def[yy_current_state];
+			  if (yy_current_state >= 150)
+			      yy_c = yy_meta[(unsigned int) yy_c];
+		      }
+		    yy_current_state =
+			yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		    ++yy_cp;
 		}
-		YY_BREAK case 21:YY_RULE_SETUP
-		{
-		    Ewktget_extra (yyscanner)->ewkt_col +=
-			(int) strlen (yytext);
-		    return -1;
+	      while (yy_base[yy_current_state] != 285);
+
+	    yy_find_action:
+	      yy_act = yy_accept[yy_current_state];
+	      if (yy_act == 0)
+		{		/* have to back up */
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    yy_act = yy_accept[yy_current_state];
 		}
-		YY_BREAK case 22:YY_RULE_SETUP ECHO;
-		YY_BREAK case YY_STATE_EOF (INITIAL):yyterminate ();
 
-	    case YY_END_OF_BUFFER:
-		{
-		    /* Amount of text matched not including the EOB char. */
-		    int yy_amount_of_matched_text =
-			(int) (yy_cp - yyg->yytext_ptr) - 1;
+	      YY_DO_BEFORE_ACTION;
 
-		    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-		    *yy_cp = yyg->yy_hold_char;
-		    YY_RESTORE_YY_MORE_OFFSET
-			if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
-			    YY_BUFFER_NEW)
-		      {
-			  /* We're scanning a new file or input source.  It's
-			   * possible that this happened because the user
-			   * just pointed yyin at a new source and called
-			   * Ewktlex().  If so, then we have to assure
-			   * consistency between YY_CURRENT_BUFFER and our
-			   * globals.  Here is the right place to do so, because
-			   * this is the first action (other than possibly a
-			   * back-up) that will match for the new input source.
-			   */
-			  yyg->yy_n_chars =
-			      YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-			      YY_BUFFER_NORMAL;
-		      }
+	    do_action:		/* This label is used only to access EOF actions. */
 
-		    /* Note that here we test for yy_c_buf_p "<=" to the position
-		     * of the first EOB in the buffer, since yy_c_buf_p will
-		     * already have been incremented past the NUL character
-		     * (since all states make transitions on EOB to the
-		     * end-of-buffer state).  Contrast this with the test
-		     * in input().
-		     */
-		    if (yyg->yy_c_buf_p <=
-			&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-		      {		/* This was really a NUL. */
-			  yy_state_type yy_next_state;
-
-			  yyg->yy_c_buf_p =
-			      yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			  yy_current_state = yy_get_previous_state (yyscanner);
-
-			  /* Okay, we're now positioned to make the NUL
-			   * transition.  We couldn't have
-			   * yy_get_previous_state() go ahead and do it
-			   * for us because it doesn't know how to deal
-			   * with the possibility of jamming (and we don't
-			   * want to build jamming into it because then it
-			   * will run more slowly).
-			   */
-
-			  yy_next_state =
-			      yy_try_NUL_trans (yy_current_state, yyscanner);
-
-			  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			  if (yy_next_state)
-			    {
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-			    }
-
-			  else
-			    {
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-			    }
-		      }
-
-		    else
-			switch (yy_get_next_buffer (yyscanner))
+	      switch (yy_act)
+		{		/* beginning of action switch */
+		case 0:	/* must back up */
+		    /* undo the effects of YY_DO_BEFORE_ACTION */
+		    *yy_cp = yyg->yy_hold_char;
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    goto yy_find_action;
+
+		case 1:
+		    YY_RULE_SETUP
+#line 60 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->ewkt_col +=
+			    (int) strlen (yytext);
+			Ewktget_extra (yyscanner)->EwktLval.dval =
+			    atof (yytext);
+			return EWKT_NUM;
+		    }
+		    YY_BREAK case 2:YY_RULE_SETUP
+#line 61 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_COMMA;
+		    }
+		    YY_BREAK case 3:YY_RULE_SETUP
+#line 62 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_OPEN_BRACKET;
+		    }
+		    YY_BREAK case 4:YY_RULE_SETUP
+#line 63 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_CLOSE_BRACKET;
+		    }
+		    YY_BREAK case 5:YY_RULE_SETUP
+#line 64 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_POINT;
+		    }
+		    YY_BREAK case 6:YY_RULE_SETUP
+#line 65 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_POINT_M;
+		    }
+		    YY_BREAK case 7:YY_RULE_SETUP
+#line 66 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_LINESTRING;
+		    }
+		    YY_BREAK case 8:YY_RULE_SETUP
+#line 67 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_LINESTRING_M;
+		    }
+		    YY_BREAK case 9:YY_RULE_SETUP
+#line 68 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_POLYGON;
+		    }
+		    YY_BREAK case 10:YY_RULE_SETUP
+#line 69 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_POLYGON_M;
+		    }
+		    YY_BREAK case 11:YY_RULE_SETUP
+#line 70 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTIPOINT;
+		    }
+		    YY_BREAK case 12:YY_RULE_SETUP
+#line 71 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTIPOINT_M;
+		    }
+		    YY_BREAK case 13:YY_RULE_SETUP
+#line 72 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTILINESTRING;
+		    }
+		    YY_BREAK case 14:YY_RULE_SETUP
+#line 73 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTILINESTRING_M;
+		    }
+		    YY_BREAK case 15:YY_RULE_SETUP
+#line 74 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTIPOLYGON;
+		    }
+		    YY_BREAK case 16:YY_RULE_SETUP
+#line 75 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_MULTIPOLYGON_M;
+		    }
+		    YY_BREAK case 17:YY_RULE_SETUP
+#line 76 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_GEOMETRYCOLLECTION;
+		    }
+		    YY_BREAK case 18:YY_RULE_SETUP
+#line 77 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->EwktLval.dval = 0;
+			return EWKT_GEOMETRYCOLLECTION_M;
+		    }
+		    YY_BREAK case 19:YY_RULE_SETUP
+#line 79 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->ewkt_col +=
+			    (int) strlen (yytext);
+		    }		/* ignore but count white space */
+		    YY_BREAK case 20:
+/* rule 20 can match eol */
+		      YY_RULE_SETUP
+#line 81 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->ewkt_col = 0;
+			Ewktget_extra (yyscanner)->ewkt_line++;
+		    }
+		    YY_BREAK case 21:YY_RULE_SETUP
+#line 83 "ewktLexer.l"
+		    {
+			Ewktget_extra (yyscanner)->ewkt_col +=
+			    (int) strlen (yytext);
+			return -1;
+		    }
+		    YY_BREAK case 22:YY_RULE_SETUP
+#line 84 "ewktLexer.l"
+		      ECHO;
+		    YY_BREAK
+#line 1018 "lex.Ewkt.c"
+		case YY_STATE_EOF (INITIAL):
+		    yyterminate ();
+
+		case YY_END_OF_BUFFER:
+		    {
+			/* Amount of text matched not including the EOB char. */
+			int yy_amount_of_matched_text =
+			    (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+			/* Undo the effects of YY_DO_BEFORE_ACTION. */
+			*yy_cp = yyg->yy_hold_char;
+			YY_RESTORE_YY_MORE_OFFSET
+			    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
+				YY_BUFFER_NEW)
 			  {
-			  case EOB_ACT_END_OF_FILE:
-			      {
-				  yyg->yy_did_buffer_switch_on_eof = 0;
-
-				  if (Ewktwrap (yyscanner))
-				    {
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p =
-					    yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF (YY_START);
-					goto do_action;
-				    }
-
-				  else
-				    {
-					if (!yyg->yy_did_buffer_switch_on_eof)
-					    YY_NEW_FILE;
-				    }
-				  break;
-			      }
+			      /* We're scanning a new file or input source.  It's
+			       * possible that this happened because the user
+			       * just pointed yyin at a new source and called
+			       * Ewktlex().  If so, then we have to assure
+			       * consistency between YY_CURRENT_BUFFER and our
+			       * globals.  Here is the right place to do so, because
+			       * this is the first action (other than possibly a
+			       * back-up) that will match for the new input source.
+			       */
+			      yyg->yy_n_chars =
+				  YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				  YY_BUFFER_NORMAL;
+			  }
+
+			/* Note that here we test for yy_c_buf_p "<=" to the position
+			 * of the first EOB in the buffer, since yy_c_buf_p will
+			 * already have been incremented past the NUL character
+			 * (since all states make transitions on EOB to the
+			 * end-of-buffer state).  Contrast this with the test
+			 * in input().
+			 */
+			if (yyg->yy_c_buf_p <=
+			    &YY_CURRENT_BUFFER_LVALUE->
+			    yy_ch_buf[yyg->yy_n_chars])
+			  {	/* This was really a NUL. */
+			      yy_state_type yy_next_state;
 
-			  case EOB_ACT_CONTINUE_SCAN:
 			      yyg->yy_c_buf_p =
 				  yyg->yytext_ptr + yy_amount_of_matched_text;
 
 			      yy_current_state =
 				  yy_get_previous_state (yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
-			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_match;
-
-			  case EOB_ACT_LAST_MATCH:
-			      yyg->yy_c_buf_p =
-				  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->
-								       yy_n_chars];
+			      /* Okay, we're now positioned to make the NUL
+			       * transition.  We couldn't have
+			       * yy_get_previous_state() go ahead and do it
+			       * for us because it doesn't know how to deal
+			       * with the possibility of jamming (and we don't
+			       * want to build jamming into it because then it
+			       * will run more slowly).
+			       */
 
-			      yy_current_state =
-				  yy_get_previous_state (yyscanner);
+			      yy_next_state =
+				  yy_try_NUL_trans (yy_current_state,
+						    yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
 			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_find_action;
+
+			      if (yy_next_state)
+				{
+				    /* Consume the NUL. */
+				    yy_cp = ++yyg->yy_c_buf_p;
+				    yy_current_state = yy_next_state;
+				    goto yy_match;
+				}
+
+			      else
+				{
+				    yy_cp = yyg->yy_c_buf_p;
+				    goto yy_find_action;
+				}
 			  }
-		    break;
-		}
 
-	    default:
-		YY_FATAL_ERROR
-		    ("fatal flex scanner internal error--no action found");
-	    }			/* end of action switch */
-      }				/* end of scanning one token */
+			else
+			    switch (yy_get_next_buffer (yyscanner))
+			      {
+			      case EOB_ACT_END_OF_FILE:
+				  {
+				      yyg->yy_did_buffer_switch_on_eof = 0;
+
+				      if (Ewktwrap (yyscanner))
+					{
+					    /* Note: because we've taken care in
+					     * yy_get_next_buffer() to have set up
+					     * yytext, we can now set up
+					     * yy_c_buf_p so that if some total
+					     * hoser (like flex itself) wants to
+					     * call the scanner after we return the
+					     * YY_NULL, it'll still work - another
+					     * YY_NULL will get returned.
+					     */
+					    yyg->yy_c_buf_p =
+						yyg->yytext_ptr + YY_MORE_ADJ;
+
+					    yy_act = YY_STATE_EOF (YY_START);
+					    goto do_action;
+					}
+
+				      else
+					{
+					    if (!yyg->yy_did_buffer_switch_on_eof)
+						YY_NEW_FILE;
+					}
+				      break;
+				  }
+
+			      case EOB_ACT_CONTINUE_SCAN:
+				  yyg->yy_c_buf_p =
+				      yyg->yytext_ptr +
+				      yy_amount_of_matched_text;
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_match;
+
+			      case EOB_ACT_LAST_MATCH:
+				  yyg->yy_c_buf_p =
+				      &YY_CURRENT_BUFFER_LVALUE->
+				      yy_ch_buf[yyg->yy_n_chars];
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_find_action;
+			      }
+			break;
+		    }
+
+		default:
+		    YY_FATAL_ERROR
+			("fatal flex scanner internal error--no action found");
+		}		/* end of action switch */
+	  }			/* end of scanning one token */
+    }				/* end of user's declarations */
 }				/* end of Ewktlex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1164,20 +1245,20 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
     else
       {
-	  int num_to_read =
+	  yy_size_t num_to_read =
 	      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 	  while (num_to_read <= 0)
 	    {			/* Not enough room in the buffer - grow it. */
 
 		/* just a shorter name for the current buffer */
-		YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+		YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 		int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 		if (b->yy_is_our_buffer)
 		  {
-		      int new_size = b->yy_buf_size * 2;
+		      yy_size_t new_size = b->yy_buf_size * 2;
 
 		      if (new_size <= 0)
 			  b->yy_buf_size += b->yy_buf_size / 8;
@@ -1209,7 +1290,7 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
 	  /* Read in more data. */
 	  YY_INPUT ((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-		    yyg->yy_n_chars, (size_t) num_to_read);
+		    yyg->yy_n_chars, num_to_read);
 
 	  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
       }
@@ -1281,7 +1362,7 @@ yy_get_previous_state (yyscan_t yyscanner)
 	  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
 	    {
 		yy_current_state = (int) yy_def[yy_current_state];
-		if (yy_current_state >= 93)
+		if (yy_current_state >= 150)
 		    yy_c = yy_meta[(unsigned int) yy_c];
 	    }
 	  yy_current_state =
@@ -1312,12 +1393,13 @@ yy_try_NUL_trans (yy_state_type yy_current_state, yyscan_t yyscanner)
     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
       {
 	  yy_current_state = (int) yy_def[yy_current_state];
-	  if (yy_current_state >= 93)
+	  if (yy_current_state >= 150)
 	      yy_c = yy_meta[(unsigned int) yy_c];
       }
     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 92);
+    yy_is_jam = (yy_current_state == 149);
 
+    (void) yyg;
     return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1348,7 +1430,7 @@ input (yyscan_t yyscanner)
 
 	  else
 	    {			/* need more input */
-		int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+		yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 		++yyg->yy_c_buf_p;
 
 		switch (yy_get_next_buffer (yyscanner))
@@ -1517,10 +1599,6 @@ Ewkt_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
     Ewktfree ((void *) b, yyscanner);
 }
 
-#ifndef __cplusplus
-extern int isatty (int);
-#endif /* __cplusplus */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a Ewktrestart() or at EOF.
@@ -1643,7 +1721,7 @@ Ewktpop_buffer_state (yyscan_t yyscanner)
 static void
 Ewktensure_buffer_stack (yyscan_t yyscanner)
 {
-    int num_to_alloc;
+    yy_size_t num_to_alloc;
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
 
     if (!yyg->yy_buffer_stack)
@@ -1743,18 +1821,19 @@ Ewkt_scan_string (yyconst char *yystr, yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to Ewktlex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE
-Ewkt_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
+Ewkt_scan_bytes (yyconst char *yybytes, yy_size_t _yybytes_len,
+		 yyscan_t yyscanner)
 {
     YY_BUFFER_STATE b;
     char *buf;
     yy_size_t n;
-    int i;
+    yy_size_t i;
 
     /* Get memory for full buffer, including space for trailing EOB's. */
     n = _yybytes_len + 2;
@@ -1786,7 +1865,7 @@ Ewkt_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
 static void
 yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
 {
-    (void) fprintf (stderr, "%s\n", msg);
+    (void) spatialite_e ("%s\n", msg);
     exit (YY_EXIT_FAILURE);
 }
 
@@ -1870,7 +1949,7 @@ Ewktget_out (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int
+yy_size_t
 Ewktget_leng (yyscan_t yyscanner)
 {
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
@@ -1910,7 +1989,7 @@ Ewktset_lineno (int line_number, yyscan_t yyscanner)
 
     /* lineno is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Ewktset_lineno called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Ewktset_lineno called with no buffer");
 
     yylineno = line_number;
 }
@@ -1926,7 +2005,7 @@ Ewktset_column (int column_no, yyscan_t yyscanner)
 
     /* column is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Ewktset_column called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Ewktset_column called with no buffer");
 
     yycolumn = column_no;
 }
@@ -2155,6 +2234,10 @@ Ewktfree (void *ptr, yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
+#line 84 "ewktLexer.l"
+
+
+
 int
 Ewktwrap (yyscan_t yyscanner)
 {
diff --git a/src/gaiageo/lex.GeoJson.c b/src/gaiageo/lex.GeoJson.c
index c056df4..e4bb201 100644
--- a/src/gaiageo/lex.GeoJson.c
+++ b/src/gaiageo/lex.GeoJson.c
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -53,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -169,11 +170,17 @@ typedef void *yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -191,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -213,7 +215,7 @@ struct yy_buffer_state
     /* Number of characters read into yy_ch_buf, not including EOB
      * characters.
      */
-    int yy_n_chars;
+    yy_size_t yy_n_chars;
 
     /* Whether we "own" the buffer - i.e., we know we created it,
      * and can realloc() it to grow it, and should free() it to
@@ -295,7 +297,7 @@ static void GeoJson_init_buffer (YY_BUFFER_STATE b, FILE * file,
 YY_BUFFER_STATE GeoJson_scan_buffer (char *base, yy_size_t size,
 				     yyscan_t yyscanner);
 YY_BUFFER_STATE GeoJson_scan_string (yyconst char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE GeoJson_scan_bytes (yyconst char *bytes, int len,
+YY_BUFFER_STATE GeoJson_scan_bytes (yyconst char *bytes, yy_size_t len,
 				    yyscan_t yyscanner);
 
 void *GeoJsonalloc (yy_size_t, yyscan_t yyscanner);
@@ -359,27 +361,33 @@ struct yy_trans_info
     flex_int32_t yy_verify;
     flex_int32_t yy_nxt;
 };
-static yyconst flex_int16_t yy_accept[182] = { 0,
+static yyconst flex_int16_t yy_accept[239] = { 0,
     0, 0, 28, 26, 24, 25, 26, 26, 4, 26,
-    1, 5, 8, 9, 6, 7, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-    1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
+    1, 1, 5, 8, 9, 6, 7, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+    1, 0, 1, 1, 1, 1, 1, 1, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
-    0, 0, 0, 16, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 13, 0, 0, 14, 0,
-    10, 0, 0, 0, 0, 0, 0, 0, 17, 0,
+    0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 0, 0, 0, 0, 0, 0, 0, 0, 16,
 
-    0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+    0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 0, 13, 0, 0, 14,
+    0, 10, 0, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+    0, 17, 0, 0, 0, 0, 0, 1, 1, 1,
+    1, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 18, 0, 20, 0, 0, 12, 15,
-    0, 0, 0, 0, 11, 0, 0, 0, 22, 0,
-    0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
-    0, 0, 0, 23, 0, 0, 0, 0, 0, 3,
-    0
+
+    18, 0, 20, 0, 0, 12, 15, 0, 0, 0,
+    0, 11, 0, 0, 0, 22, 0, 0, 0, 0,
+    0, 0, 0, 0, 21, 0, 0, 0, 0, 0,
+    23, 0, 0, 0, 0, 0, 3, 0
 };
 
 static yyconst flex_int32_t yy_ec[256] = { 0,
@@ -420,110 +428,144 @@ static yyconst flex_int32_t yy_meta[41] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
-static yyconst flex_int16_t yy_base[183] = { 0,
-    0, 39, 203, 204, 204, 204, 68, 193, 204, 4,
-    3, 204, 204, 204, 204, 204, 185, 176, 172, 162,
-    166, 175, 0, 171, 174, 160, 154, 158, 6, 11,
-    8, 181, 12, 172, 157, 157, 158, 0, 154, 153,
-    149, 151, 152, 149, 147, 148, 168, 167, 166, 161,
-    144, 148, 136, 140, 131, 131, 134, 162, 136, 140,
-    131, 138, 151, 151, 150, 148, 133, 139, 128, 119,
-    127, 148, 128, 204, 126, 145, 124, 143, 115, 15,
-    110, 109, 16, 139, 111, 204, 114, 105, 204, 106,
-    204, 112, 128, 25, 103, 102, 107, 102, 204, 102,
-
-    101, 97, 94, 106, 204, 89, 99, 95, 8, 120,
-    103, 95, 94, 110, 108, 88, 93, 86, 77, 204,
-    79, 89, 88, 88, 79, 83, 91, 72, 80, 81,
-    68, 67, 75, 69, 92, 60, 89, 61, 57, 84,
-    83, 61, 57, 204, 44, 204, 46, 71, 204, 204,
-    64, 49, 45, 67, 204, 48, 47, 38, 204, 34,
-    31, 39, 30, 36, 58, 51, 29, 204, 47, 25,
-    38, 49, 21, 204, 24, 16, 43, 16, 47, 204,
-    204, 0
+static yyconst flex_int16_t yy_base[240] = { 0,
+    0, 39, 302, 303, 303, 303, 68, 3, 303, 12,
+    292, 5, 303, 303, 303, 303, 303, 284, 275, 271,
+    261, 265, 274, 0, 270, 273, 259, 253, 257, 280,
+    14, 15, 279, 44, 50, 278, 52, 23, 269, 254,
+    254, 255, 7, 251, 250, 246, 248, 249, 246, 244,
+    245, 61, 265, 58, 63, 264, 86, 92, 93, 263,
+    262, 261, 256, 239, 243, 231, 235, 226, 226, 229,
+    257, 231, 235, 226, 233, 246, 101, 100, 246, 245,
+    244, 106, 107, 243, 242, 241, 240, 239, 238, 113,
+    237, 235, 220, 226, 215, 206, 214, 235, 215, 303,
+
+    213, 232, 211, 230, 202, 223, 222, 221, 116, 220,
+    219, 218, 217, 121, 216, 215, 214, 213, 212, 211,
+    62, 184, 183, 72, 213, 185, 303, 188, 179, 303,
+    180, 303, 186, 202, 201, 200, 199, 198, 197, 196,
+    195, 194, 193, 192, 191, 190, 46, 165, 164, 169,
+    164, 303, 164, 163, 159, 156, 168, 180, 179, 178,
+    177, 303, 147, 157, 153, 9, 178, 161, 153, 152,
+    168, 166, 146, 151, 144, 135, 303, 137, 147, 146,
+    146, 137, 141, 149, 130, 138, 139, 128, 127, 136,
+    131, 154, 122, 152, 124, 120, 149, 148, 126, 122,
+
+    303, 116, 303, 118, 143, 303, 303, 136, 121, 117,
+    139, 303, 120, 119, 110, 303, 106, 103, 110, 101,
+    107, 129, 104, 76, 303, 84, 62, 61, 62, 37,
+    303, 12, 14, 120, 6, 128, 303, 303, 0
 };
 
-static yyconst flex_int16_t yy_def[183] = { 0,
-    182, 182, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    0, 181
+static yyconst flex_int16_t yy_def[240] = { 0,
+    239, 239, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 0, 238
 };
 
-static yyconst flex_int16_t yy_nxt[245] = { 0,
-    4, 5, 6, 7, 8, 9, 10, 30, 11, 12,
-    32, 33, 31, 47, 29, 48, 31, 13, 14, 32,
-    33, 93, 17, 94, 179, 177, 54, 55, 105, 97,
-    40, 98, 41, 94, 118, 119, 176, 175, 15, 16,
-    5, 6, 7, 8, 9, 10, 28, 11, 12, 178,
-    180, 179, 174, 173, 172, 179, 13, 14, 171, 170,
-    169, 168, 167, 166, 165, 164, 163, 162, 161, 160,
-    159, 158, 157, 156, 155, 154, 153, 15, 16, 17,
-    18, 19, 20, 21, 152, 151, 150, 149, 22, 23,
-    148, 147, 146, 24, 145, 144, 143, 25, 142, 26,
-
-    141, 140, 27, 28, 139, 138, 137, 136, 135, 134,
-    133, 132, 131, 130, 129, 128, 127, 126, 125, 124,
-    123, 122, 121, 120, 117, 116, 115, 114, 113, 112,
-    111, 110, 109, 108, 107, 106, 94, 104, 103, 102,
-    101, 100, 99, 96, 95, 92, 91, 90, 89, 88,
-    87, 86, 85, 84, 83, 82, 81, 80, 65, 64,
-    79, 78, 77, 76, 75, 74, 73, 72, 71, 70,
-    69, 68, 67, 66, 49, 65, 64, 63, 62, 61,
-    60, 59, 58, 57, 56, 53, 52, 51, 50, 49,
-    46, 45, 44, 43, 42, 39, 38, 37, 36, 35,
-
-    34, 29, 181, 3, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181
+static yyconst flex_int16_t yy_nxt[344] = { 0,
+    4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+    30, 31, 36, 37, 236, 32, 38, 14, 15, 33,
+    34, 53, 31, 234, 233, 54, 18, 60, 38, 61,
+    45, 62, 46, 67, 68, 175, 176, 54, 16, 17,
+    5, 6, 7, 8, 9, 10, 11, 12, 13, 162,
+    29, 56, 34, 232, 147, 57, 14, 15, 35, 36,
+    37, 58, 79, 38, 80, 231, 81, 57, 146, 52,
+    147, 55, 77, 58, 82, 38, 230, 16, 17, 18,
+    19, 20, 21, 22, 77, 150, 82, 151, 23, 24,
+    84, 229, 85, 25, 86, 228, 87, 26, 88, 27,
+
+    89, 59, 28, 29, 90, 106, 227, 107, 78, 108,
+    111, 109, 112, 226, 113, 83, 90, 118, 114, 119,
+    136, 120, 137, 109, 138, 141, 235, 142, 236, 143,
+    114, 237, 225, 224, 223, 222, 236, 221, 220, 219,
+    218, 217, 216, 215, 214, 213, 212, 211, 210, 209,
+    208, 207, 206, 205, 204, 203, 202, 201, 200, 199,
+    198, 197, 196, 195, 194, 193, 192, 191, 190, 189,
+    188, 187, 186, 185, 184, 183, 182, 181, 180, 179,
+    178, 177, 174, 173, 172, 161, 160, 159, 158, 171,
+    170, 169, 168, 167, 166, 165, 164, 163, 147, 145,
+
+    144, 143, 161, 160, 140, 139, 138, 159, 158, 135,
+    134, 157, 156, 155, 154, 153, 152, 149, 148, 120,
+    145, 144, 117, 116, 115, 113, 140, 139, 110, 108,
+    135, 134, 133, 132, 131, 130, 129, 128, 127, 126,
+    125, 124, 123, 122, 121, 91, 89, 117, 116, 86,
+    86, 115, 81, 81, 110, 105, 104, 103, 102, 101,
+    100, 99, 98, 97, 96, 95, 94, 93, 92, 62,
+    62, 91, 83, 78, 76, 75, 74, 73, 72, 71,
+    70, 69, 66, 65, 64, 63, 59, 55, 52, 51,
+    50, 49, 48, 47, 44, 43, 42, 41, 40, 39,
+
+    35, 238, 3, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238
 };
 
-static yyconst flex_int16_t yy_chk[245] = { 0,
-    182, 1, 1, 1, 1, 1, 1, 10, 1, 1,
-    11, 11, 10, 29, 29, 31, 31, 1, 1, 33,
-    33, 80, 30, 80, 178, 176, 38, 38, 94, 83,
-    23, 83, 23, 94, 109, 109, 175, 173, 1, 1,
-    2, 2, 2, 2, 2, 2, 30, 2, 2, 177,
-    179, 177, 172, 171, 170, 179, 2, 2, 169, 167,
-    166, 165, 164, 163, 162, 161, 160, 158, 157, 156,
-    154, 153, 152, 151, 148, 147, 145, 2, 2, 7,
-    7, 7, 7, 7, 143, 142, 141, 140, 7, 7,
-    139, 138, 137, 7, 136, 135, 134, 7, 133, 7,
-
-    132, 131, 7, 7, 130, 129, 128, 127, 126, 125,
-    124, 123, 122, 121, 119, 118, 117, 116, 115, 114,
-    113, 112, 111, 110, 108, 107, 106, 104, 103, 102,
-    101, 100, 98, 97, 96, 95, 93, 92, 90, 88,
-    87, 85, 84, 82, 81, 79, 78, 77, 76, 75,
-    73, 72, 71, 70, 69, 68, 67, 66, 65, 64,
-    63, 62, 61, 60, 59, 58, 57, 56, 55, 54,
-    53, 52, 51, 50, 49, 48, 47, 46, 45, 44,
-    43, 42, 41, 40, 39, 37, 36, 35, 34, 32,
-    28, 27, 26, 25, 24, 22, 21, 20, 19, 18,
-
-    17, 8, 3, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
-    181, 181, 181, 181
+static yyconst flex_int16_t yy_chk[344] = { 0,
+    239, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    8, 8, 12, 12, 235, 10, 12, 1, 1, 10,
+    10, 31, 31, 233, 232, 31, 32, 38, 12, 38,
+    24, 38, 24, 43, 43, 166, 166, 31, 1, 1,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 147,
+    32, 34, 34, 230, 147, 34, 2, 2, 35, 37,
+    37, 35, 54, 37, 54, 229, 54, 34, 121, 52,
+    121, 55, 52, 35, 55, 37, 228, 2, 2, 7,
+    7, 7, 7, 7, 52, 124, 55, 124, 7, 7,
+    57, 227, 57, 7, 57, 226, 58, 7, 58, 7,
+
+    58, 59, 7, 7, 59, 77, 224, 77, 78, 77,
+    82, 78, 82, 223, 82, 83, 59, 90, 83, 90,
+    109, 90, 109, 78, 109, 114, 234, 114, 234, 114,
+    83, 236, 222, 221, 220, 219, 236, 218, 217, 215,
+    214, 213, 211, 210, 209, 208, 205, 204, 202, 200,
+    199, 198, 197, 196, 195, 194, 193, 192, 191, 190,
+    189, 188, 187, 186, 185, 184, 183, 182, 181, 180,
+    179, 178, 176, 175, 174, 173, 172, 171, 170, 169,
+    168, 167, 165, 164, 163, 161, 160, 159, 158, 157,
+    156, 155, 154, 153, 151, 150, 149, 148, 146, 145,
+
+    144, 143, 142, 141, 140, 139, 138, 137, 136, 135,
+    134, 133, 131, 129, 128, 126, 125, 123, 122, 120,
+    119, 118, 117, 116, 115, 113, 112, 111, 110, 108,
+    107, 106, 105, 104, 103, 102, 101, 99, 98, 97,
+    96, 95, 94, 93, 92, 91, 89, 88, 87, 86,
+    85, 84, 81, 80, 79, 76, 75, 74, 73, 72,
+    71, 70, 69, 68, 67, 66, 65, 64, 63, 62,
+    61, 60, 56, 53, 51, 50, 49, 48, 47, 46,
+    45, 44, 42, 41, 40, 39, 36, 33, 30, 29,
+    28, 27, 26, 25, 23, 22, 21, 20, 19, 18,
+
+    11, 3, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+    238, 238, 238
 };
 
 /* The intent behind this definition is that it'll catch
@@ -533,6 +575,7 @@ static yyconst flex_int16_t yy_chk[245] = { 0,
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "geoJsonLexer.l"
 /* 
  geoJsonLexer.l -- GeoJSON parser - FLEX config
   
@@ -585,6 +628,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  Flex would match both POINT and POINTM, but since POINTM is the longer
 *  of the two tokens, FLEX will match POINTM.
 */
+#line 634 "lex.GeoJson.c"
 
 #define INITIAL 0
 
@@ -611,8 +655,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max;	/**< capacity of stack. */
     YY_BUFFER_STATE *yy_buffer_stack;  /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -659,7 +703,7 @@ FILE *GeoJsonget_out (yyscan_t yyscanner);
 
 void GeoJsonset_out (FILE * out_str, yyscan_t yyscanner);
 
-int GeoJsonget_leng (yyscan_t yyscanner);
+yy_size_t GeoJsonget_leng (yyscan_t yyscanner);
 
 char *GeoJsonget_text (yyscan_t yyscanner);
 
@@ -722,7 +766,7 @@ static int input (yyscan_t yyscanner);
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		unsigned n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -832,347 +876,388 @@ YY_DECL
 	  GeoJson_load_buffer_state (yyscanner);
       }
 
-    while (1)			/* loops until end-of-file is reached */
-      {
-	  yy_cp = yyg->yy_c_buf_p;
-
-	  /* Support of yytext. */
-	  *yy_cp = yyg->yy_hold_char;
+    {
+#line 59 "geoJsonLexer.l"
 
-	  /* yy_bp points to the position in yy_ch_buf of the start of
-	   * the current run.
-	   */
-	  yy_bp = yy_cp;
-
-	  yy_current_state = yyg->yy_start;
-	yy_match:
-	  do
-	    {
-		register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
-		if (yy_accept[yy_current_state])
-		  {
-		      yyg->yy_last_accepting_state = yy_current_state;
-		      yyg->yy_last_accepting_cpos = yy_cp;
-		  }
-		while (yy_chk[yy_base[yy_current_state] + yy_c] !=
-		       yy_current_state)
-		  {
-		      yy_current_state = (int) yy_def[yy_current_state];
-		      if (yy_current_state >= 182)
-			  yy_c = yy_meta[(unsigned int) yy_c];
-		  }
-		yy_current_state =
-		    yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		++yy_cp;
-	    }
-	  while (yy_base[yy_current_state] != 204);
-
-	yy_find_action:
-	  yy_act = yy_accept[yy_current_state];
-	  if (yy_act == 0)
-	    {			/* have to back up */
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		yy_act = yy_accept[yy_current_state];
-	    }
+#line 884 "lex.GeoJson.c"
 
-	  YY_DO_BEFORE_ACTION;
+	while (1)		/* loops until end-of-file is reached */
+	  {
+	      yy_cp = yyg->yy_c_buf_p;
 
-	do_action:		/* This label is used only to access EOF actions. */
+	      /* Support of yytext. */
+	      *yy_cp = yyg->yy_hold_char;
 
-	  switch (yy_act)
-	    {			/* beginning of action switch */
-	    case 0:		/* must back up */
-		/* undo the effects of YY_DO_BEFORE_ACTION */
-		*yy_cp = yyg->yy_hold_char;
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		goto yy_find_action;
+	      /* yy_bp points to the position in yy_ch_buf of the start of
+	       * the current run.
+	       */
+	      yy_bp = yy_cp;
 
-	    case 1:
-		YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col +=
-			(int) strlen (yytext);
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval =
-			atof (yytext);
-		    return GEOJSON_NUM;
-		}
-		YY_BREAK case 2:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col +=
-			(int) strlen (yytext);
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.ival =
-			atoi (yytext + 6);
-		    return GEOJSON_SHORT_SRID;
-		}
-		YY_BREAK case 3:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col +=
-			(int) strlen (yytext);
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.ival =
-			atoi (yytext + 22);
-		    return GEOJSON_LONG_SRID;
-		}
-		YY_BREAK case 4:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_COMMA;
-		}
-		YY_BREAK case 5:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_COLON;
-		}
-		YY_BREAK case 6:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_OPEN_BRACE;
-		}
-		YY_BREAK case 7:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_CLOSE_BRACE;
-		}
-		YY_BREAK case 8:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_OPEN_BRACKET;
-		}
-		YY_BREAK case 9:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_CLOSE_BRACKET;
-		}
-		YY_BREAK case 10:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_TYPE;
-		}
-		YY_BREAK case 11:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_COORDS;
-		}
-		YY_BREAK case 12:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_GEOMS;
-		}
-		YY_BREAK case 13:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_BBOX;
-		}
-		YY_BREAK case 14:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_NAME;
-		}
-		YY_BREAK case 15:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_PROPS;
-		}
-		YY_BREAK case 16:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_CRS;
-		}
-		YY_BREAK case 17:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_POINT;
-		}
-		YY_BREAK case 18:YY_RULE_SETUP
+	      yy_current_state = yyg->yy_start;
+	    yy_match:
+	      do
 		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_LINESTRING;
-		}
-		YY_BREAK case 19:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_POLYGON;
-		}
-		YY_BREAK case 20:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_MULTIPOINT;
-		}
-		YY_BREAK case 21:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_MULTILINESTRING;
-		}
-		YY_BREAK case 22:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_MULTIPOLYGON;
-		}
-		YY_BREAK case 23:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
-		    return GEOJSON_GEOMETRYCOLLECTION;
-		}
-		YY_BREAK case 24:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col +=
-			(int) strlen (yytext);
-		}		/* ignore but count white space */
-		YY_BREAK case 25:
-/* rule 25 can match eol */
-		  YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col = 0;
-		    GeoJsonget_extra (yyscanner)->geoJson_line++;
+		    register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
+		    if (yy_accept[yy_current_state])
+		      {
+			  yyg->yy_last_accepting_state = yy_current_state;
+			  yyg->yy_last_accepting_cpos = yy_cp;
+		      }
+		    while (yy_chk[yy_base[yy_current_state] + yy_c] !=
+			   yy_current_state)
+		      {
+			  yy_current_state = (int) yy_def[yy_current_state];
+			  if (yy_current_state >= 239)
+			      yy_c = yy_meta[(unsigned int) yy_c];
+		      }
+		    yy_current_state =
+			yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		    ++yy_cp;
 		}
-		YY_BREAK case 26:YY_RULE_SETUP
-		{
-		    GeoJsonget_extra (yyscanner)->geoJson_col +=
-			(int) strlen (yytext);
-		    return -1;
+	      while (yy_base[yy_current_state] != 303);
+
+	    yy_find_action:
+	      yy_act = yy_accept[yy_current_state];
+	      if (yy_act == 0)
+		{		/* have to back up */
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    yy_act = yy_accept[yy_current_state];
 		}
-		YY_BREAK case 27:YY_RULE_SETUP ECHO;
-		YY_BREAK case YY_STATE_EOF (INITIAL):yyterminate ();
-
-	    case YY_END_OF_BUFFER:
-		{
-		    /* Amount of text matched not including the EOB char. */
-		    int yy_amount_of_matched_text =
-			(int) (yy_cp - yyg->yytext_ptr) - 1;
 
-		    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-		    *yy_cp = yyg->yy_hold_char;
-		    YY_RESTORE_YY_MORE_OFFSET
-			if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
-			    YY_BUFFER_NEW)
-		      {
-			  /* We're scanning a new file or input source.  It's
-			   * possible that this happened because the user
-			   * just pointed yyin at a new source and called
-			   * GeoJsonlex().  If so, then we have to assure
-			   * consistency between YY_CURRENT_BUFFER and our
-			   * globals.  Here is the right place to do so, because
-			   * this is the first action (other than possibly a
-			   * back-up) that will match for the new input source.
-			   */
-			  yyg->yy_n_chars =
-			      YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-			      YY_BUFFER_NORMAL;
-		      }
+	      YY_DO_BEFORE_ACTION;
 
-		    /* Note that here we test for yy_c_buf_p "<=" to the position
-		     * of the first EOB in the buffer, since yy_c_buf_p will
-		     * already have been incremented past the NUL character
-		     * (since all states make transitions on EOB to the
-		     * end-of-buffer state).  Contrast this with the test
-		     * in input().
-		     */
-		    if (yyg->yy_c_buf_p <=
-			&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-		      {		/* This was really a NUL. */
-			  yy_state_type yy_next_state;
-
-			  yyg->yy_c_buf_p =
-			      yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			  yy_current_state = yy_get_previous_state (yyscanner);
-
-			  /* Okay, we're now positioned to make the NUL
-			   * transition.  We couldn't have
-			   * yy_get_previous_state() go ahead and do it
-			   * for us because it doesn't know how to deal
-			   * with the possibility of jamming (and we don't
-			   * want to build jamming into it because then it
-			   * will run more slowly).
-			   */
-
-			  yy_next_state =
-			      yy_try_NUL_trans (yy_current_state, yyscanner);
-
-			  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			  if (yy_next_state)
-			    {
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-			    }
-
-			  else
-			    {
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-			    }
-		      }
+	    do_action:		/* This label is used only to access EOF actions. */
 
-		    else
-			switch (yy_get_next_buffer (yyscanner))
+	      switch (yy_act)
+		{		/* beginning of action switch */
+		case 0:	/* must back up */
+		    /* undo the effects of YY_DO_BEFORE_ACTION */
+		    *yy_cp = yyg->yy_hold_char;
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    goto yy_find_action;
+
+		case 1:
+		    YY_RULE_SETUP
+#line 60 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col +=
+			    (int) strlen (yytext);
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval =
+			    atof (yytext);
+			return GEOJSON_NUM;
+		    }
+		    YY_BREAK case 2:YY_RULE_SETUP
+#line 61 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col +=
+			    (int) strlen (yytext);
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.ival =
+			    atoi (yytext + 6);
+			return GEOJSON_SHORT_SRID;
+		    }
+		    YY_BREAK case 3:YY_RULE_SETUP
+#line 62 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col +=
+			    (int) strlen (yytext);
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.ival =
+			    atoi (yytext + 22);
+			return GEOJSON_LONG_SRID;
+		    }
+		    YY_BREAK case 4:YY_RULE_SETUP
+#line 63 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_COMMA;
+		    }
+		    YY_BREAK case 5:YY_RULE_SETUP
+#line 64 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_COLON;
+		    }
+		    YY_BREAK case 6:YY_RULE_SETUP
+#line 65 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_OPEN_BRACE;
+		    }
+		    YY_BREAK case 7:YY_RULE_SETUP
+#line 66 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_CLOSE_BRACE;
+		    }
+		    YY_BREAK case 8:YY_RULE_SETUP
+#line 67 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_OPEN_BRACKET;
+		    }
+		    YY_BREAK case 9:YY_RULE_SETUP
+#line 68 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_CLOSE_BRACKET;
+		    }
+		    YY_BREAK case 10:YY_RULE_SETUP
+#line 69 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_TYPE;
+		    }
+		    YY_BREAK case 11:YY_RULE_SETUP
+#line 70 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_COORDS;
+		    }
+		    YY_BREAK case 12:YY_RULE_SETUP
+#line 71 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_GEOMS;
+		    }
+		    YY_BREAK case 13:YY_RULE_SETUP
+#line 72 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_BBOX;
+		    }
+		    YY_BREAK case 14:YY_RULE_SETUP
+#line 73 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_NAME;
+		    }
+		    YY_BREAK case 15:YY_RULE_SETUP
+#line 74 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_PROPS;
+		    }
+		    YY_BREAK case 16:YY_RULE_SETUP
+#line 75 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_CRS;
+		    }
+		    YY_BREAK case 17:YY_RULE_SETUP
+#line 76 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_POINT;
+		    }
+		    YY_BREAK case 18:YY_RULE_SETUP
+#line 77 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_LINESTRING;
+		    }
+		    YY_BREAK case 19:YY_RULE_SETUP
+#line 78 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_POLYGON;
+		    }
+		    YY_BREAK case 20:YY_RULE_SETUP
+#line 79 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_MULTIPOINT;
+		    }
+		    YY_BREAK case 21:YY_RULE_SETUP
+#line 80 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_MULTILINESTRING;
+		    }
+		    YY_BREAK case 22:YY_RULE_SETUP
+#line 81 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_MULTIPOLYGON;
+		    }
+		    YY_BREAK case 23:YY_RULE_SETUP
+#line 82 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->GeoJsonLval.dval = 0;
+			return GEOJSON_GEOMETRYCOLLECTION;
+		    }
+		    YY_BREAK case 24:YY_RULE_SETUP
+#line 84 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col +=
+			    (int) strlen (yytext);
+		    }		/* ignore but count white space */
+		    YY_BREAK case 25:
+/* rule 25 can match eol */
+		      YY_RULE_SETUP
+#line 86 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col = 0;
+			GeoJsonget_extra (yyscanner)->geoJson_line++;
+		    }
+		    YY_BREAK case 26:YY_RULE_SETUP
+#line 88 "geoJsonLexer.l"
+		    {
+			GeoJsonget_extra (yyscanner)->geoJson_col +=
+			    (int) strlen (yytext);
+			return -1;
+		    }
+		    YY_BREAK case 27:YY_RULE_SETUP
+#line 89 "geoJsonLexer.l"
+		      ECHO;
+		    YY_BREAK
+#line 1077 "lex.GeoJson.c"
+		case YY_STATE_EOF (INITIAL):
+		    yyterminate ();
+
+		case YY_END_OF_BUFFER:
+		    {
+			/* Amount of text matched not including the EOB char. */
+			int yy_amount_of_matched_text =
+			    (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+			/* Undo the effects of YY_DO_BEFORE_ACTION. */
+			*yy_cp = yyg->yy_hold_char;
+			YY_RESTORE_YY_MORE_OFFSET
+			    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
+				YY_BUFFER_NEW)
 			  {
-			  case EOB_ACT_END_OF_FILE:
-			      {
-				  yyg->yy_did_buffer_switch_on_eof = 0;
-
-				  if (GeoJsonwrap (yyscanner))
-				    {
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p =
-					    yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF (YY_START);
-					goto do_action;
-				    }
-
-				  else
-				    {
-					if (!yyg->yy_did_buffer_switch_on_eof)
-					    YY_NEW_FILE;
-				    }
-				  break;
-			      }
+			      /* We're scanning a new file or input source.  It's
+			       * possible that this happened because the user
+			       * just pointed yyin at a new source and called
+			       * GeoJsonlex().  If so, then we have to assure
+			       * consistency between YY_CURRENT_BUFFER and our
+			       * globals.  Here is the right place to do so, because
+			       * this is the first action (other than possibly a
+			       * back-up) that will match for the new input source.
+			       */
+			      yyg->yy_n_chars =
+				  YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				  YY_BUFFER_NORMAL;
+			  }
+
+			/* Note that here we test for yy_c_buf_p "<=" to the position
+			 * of the first EOB in the buffer, since yy_c_buf_p will
+			 * already have been incremented past the NUL character
+			 * (since all states make transitions on EOB to the
+			 * end-of-buffer state).  Contrast this with the test
+			 * in input().
+			 */
+			if (yyg->yy_c_buf_p <=
+			    &YY_CURRENT_BUFFER_LVALUE->
+			    yy_ch_buf[yyg->yy_n_chars])
+			  {	/* This was really a NUL. */
+			      yy_state_type yy_next_state;
 
-			  case EOB_ACT_CONTINUE_SCAN:
 			      yyg->yy_c_buf_p =
 				  yyg->yytext_ptr + yy_amount_of_matched_text;
 
 			      yy_current_state =
 				  yy_get_previous_state (yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
-			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_match;
+			      /* Okay, we're now positioned to make the NUL
+			       * transition.  We couldn't have
+			       * yy_get_previous_state() go ahead and do it
+			       * for us because it doesn't know how to deal
+			       * with the possibility of jamming (and we don't
+			       * want to build jamming into it because then it
+			       * will run more slowly).
+			       */
 
-			  case EOB_ACT_LAST_MATCH:
-			      yyg->yy_c_buf_p =
-				  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->
-								       yy_n_chars];
+			      yy_next_state =
+				  yy_try_NUL_trans (yy_current_state,
+						    yyscanner);
 
-			      yy_current_state =
-				  yy_get_previous_state (yyscanner);
-
-			      yy_cp = yyg->yy_c_buf_p;
 			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_find_action;
+
+			      if (yy_next_state)
+				{
+				    /* Consume the NUL. */
+				    yy_cp = ++yyg->yy_c_buf_p;
+				    yy_current_state = yy_next_state;
+				    goto yy_match;
+				}
+
+			      else
+				{
+				    yy_cp = yyg->yy_c_buf_p;
+				    goto yy_find_action;
+				}
 			  }
-		    break;
-		}
 
-	    default:
-		YY_FATAL_ERROR
-		    ("fatal flex scanner internal error--no action found");
-	    }			/* end of action switch */
-      }				/* end of scanning one token */
+			else
+			    switch (yy_get_next_buffer (yyscanner))
+			      {
+			      case EOB_ACT_END_OF_FILE:
+				  {
+				      yyg->yy_did_buffer_switch_on_eof = 0;
+
+				      if (GeoJsonwrap (yyscanner))
+					{
+					    /* Note: because we've taken care in
+					     * yy_get_next_buffer() to have set up
+					     * yytext, we can now set up
+					     * yy_c_buf_p so that if some total
+					     * hoser (like flex itself) wants to
+					     * call the scanner after we return the
+					     * YY_NULL, it'll still work - another
+					     * YY_NULL will get returned.
+					     */
+					    yyg->yy_c_buf_p =
+						yyg->yytext_ptr + YY_MORE_ADJ;
+
+					    yy_act = YY_STATE_EOF (YY_START);
+					    goto do_action;
+					}
+
+				      else
+					{
+					    if (!yyg->yy_did_buffer_switch_on_eof)
+						YY_NEW_FILE;
+					}
+				      break;
+				  }
+
+			      case EOB_ACT_CONTINUE_SCAN:
+				  yyg->yy_c_buf_p =
+				      yyg->yytext_ptr +
+				      yy_amount_of_matched_text;
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_match;
+
+			      case EOB_ACT_LAST_MATCH:
+				  yyg->yy_c_buf_p =
+				      &YY_CURRENT_BUFFER_LVALUE->
+				      yy_ch_buf[yyg->yy_n_chars];
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_find_action;
+			      }
+			break;
+		    }
+
+		default:
+		    YY_FATAL_ERROR
+			("fatal flex scanner internal error--no action found");
+		}		/* end of action switch */
+	  }			/* end of scanning one token */
+    }				/* end of user's declarations */
 }				/* end of GeoJsonlex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1231,20 +1316,20 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
     else
       {
-	  int num_to_read =
+	  yy_size_t num_to_read =
 	      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 	  while (num_to_read <= 0)
 	    {			/* Not enough room in the buffer - grow it. */
 
 		/* just a shorter name for the current buffer */
-		YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+		YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 		int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 		if (b->yy_is_our_buffer)
 		  {
-		      int new_size = b->yy_buf_size * 2;
+		      yy_size_t new_size = b->yy_buf_size * 2;
 
 		      if (new_size <= 0)
 			  b->yy_buf_size += b->yy_buf_size / 8;
@@ -1276,7 +1361,7 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
 	  /* Read in more data. */
 	  YY_INPUT ((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-		    yyg->yy_n_chars, (size_t) num_to_read);
+		    yyg->yy_n_chars, num_to_read);
 
 	  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
       }
@@ -1348,7 +1433,7 @@ yy_get_previous_state (yyscan_t yyscanner)
 	  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
 	    {
 		yy_current_state = (int) yy_def[yy_current_state];
-		if (yy_current_state >= 182)
+		if (yy_current_state >= 239)
 		    yy_c = yy_meta[(unsigned int) yy_c];
 	    }
 	  yy_current_state =
@@ -1379,12 +1464,13 @@ yy_try_NUL_trans (yy_state_type yy_current_state, yyscan_t yyscanner)
     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
       {
 	  yy_current_state = (int) yy_def[yy_current_state];
-	  if (yy_current_state >= 182)
+	  if (yy_current_state >= 239)
 	      yy_c = yy_meta[(unsigned int) yy_c];
       }
     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 181);
+    yy_is_jam = (yy_current_state == 238);
 
+    (void) yyg;
     return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1415,7 +1501,7 @@ input (yyscan_t yyscanner)
 
 	  else
 	    {			/* need more input */
-		int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+		yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 		++yyg->yy_c_buf_p;
 
 		switch (yy_get_next_buffer (yyscanner))
@@ -1584,10 +1670,6 @@ GeoJson_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
     GeoJsonfree ((void *) b, yyscanner);
 }
 
-#ifndef __cplusplus
-extern int isatty (int);
-#endif /* __cplusplus */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a GeoJsonrestart() or at EOF.
@@ -1710,7 +1792,7 @@ GeoJsonpop_buffer_state (yyscan_t yyscanner)
 static void
 GeoJsonensure_buffer_stack (yyscan_t yyscanner)
 {
-    int num_to_alloc;
+    yy_size_t num_to_alloc;
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
 
     if (!yyg->yy_buffer_stack)
@@ -1810,18 +1892,19 @@ GeoJson_scan_string (yyconst char *yystr, yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to GeoJsonlex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE
-GeoJson_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
+GeoJson_scan_bytes (yyconst char *yybytes, yy_size_t _yybytes_len,
+		    yyscan_t yyscanner)
 {
     YY_BUFFER_STATE b;
     char *buf;
     yy_size_t n;
-    int i;
+    yy_size_t i;
 
     /* Get memory for full buffer, including space for trailing EOB's. */
     n = _yybytes_len + 2;
@@ -1853,7 +1936,7 @@ GeoJson_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
 static void
 yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
 {
-    (void) fprintf (stderr, "%s\n", msg);
+    (void) spatialite_e ("%s\n", msg);
     exit (YY_EXIT_FAILURE);
 }
 
@@ -1937,7 +2020,7 @@ GeoJsonget_out (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int
+yy_size_t
 GeoJsonget_leng (yyscan_t yyscanner)
 {
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
@@ -1977,7 +2060,7 @@ GeoJsonset_lineno (int line_number, yyscan_t yyscanner)
 
     /* lineno is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("GeoJsonset_lineno called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("GeoJsonset_lineno called with no buffer");
 
     yylineno = line_number;
 }
@@ -1993,7 +2076,7 @@ GeoJsonset_column (int column_no, yyscan_t yyscanner)
 
     /* column is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("GeoJsonset_column called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("GeoJsonset_column called with no buffer");
 
     yycolumn = column_no;
 }
@@ -2222,6 +2305,10 @@ GeoJsonfree (void *ptr, yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
+#line 89 "geoJsonLexer.l"
+
+
+
 int
 GeoJsonwrap (yyscan_t yyscanner)
 {
diff --git a/src/gaiageo/lex.Gml.c b/src/gaiageo/lex.Gml.c
index 281f673..067c9a8 100644
--- a/src/gaiageo/lex.Gml.c
+++ b/src/gaiageo/lex.Gml.c
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -53,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -169,11 +170,17 @@ typedef void *yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -191,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -213,7 +215,7 @@ struct yy_buffer_state
     /* Number of characters read into yy_ch_buf, not including EOB
      * characters.
      */
-    int yy_n_chars;
+    yy_size_t yy_n_chars;
 
     /* Whether we "own" the buffer - i.e., we know we created it,
      * and can realloc() it to grow it, and should free() it to
@@ -294,7 +296,7 @@ static void Gml_init_buffer (YY_BUFFER_STATE b, FILE * file,
 YY_BUFFER_STATE Gml_scan_buffer (char *base, yy_size_t size,
 				 yyscan_t yyscanner);
 YY_BUFFER_STATE Gml_scan_string (yyconst char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE Gml_scan_bytes (yyconst char *bytes, int len,
+YY_BUFFER_STATE Gml_scan_bytes (yyconst char *bytes, yy_size_t len,
 				yyscan_t yyscanner);
 
 void *Gmlalloc (yy_size_t, yyscan_t yyscanner);
@@ -358,9 +360,9 @@ struct yy_trans_info
     flex_int32_t yy_verify;
     flex_int32_t yy_nxt;
 };
-static yyconst flex_int16_t yy_accept[19] = { 0,
+static yyconst flex_int16_t yy_accept[21] = { 0,
     5, 5, 12, 10, 8, 9, 10, 5, 1, 3,
-    2, 4, 7, 0, 6, 5, 7, 0
+    2, 4, 7, 5, 0, 6, 5, 7, 5, 0
 };
 
 static yyconst flex_int32_t yy_ec[256] = { 0,
@@ -370,12 +372,12 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
     1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
     1, 1, 5, 5, 5, 5, 6, 7, 7, 7,
     7, 7, 7, 7, 7, 7, 7, 8, 1, 9,
-    10, 11, 1, 1, 12, 12, 12, 12, 12, 12,
+    10, 11, 1, 1, 12, 12, 12, 12, 13, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     1, 1, 1, 1, 12, 1, 12, 12, 12, 12,
 
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    13, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 1, 1, 1, 1, 1, 1, 1, 1,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -394,35 +396,37 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
     1, 1, 1, 1, 1
 };
 
-static yyconst flex_int32_t yy_meta[13] = { 0,
+static yyconst flex_int32_t yy_meta[14] = { 0,
     1, 1, 1, 1, 2, 1, 3, 4, 5, 1,
-    5, 4
+    5, 4, 3
 };
 
-static yyconst flex_int16_t yy_base[22] = { 0,
-    0, 0, 23, 24, 24, 24, 18, 0, 24, 24,
-    24, 24, 0, 17, 24, 0, 0, 24, 12, 15,
-    16
+static yyconst flex_int16_t yy_base[24] = { 0,
+    0, 0, 19, 31, 31, 31, 14, 0, 31, 31,
+    31, 31, 0, 9, 11, 31, 0, 0, 0, 31,
+    22, 25, 26
 };
 
-static yyconst flex_int16_t yy_def[22] = { 0,
-    18, 1, 18, 18, 18, 18, 19, 20, 18, 18,
-    18, 18, 21, 19, 18, 20, 21, 0, 18, 18,
-    18
+static yyconst flex_int16_t yy_def[24] = { 0,
+    20, 1, 20, 20, 20, 20, 21, 22, 20, 20,
+    20, 20, 23, 20, 21, 20, 22, 23, 14, 0,
+    20, 20, 20
 };
 
-static yyconst flex_int16_t yy_nxt[37] = { 0,
+static yyconst flex_int16_t yy_nxt[45] = { 0,
     4, 5, 6, 7, 8, 9, 8, 4, 10, 11,
-    12, 13, 14, 14, 14, 14, 16, 16, 17, 17,
-    15, 15, 18, 3, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18
+    12, 13, 14, 17, 16, 19, 18, 16, 20, 20,
+    18, 19, 15, 15, 15, 15, 17, 17, 18, 18,
+    3, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+    20, 20, 20, 20
 };
 
-static yyconst flex_int16_t yy_chk[37] = { 0,
+static yyconst flex_int16_t yy_chk[45] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 19, 19, 19, 19, 20, 20, 21, 21,
-    14, 7, 3, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18
+    1, 1, 1, 14, 15, 14, 14, 7, 3, 0,
+    14, 14, 21, 21, 21, 21, 22, 22, 23, 23,
+    20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+    20, 20, 20, 20
 };
 
 /* The intent behind this definition is that it'll catch
@@ -432,6 +436,7 @@ static yyconst flex_int16_t yy_chk[37] = { 0,
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "gmlLexer.l"
 /* 
  gmlLexer.l -- GML parser - FLEX config
   
@@ -484,6 +489,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  Flex would match both POINT and POINTM, but since POINTM is the longer
 *  of the two tokens, FLEX will match POINTM.
 */
+#line 496 "lex.Gml.c"
 
 #define INITIAL 0
 
@@ -510,8 +516,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max;	/**< capacity of stack. */
     YY_BUFFER_STATE *yy_buffer_stack;  /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -558,7 +564,7 @@ FILE *Gmlget_out (yyscan_t yyscanner);
 
 void Gmlset_out (FILE * out_str, yyscan_t yyscanner);
 
-int Gmlget_leng (yyscan_t yyscanner);
+yy_size_t Gmlget_leng (yyscan_t yyscanner);
 
 char *Gmlget_text (yyscan_t yyscanner);
 
@@ -621,7 +627,7 @@ static int input (yyscan_t yyscanner);
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		unsigned n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -731,264 +737,308 @@ YY_DECL
 	  Gml_load_buffer_state (yyscanner);
       }
 
-    while (1)			/* loops until end-of-file is reached */
-      {
-	  yy_cp = yyg->yy_c_buf_p;
+    {
+#line 59 "gmlLexer.l"
 
-	  /* Support of yytext. */
-	  *yy_cp = yyg->yy_hold_char;
-
-	  /* yy_bp points to the position in yy_ch_buf of the start of
-	   * the current run.
-	   */
-	  yy_bp = yy_cp;
-
-	  yy_current_state = yyg->yy_start;
-	yy_match:
-	  do
-	    {
-		register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
-		if (yy_accept[yy_current_state])
-		  {
-		      yyg->yy_last_accepting_state = yy_current_state;
-		      yyg->yy_last_accepting_cpos = yy_cp;
-		  }
-		while (yy_chk[yy_base[yy_current_state] + yy_c] !=
-		       yy_current_state)
-		  {
-		      yy_current_state = (int) yy_def[yy_current_state];
-		      if (yy_current_state >= 19)
-			  yy_c = yy_meta[(unsigned int) yy_c];
-		  }
-		yy_current_state =
-		    yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		++yy_cp;
-	    }
-	  while (yy_base[yy_current_state] != 24);
-
-	yy_find_action:
-	  yy_act = yy_accept[yy_current_state];
-	  if (yy_act == 0)
-	    {			/* have to back up */
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		yy_act = yy_accept[yy_current_state];
-	    }
+#line 746 "lex.Gml.c"
 
-	  YY_DO_BEFORE_ACTION;
+	while (1)		/* loops until end-of-file is reached */
+	  {
+	      yy_cp = yyg->yy_c_buf_p;
 
-	do_action:		/* This label is used only to access EOF actions. */
+	      /* Support of yytext. */
+	      *yy_cp = yyg->yy_hold_char;
 
-	  switch (yy_act)
-	    {			/* beginning of action switch */
-	    case 0:		/* must back up */
-		/* undo the effects of YY_DO_BEFORE_ACTION */
-		*yy_cp = yyg->yy_hold_char;
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		goto yy_find_action;
+	      /* yy_bp points to the position in yy_ch_buf of the start of
+	       * the current run.
+	       */
+	      yy_bp = yy_cp;
 
-	    case 1:
-		YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    return GML_END;
-		}
-		YY_BREAK case 2:YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    return GML_EQ;
-		}
-		YY_BREAK case 3:YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    return GML_OPEN;
-		}
-		YY_BREAK case 4:YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    return GML_CLOSE;
-		}
-		YY_BREAK case 5:YY_RULE_SETUP
-		{
-		    gml_saveString (&(Gmlget_extra (yyscanner)->GmlLval.pval),
-				    yytext);
-		    return GML_COORD;
-		}
-		YY_BREAK case 6:
-/* rule 6 can match eol */
-		  YY_RULE_SETUP
-		{
-		    gml_saveString (&(Gmlget_extra (yyscanner)->GmlLval.pval),
-				    yytext);
-		    return GML_VALUE;
-		}
-		YY_BREAK case 7:YY_RULE_SETUP
+	      yy_current_state = yyg->yy_start;
+	    yy_match:
+	      do
 		{
-		    gml_saveString (&(Gmlget_extra (yyscanner)->GmlLval.pval),
-				    yytext);
-		    return GML_KEYWORD;
-		}
-		YY_BREAK case 8:YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    Gmlget_extra (yyscanner)->gml_col += (int) strlen (yytext);
-		}		/* ignore but count white space */
-		YY_BREAK case 9:
-/* rule 9 can match eol */
-		  YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    Gmlget_extra (yyscanner)->gml_col = 0;
-		    Gmlget_extra (yyscanner)->gml_line++;
+		    register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
+		    if (yy_accept[yy_current_state])
+		      {
+			  yyg->yy_last_accepting_state = yy_current_state;
+			  yyg->yy_last_accepting_cpos = yy_cp;
+		      }
+		    while (yy_chk[yy_base[yy_current_state] + yy_c] !=
+			   yy_current_state)
+		      {
+			  yy_current_state = (int) yy_def[yy_current_state];
+			  if (yy_current_state >= 21)
+			      yy_c = yy_meta[(unsigned int) yy_c];
+		      }
+		    yy_current_state =
+			yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		    ++yy_cp;
 		}
-		YY_BREAK case 10:YY_RULE_SETUP
-		{
-		    gml_freeString (&(Gmlget_extra (yyscanner)->GmlLval.pval));
-		    Gmlget_extra (yyscanner)->gml_col += (int) strlen (yytext);
-		    return -1;
+	      while (yy_base[yy_current_state] != 31);
+
+	    yy_find_action:
+	      yy_act = yy_accept[yy_current_state];
+	      if (yy_act == 0)
+		{		/* have to back up */
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    yy_act = yy_accept[yy_current_state];
 		}
-		YY_BREAK case 11:YY_RULE_SETUP ECHO;
-		YY_BREAK case YY_STATE_EOF (INITIAL):yyterminate ();
 
-	    case YY_END_OF_BUFFER:
-		{
-		    /* Amount of text matched not including the EOB char. */
-		    int yy_amount_of_matched_text =
-			(int) (yy_cp - yyg->yytext_ptr) - 1;
+	      YY_DO_BEFORE_ACTION;
 
-		    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-		    *yy_cp = yyg->yy_hold_char;
-		    YY_RESTORE_YY_MORE_OFFSET
-			if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
-			    YY_BUFFER_NEW)
-		      {
-			  /* We're scanning a new file or input source.  It's
-			   * possible that this happened because the user
-			   * just pointed yyin at a new source and called
-			   * Gmllex().  If so, then we have to assure
-			   * consistency between YY_CURRENT_BUFFER and our
-			   * globals.  Here is the right place to do so, because
-			   * this is the first action (other than possibly a
-			   * back-up) that will match for the new input source.
-			   */
-			  yyg->yy_n_chars =
-			      YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-			      YY_BUFFER_NORMAL;
-		      }
-
-		    /* Note that here we test for yy_c_buf_p "<=" to the position
-		     * of the first EOB in the buffer, since yy_c_buf_p will
-		     * already have been incremented past the NUL character
-		     * (since all states make transitions on EOB to the
-		     * end-of-buffer state).  Contrast this with the test
-		     * in input().
-		     */
-		    if (yyg->yy_c_buf_p <=
-			&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-		      {		/* This was really a NUL. */
-			  yy_state_type yy_next_state;
-
-			  yyg->yy_c_buf_p =
-			      yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			  yy_current_state = yy_get_previous_state (yyscanner);
-
-			  /* Okay, we're now positioned to make the NUL
-			   * transition.  We couldn't have
-			   * yy_get_previous_state() go ahead and do it
-			   * for us because it doesn't know how to deal
-			   * with the possibility of jamming (and we don't
-			   * want to build jamming into it because then it
-			   * will run more slowly).
-			   */
-
-			  yy_next_state =
-			      yy_try_NUL_trans (yy_current_state, yyscanner);
-
-			  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			  if (yy_next_state)
-			    {
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-			    }
-
-			  else
-			    {
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-			    }
-		      }
+	    do_action:		/* This label is used only to access EOF actions. */
 
-		    else
-			switch (yy_get_next_buffer (yyscanner))
+	      switch (yy_act)
+		{		/* beginning of action switch */
+		case 0:	/* must back up */
+		    /* undo the effects of YY_DO_BEFORE_ACTION */
+		    *yy_cp = yyg->yy_hold_char;
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    goto yy_find_action;
+
+		case 1:
+		    YY_RULE_SETUP
+#line 60 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			return GML_END;
+		    }
+		    YY_BREAK case 2:YY_RULE_SETUP
+#line 61 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			return GML_EQ;
+		    }
+		    YY_BREAK case 3:YY_RULE_SETUP
+#line 62 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			return GML_OPEN;
+		    }
+		    YY_BREAK case 4:YY_RULE_SETUP
+#line 63 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			return GML_CLOSE;
+		    }
+		    YY_BREAK case 5:YY_RULE_SETUP
+#line 64 "gmlLexer.l"
+		    {
+			gml_saveString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval), yytext);
+			return GML_COORD;
+		    }
+		    YY_BREAK case 6:
+/* rule 6 can match eol */
+		      YY_RULE_SETUP
+#line 65 "gmlLexer.l"
+		    {
+			gml_saveString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval), yytext);
+			return GML_VALUE;
+		    }
+		    YY_BREAK case 7:YY_RULE_SETUP
+#line 66 "gmlLexer.l"
+		    {
+			gml_saveString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval), yytext);
+			return GML_KEYWORD;
+		    }
+		    YY_BREAK case 8:YY_RULE_SETUP
+#line 68 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			Gmlget_extra (yyscanner)->gml_col +=
+			    (int) strlen (yytext);
+		    }		/* ignore but count white space */
+		    YY_BREAK case 9:
+/* rule 9 can match eol */
+		      YY_RULE_SETUP
+#line 70 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			Gmlget_extra (yyscanner)->gml_col = 0;
+			Gmlget_extra (yyscanner)->gml_line++;
+		    }
+		    YY_BREAK case 10:YY_RULE_SETUP
+#line 72 "gmlLexer.l"
+		    {
+			gml_freeString (&
+					(Gmlget_extra (yyscanner)->
+					 GmlLval.pval));
+			Gmlget_extra (yyscanner)->gml_col +=
+			    (int) strlen (yytext);
+			return -1;
+		    }
+		    YY_BREAK case 11:YY_RULE_SETUP
+#line 73 "gmlLexer.l"
+		      ECHO;
+		    YY_BREAK
+#line 860 "lex.Gml.c"
+		case YY_STATE_EOF (INITIAL):
+		    yyterminate ();
+
+		case YY_END_OF_BUFFER:
+		    {
+			/* Amount of text matched not including the EOB char. */
+			int yy_amount_of_matched_text =
+			    (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+			/* Undo the effects of YY_DO_BEFORE_ACTION. */
+			*yy_cp = yyg->yy_hold_char;
+			YY_RESTORE_YY_MORE_OFFSET
+			    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
+				YY_BUFFER_NEW)
 			  {
-			  case EOB_ACT_END_OF_FILE:
-			      {
-				  yyg->yy_did_buffer_switch_on_eof = 0;
-
-				  if (Gmlwrap (yyscanner))
-				    {
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p =
-					    yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF (YY_START);
-					goto do_action;
-				    }
-
-				  else
-				    {
-					if (!yyg->yy_did_buffer_switch_on_eof)
-					    YY_NEW_FILE;
-				    }
-				  break;
-			      }
+			      /* We're scanning a new file or input source.  It's
+			       * possible that this happened because the user
+			       * just pointed yyin at a new source and called
+			       * Gmllex().  If so, then we have to assure
+			       * consistency between YY_CURRENT_BUFFER and our
+			       * globals.  Here is the right place to do so, because
+			       * this is the first action (other than possibly a
+			       * back-up) that will match for the new input source.
+			       */
+			      yyg->yy_n_chars =
+				  YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				  YY_BUFFER_NORMAL;
+			  }
+
+			/* Note that here we test for yy_c_buf_p "<=" to the position
+			 * of the first EOB in the buffer, since yy_c_buf_p will
+			 * already have been incremented past the NUL character
+			 * (since all states make transitions on EOB to the
+			 * end-of-buffer state).  Contrast this with the test
+			 * in input().
+			 */
+			if (yyg->yy_c_buf_p <=
+			    &YY_CURRENT_BUFFER_LVALUE->
+			    yy_ch_buf[yyg->yy_n_chars])
+			  {	/* This was really a NUL. */
+			      yy_state_type yy_next_state;
 
-			  case EOB_ACT_CONTINUE_SCAN:
 			      yyg->yy_c_buf_p =
 				  yyg->yytext_ptr + yy_amount_of_matched_text;
 
 			      yy_current_state =
 				  yy_get_previous_state (yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
-			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_match;
-
-			  case EOB_ACT_LAST_MATCH:
-			      yyg->yy_c_buf_p =
-				  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->
-								       yy_n_chars];
+			      /* Okay, we're now positioned to make the NUL
+			       * transition.  We couldn't have
+			       * yy_get_previous_state() go ahead and do it
+			       * for us because it doesn't know how to deal
+			       * with the possibility of jamming (and we don't
+			       * want to build jamming into it because then it
+			       * will run more slowly).
+			       */
 
-			      yy_current_state =
-				  yy_get_previous_state (yyscanner);
+			      yy_next_state =
+				  yy_try_NUL_trans (yy_current_state,
+						    yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
 			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_find_action;
+
+			      if (yy_next_state)
+				{
+				    /* Consume the NUL. */
+				    yy_cp = ++yyg->yy_c_buf_p;
+				    yy_current_state = yy_next_state;
+				    goto yy_match;
+				}
+
+			      else
+				{
+				    yy_cp = yyg->yy_c_buf_p;
+				    goto yy_find_action;
+				}
 			  }
-		    break;
-		}
 
-	    default:
-		YY_FATAL_ERROR
-		    ("fatal flex scanner internal error--no action found");
-	    }			/* end of action switch */
-      }				/* end of scanning one token */
+			else
+			    switch (yy_get_next_buffer (yyscanner))
+			      {
+			      case EOB_ACT_END_OF_FILE:
+				  {
+				      yyg->yy_did_buffer_switch_on_eof = 0;
+
+				      if (Gmlwrap (yyscanner))
+					{
+					    /* Note: because we've taken care in
+					     * yy_get_next_buffer() to have set up
+					     * yytext, we can now set up
+					     * yy_c_buf_p so that if some total
+					     * hoser (like flex itself) wants to
+					     * call the scanner after we return the
+					     * YY_NULL, it'll still work - another
+					     * YY_NULL will get returned.
+					     */
+					    yyg->yy_c_buf_p =
+						yyg->yytext_ptr + YY_MORE_ADJ;
+
+					    yy_act = YY_STATE_EOF (YY_START);
+					    goto do_action;
+					}
+
+				      else
+					{
+					    if (!yyg->yy_did_buffer_switch_on_eof)
+						YY_NEW_FILE;
+					}
+				      break;
+				  }
+
+			      case EOB_ACT_CONTINUE_SCAN:
+				  yyg->yy_c_buf_p =
+				      yyg->yytext_ptr +
+				      yy_amount_of_matched_text;
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_match;
+
+			      case EOB_ACT_LAST_MATCH:
+				  yyg->yy_c_buf_p =
+				      &YY_CURRENT_BUFFER_LVALUE->
+				      yy_ch_buf[yyg->yy_n_chars];
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_find_action;
+			      }
+			break;
+		    }
+
+		default:
+		    YY_FATAL_ERROR
+			("fatal flex scanner internal error--no action found");
+		}		/* end of action switch */
+	  }			/* end of scanning one token */
+    }				/* end of user's declarations */
 }				/* end of Gmllex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1047,20 +1097,20 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
     else
       {
-	  int num_to_read =
+	  yy_size_t num_to_read =
 	      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 	  while (num_to_read <= 0)
 	    {			/* Not enough room in the buffer - grow it. */
 
 		/* just a shorter name for the current buffer */
-		YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+		YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 		int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 		if (b->yy_is_our_buffer)
 		  {
-		      int new_size = b->yy_buf_size * 2;
+		      yy_size_t new_size = b->yy_buf_size * 2;
 
 		      if (new_size <= 0)
 			  b->yy_buf_size += b->yy_buf_size / 8;
@@ -1092,7 +1142,7 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
 	  /* Read in more data. */
 	  YY_INPUT ((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-		    yyg->yy_n_chars, (size_t) num_to_read);
+		    yyg->yy_n_chars, num_to_read);
 
 	  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
       }
@@ -1163,7 +1213,7 @@ yy_get_previous_state (yyscan_t yyscanner)
 	  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
 	    {
 		yy_current_state = (int) yy_def[yy_current_state];
-		if (yy_current_state >= 19)
+		if (yy_current_state >= 21)
 		    yy_c = yy_meta[(unsigned int) yy_c];
 	    }
 	  yy_current_state =
@@ -1194,12 +1244,13 @@ yy_try_NUL_trans (yy_state_type yy_current_state, yyscan_t yyscanner)
     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
       {
 	  yy_current_state = (int) yy_def[yy_current_state];
-	  if (yy_current_state >= 19)
+	  if (yy_current_state >= 21)
 	      yy_c = yy_meta[(unsigned int) yy_c];
       }
     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 18);
+    yy_is_jam = (yy_current_state == 20);
 
+    (void) yyg;
     return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1230,7 +1281,7 @@ input (yyscan_t yyscanner)
 
 	  else
 	    {			/* need more input */
-		int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+		yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 		++yyg->yy_c_buf_p;
 
 		switch (yy_get_next_buffer (yyscanner))
@@ -1398,10 +1449,6 @@ Gml_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
     Gmlfree ((void *) b, yyscanner);
 }
 
-#ifndef __cplusplus
-extern int isatty (int);
-#endif /* __cplusplus */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a Gmlrestart() or at EOF.
@@ -1524,7 +1571,7 @@ Gmlpop_buffer_state (yyscan_t yyscanner)
 static void
 Gmlensure_buffer_stack (yyscan_t yyscanner)
 {
-    int num_to_alloc;
+    yy_size_t num_to_alloc;
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
 
     if (!yyg->yy_buffer_stack)
@@ -1623,18 +1670,19 @@ Gml_scan_string (yyconst char *yystr, yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to Gmllex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE
-Gml_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
+Gml_scan_bytes (yyconst char *yybytes, yy_size_t _yybytes_len,
+		yyscan_t yyscanner)
 {
     YY_BUFFER_STATE b;
     char *buf;
     yy_size_t n;
-    int i;
+    yy_size_t i;
 
     /* Get memory for full buffer, including space for trailing EOB's. */
     n = _yybytes_len + 2;
@@ -1666,7 +1714,7 @@ Gml_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
 static void
 yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
 {
-    (void) fprintf (stderr, "%s\n", msg);
+    (void) spatialite_e ("%s\n", msg);
     exit (YY_EXIT_FAILURE);
 }
 
@@ -1750,7 +1798,7 @@ Gmlget_out (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int
+yy_size_t
 Gmlget_leng (yyscan_t yyscanner)
 {
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
@@ -1790,7 +1838,7 @@ Gmlset_lineno (int line_number, yyscan_t yyscanner)
 
     /* lineno is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Gmlset_lineno called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Gmlset_lineno called with no buffer");
 
     yylineno = line_number;
 }
@@ -1806,7 +1854,7 @@ Gmlset_column (int column_no, yyscan_t yyscanner)
 
     /* column is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Gmlset_column called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Gmlset_column called with no buffer");
 
     yycolumn = column_no;
 }
@@ -2035,6 +2083,10 @@ Gmlfree (void *ptr, yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
+#line 73 "gmlLexer.l"
+
+
+
 int
 Gmlwrap (yyscan_t yyscanner)
 {
diff --git a/src/gaiageo/lex.Kml.c b/src/gaiageo/lex.Kml.c
index 48ab7ae..6ed2a16 100644
--- a/src/gaiageo/lex.Kml.c
+++ b/src/gaiageo/lex.Kml.c
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -53,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -169,11 +170,17 @@ typedef void *yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -191,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -213,7 +215,7 @@ struct yy_buffer_state
     /* Number of characters read into yy_ch_buf, not including EOB
      * characters.
      */
-    int yy_n_chars;
+    yy_size_t yy_n_chars;
 
     /* Whether we "own" the buffer - i.e., we know we created it,
      * and can realloc() it to grow it, and should free() it to
@@ -294,7 +296,7 @@ static void Kml_init_buffer (YY_BUFFER_STATE b, FILE * file,
 YY_BUFFER_STATE Kml_scan_buffer (char *base, yy_size_t size,
 				 yyscan_t yyscanner);
 YY_BUFFER_STATE Kml_scan_string (yyconst char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE Kml_scan_bytes (yyconst char *bytes, int len,
+YY_BUFFER_STATE Kml_scan_bytes (yyconst char *bytes, yy_size_t len,
 				yyscan_t yyscanner);
 
 void *Kmlalloc (yy_size_t, yyscan_t yyscanner);
@@ -358,9 +360,9 @@ struct yy_trans_info
     flex_int32_t yy_verify;
     flex_int32_t yy_nxt;
 };
-static yyconst flex_int16_t yy_accept[19] = { 0,
+static yyconst flex_int16_t yy_accept[21] = { 0,
     5, 5, 12, 10, 8, 9, 10, 5, 1, 3,
-    2, 4, 7, 0, 6, 5, 7, 0
+    2, 4, 7, 5, 0, 6, 5, 7, 5, 0
 };
 
 static yyconst flex_int32_t yy_ec[256] = { 0,
@@ -370,12 +372,12 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
     1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
     1, 1, 5, 5, 5, 5, 6, 7, 7, 7,
     7, 7, 7, 7, 7, 7, 7, 8, 1, 9,
-    10, 11, 1, 1, 12, 12, 12, 12, 12, 12,
+    10, 11, 1, 1, 12, 12, 12, 12, 13, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     1, 1, 1, 1, 12, 1, 12, 12, 12, 12,
 
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+    13, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
     12, 12, 1, 1, 1, 1, 1, 1, 1, 1,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -394,35 +396,37 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
     1, 1, 1, 1, 1
 };
 
-static yyconst flex_int32_t yy_meta[13] = { 0,
+static yyconst flex_int32_t yy_meta[14] = { 0,
     1, 1, 1, 1, 2, 1, 3, 4, 5, 1,
-    5, 4
+    5, 4, 3
 };
 
-static yyconst flex_int16_t yy_base[22] = { 0,
-    0, 0, 23, 24, 24, 24, 18, 0, 24, 24,
-    24, 24, 0, 17, 24, 0, 0, 24, 12, 15,
-    16
+static yyconst flex_int16_t yy_base[24] = { 0,
+    0, 0, 19, 31, 31, 31, 14, 0, 31, 31,
+    31, 31, 0, 9, 11, 31, 0, 0, 0, 31,
+    22, 25, 26
 };
 
-static yyconst flex_int16_t yy_def[22] = { 0,
-    18, 1, 18, 18, 18, 18, 19, 20, 18, 18,
-    18, 18, 21, 19, 18, 20, 21, 0, 18, 18,
-    18
+static yyconst flex_int16_t yy_def[24] = { 0,
+    20, 1, 20, 20, 20, 20, 21, 22, 20, 20,
+    20, 20, 23, 20, 21, 20, 22, 23, 14, 0,
+    20, 20, 20
 };
 
-static yyconst flex_int16_t yy_nxt[37] = { 0,
+static yyconst flex_int16_t yy_nxt[45] = { 0,
     4, 5, 6, 7, 8, 9, 8, 4, 10, 11,
-    12, 13, 14, 14, 14, 14, 16, 16, 17, 17,
-    15, 15, 18, 3, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18
+    12, 13, 14, 17, 16, 19, 18, 16, 20, 20,
+    18, 19, 15, 15, 15, 15, 17, 17, 18, 18,
+    3, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+    20, 20, 20, 20
 };
 
-static yyconst flex_int16_t yy_chk[37] = { 0,
+static yyconst flex_int16_t yy_chk[45] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 19, 19, 19, 19, 20, 20, 21, 21,
-    14, 7, 3, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18
+    1, 1, 1, 14, 15, 14, 14, 7, 3, 0,
+    14, 14, 21, 21, 21, 21, 22, 22, 23, 23,
+    20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+    20, 20, 20, 20
 };
 
 /* The intent behind this definition is that it'll catch
@@ -432,6 +436,7 @@ static yyconst flex_int16_t yy_chk[37] = { 0,
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "kmlLexer.l"
 /* 
  kmlLexer.l -- KML parser - FLEX config
   
@@ -484,6 +489,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 *  Flex would match both POINT and POINTM, but since POINTM is the longer
 *  of the two tokens, FLEX will match POINTM.
 */
+#line 496 "lex.Kml.c"
 
 #define INITIAL 0
 
@@ -510,8 +516,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max;	/**< capacity of stack. */
     YY_BUFFER_STATE *yy_buffer_stack;  /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -558,7 +564,7 @@ FILE *Kmlget_out (yyscan_t yyscanner);
 
 void Kmlset_out (FILE * out_str, yyscan_t yyscanner);
 
-int Kmlget_leng (yyscan_t yyscanner);
+yy_size_t Kmlget_leng (yyscan_t yyscanner);
 
 char *Kmlget_text (yyscan_t yyscanner);
 
@@ -621,7 +627,7 @@ static int input (yyscan_t yyscanner);
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		unsigned n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -731,264 +737,308 @@ YY_DECL
 	  Kml_load_buffer_state (yyscanner);
       }
 
-    while (1)			/* loops until end-of-file is reached */
-      {
-	  yy_cp = yyg->yy_c_buf_p;
+    {
+#line 59 "kmlLexer.l"
 
-	  /* Support of yytext. */
-	  *yy_cp = yyg->yy_hold_char;
-
-	  /* yy_bp points to the position in yy_ch_buf of the start of
-	   * the current run.
-	   */
-	  yy_bp = yy_cp;
-
-	  yy_current_state = yyg->yy_start;
-	yy_match:
-	  do
-	    {
-		register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
-		if (yy_accept[yy_current_state])
-		  {
-		      yyg->yy_last_accepting_state = yy_current_state;
-		      yyg->yy_last_accepting_cpos = yy_cp;
-		  }
-		while (yy_chk[yy_base[yy_current_state] + yy_c] !=
-		       yy_current_state)
-		  {
-		      yy_current_state = (int) yy_def[yy_current_state];
-		      if (yy_current_state >= 19)
-			  yy_c = yy_meta[(unsigned int) yy_c];
-		  }
-		yy_current_state =
-		    yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		++yy_cp;
-	    }
-	  while (yy_base[yy_current_state] != 24);
-
-	yy_find_action:
-	  yy_act = yy_accept[yy_current_state];
-	  if (yy_act == 0)
-	    {			/* have to back up */
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		yy_act = yy_accept[yy_current_state];
-	    }
+#line 746 "lex.Kml.c"
 
-	  YY_DO_BEFORE_ACTION;
+	while (1)		/* loops until end-of-file is reached */
+	  {
+	      yy_cp = yyg->yy_c_buf_p;
 
-	do_action:		/* This label is used only to access EOF actions. */
+	      /* Support of yytext. */
+	      *yy_cp = yyg->yy_hold_char;
 
-	  switch (yy_act)
-	    {			/* beginning of action switch */
-	    case 0:		/* must back up */
-		/* undo the effects of YY_DO_BEFORE_ACTION */
-		*yy_cp = yyg->yy_hold_char;
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		goto yy_find_action;
+	      /* yy_bp points to the position in yy_ch_buf of the start of
+	       * the current run.
+	       */
+	      yy_bp = yy_cp;
 
-	    case 1:
-		YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    return KML_END;
-		}
-		YY_BREAK case 2:YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    return KML_EQ;
-		}
-		YY_BREAK case 3:YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    return KML_OPEN;
-		}
-		YY_BREAK case 4:YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    return KML_CLOSE;
-		}
-		YY_BREAK case 5:YY_RULE_SETUP
-		{
-		    kml_saveString (&(Kmlget_extra (yyscanner)->KmlLval.pval),
-				    yytext);
-		    return KML_COORD;
-		}
-		YY_BREAK case 6:
-/* rule 6 can match eol */
-		  YY_RULE_SETUP
-		{
-		    kml_saveString (&(Kmlget_extra (yyscanner)->KmlLval.pval),
-				    yytext);
-		    return KML_VALUE;
-		}
-		YY_BREAK case 7:YY_RULE_SETUP
+	      yy_current_state = yyg->yy_start;
+	    yy_match:
+	      do
 		{
-		    kml_saveString (&(Kmlget_extra (yyscanner)->KmlLval.pval),
-				    yytext);
-		    return KML_KEYWORD;
-		}
-		YY_BREAK case 8:YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    Kmlget_extra (yyscanner)->kml_col += (int) strlen (yytext);
-		}		/* ignore but count white space */
-		YY_BREAK case 9:
-/* rule 9 can match eol */
-		  YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    Kmlget_extra (yyscanner)->kml_col = 0;
-		    Kmlget_extra (yyscanner)->kml_line++;
+		    register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
+		    if (yy_accept[yy_current_state])
+		      {
+			  yyg->yy_last_accepting_state = yy_current_state;
+			  yyg->yy_last_accepting_cpos = yy_cp;
+		      }
+		    while (yy_chk[yy_base[yy_current_state] + yy_c] !=
+			   yy_current_state)
+		      {
+			  yy_current_state = (int) yy_def[yy_current_state];
+			  if (yy_current_state >= 21)
+			      yy_c = yy_meta[(unsigned int) yy_c];
+		      }
+		    yy_current_state =
+			yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		    ++yy_cp;
 		}
-		YY_BREAK case 10:YY_RULE_SETUP
-		{
-		    kml_freeString (&(Kmlget_extra (yyscanner)->KmlLval.pval));
-		    Kmlget_extra (yyscanner)->kml_col += (int) strlen (yytext);
-		    return -1;
+	      while (yy_base[yy_current_state] != 31);
+
+	    yy_find_action:
+	      yy_act = yy_accept[yy_current_state];
+	      if (yy_act == 0)
+		{		/* have to back up */
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    yy_act = yy_accept[yy_current_state];
 		}
-		YY_BREAK case 11:YY_RULE_SETUP ECHO;
-		YY_BREAK case YY_STATE_EOF (INITIAL):yyterminate ();
 
-	    case YY_END_OF_BUFFER:
-		{
-		    /* Amount of text matched not including the EOB char. */
-		    int yy_amount_of_matched_text =
-			(int) (yy_cp - yyg->yytext_ptr) - 1;
+	      YY_DO_BEFORE_ACTION;
 
-		    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-		    *yy_cp = yyg->yy_hold_char;
-		    YY_RESTORE_YY_MORE_OFFSET
-			if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
-			    YY_BUFFER_NEW)
-		      {
-			  /* We're scanning a new file or input source.  It's
-			   * possible that this happened because the user
-			   * just pointed yyin at a new source and called
-			   * Kmllex().  If so, then we have to assure
-			   * consistency between YY_CURRENT_BUFFER and our
-			   * globals.  Here is the right place to do so, because
-			   * this is the first action (other than possibly a
-			   * back-up) that will match for the new input source.
-			   */
-			  yyg->yy_n_chars =
-			      YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-			      YY_BUFFER_NORMAL;
-		      }
-
-		    /* Note that here we test for yy_c_buf_p "<=" to the position
-		     * of the first EOB in the buffer, since yy_c_buf_p will
-		     * already have been incremented past the NUL character
-		     * (since all states make transitions on EOB to the
-		     * end-of-buffer state).  Contrast this with the test
-		     * in input().
-		     */
-		    if (yyg->yy_c_buf_p <=
-			&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-		      {		/* This was really a NUL. */
-			  yy_state_type yy_next_state;
-
-			  yyg->yy_c_buf_p =
-			      yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			  yy_current_state = yy_get_previous_state (yyscanner);
-
-			  /* Okay, we're now positioned to make the NUL
-			   * transition.  We couldn't have
-			   * yy_get_previous_state() go ahead and do it
-			   * for us because it doesn't know how to deal
-			   * with the possibility of jamming (and we don't
-			   * want to build jamming into it because then it
-			   * will run more slowly).
-			   */
-
-			  yy_next_state =
-			      yy_try_NUL_trans (yy_current_state, yyscanner);
-
-			  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			  if (yy_next_state)
-			    {
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-			    }
-
-			  else
-			    {
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-			    }
-		      }
+	    do_action:		/* This label is used only to access EOF actions. */
 
-		    else
-			switch (yy_get_next_buffer (yyscanner))
+	      switch (yy_act)
+		{		/* beginning of action switch */
+		case 0:	/* must back up */
+		    /* undo the effects of YY_DO_BEFORE_ACTION */
+		    *yy_cp = yyg->yy_hold_char;
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    goto yy_find_action;
+
+		case 1:
+		    YY_RULE_SETUP
+#line 60 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			return KML_END;
+		    }
+		    YY_BREAK case 2:YY_RULE_SETUP
+#line 61 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			return KML_EQ;
+		    }
+		    YY_BREAK case 3:YY_RULE_SETUP
+#line 62 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			return KML_OPEN;
+		    }
+		    YY_BREAK case 4:YY_RULE_SETUP
+#line 63 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			return KML_CLOSE;
+		    }
+		    YY_BREAK case 5:YY_RULE_SETUP
+#line 64 "kmlLexer.l"
+		    {
+			kml_saveString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval), yytext);
+			return KML_COORD;
+		    }
+		    YY_BREAK case 6:
+/* rule 6 can match eol */
+		      YY_RULE_SETUP
+#line 65 "kmlLexer.l"
+		    {
+			kml_saveString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval), yytext);
+			return KML_VALUE;
+		    }
+		    YY_BREAK case 7:YY_RULE_SETUP
+#line 66 "kmlLexer.l"
+		    {
+			kml_saveString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval), yytext);
+			return KML_KEYWORD;
+		    }
+		    YY_BREAK case 8:YY_RULE_SETUP
+#line 68 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			Kmlget_extra (yyscanner)->kml_col +=
+			    (int) strlen (yytext);
+		    }		/* ignore but count white space */
+		    YY_BREAK case 9:
+/* rule 9 can match eol */
+		      YY_RULE_SETUP
+#line 70 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			Kmlget_extra (yyscanner)->kml_col = 0;
+			Kmlget_extra (yyscanner)->kml_line++;
+		    }
+		    YY_BREAK case 10:YY_RULE_SETUP
+#line 72 "kmlLexer.l"
+		    {
+			kml_freeString (&
+					(Kmlget_extra (yyscanner)->
+					 KmlLval.pval));
+			Kmlget_extra (yyscanner)->kml_col +=
+			    (int) strlen (yytext);
+			return -1;
+		    }
+		    YY_BREAK case 11:YY_RULE_SETUP
+#line 73 "kmlLexer.l"
+		      ECHO;
+		    YY_BREAK
+#line 860 "lex.Kml.c"
+		case YY_STATE_EOF (INITIAL):
+		    yyterminate ();
+
+		case YY_END_OF_BUFFER:
+		    {
+			/* Amount of text matched not including the EOB char. */
+			int yy_amount_of_matched_text =
+			    (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+			/* Undo the effects of YY_DO_BEFORE_ACTION. */
+			*yy_cp = yyg->yy_hold_char;
+			YY_RESTORE_YY_MORE_OFFSET
+			    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
+				YY_BUFFER_NEW)
 			  {
-			  case EOB_ACT_END_OF_FILE:
-			      {
-				  yyg->yy_did_buffer_switch_on_eof = 0;
-
-				  if (Kmlwrap (yyscanner))
-				    {
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p =
-					    yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF (YY_START);
-					goto do_action;
-				    }
-
-				  else
-				    {
-					if (!yyg->yy_did_buffer_switch_on_eof)
-					    YY_NEW_FILE;
-				    }
-				  break;
-			      }
+			      /* We're scanning a new file or input source.  It's
+			       * possible that this happened because the user
+			       * just pointed yyin at a new source and called
+			       * Kmllex().  If so, then we have to assure
+			       * consistency between YY_CURRENT_BUFFER and our
+			       * globals.  Here is the right place to do so, because
+			       * this is the first action (other than possibly a
+			       * back-up) that will match for the new input source.
+			       */
+			      yyg->yy_n_chars =
+				  YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				  YY_BUFFER_NORMAL;
+			  }
+
+			/* Note that here we test for yy_c_buf_p "<=" to the position
+			 * of the first EOB in the buffer, since yy_c_buf_p will
+			 * already have been incremented past the NUL character
+			 * (since all states make transitions on EOB to the
+			 * end-of-buffer state).  Contrast this with the test
+			 * in input().
+			 */
+			if (yyg->yy_c_buf_p <=
+			    &YY_CURRENT_BUFFER_LVALUE->
+			    yy_ch_buf[yyg->yy_n_chars])
+			  {	/* This was really a NUL. */
+			      yy_state_type yy_next_state;
 
-			  case EOB_ACT_CONTINUE_SCAN:
 			      yyg->yy_c_buf_p =
 				  yyg->yytext_ptr + yy_amount_of_matched_text;
 
 			      yy_current_state =
 				  yy_get_previous_state (yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
-			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_match;
-
-			  case EOB_ACT_LAST_MATCH:
-			      yyg->yy_c_buf_p =
-				  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->
-								       yy_n_chars];
+			      /* Okay, we're now positioned to make the NUL
+			       * transition.  We couldn't have
+			       * yy_get_previous_state() go ahead and do it
+			       * for us because it doesn't know how to deal
+			       * with the possibility of jamming (and we don't
+			       * want to build jamming into it because then it
+			       * will run more slowly).
+			       */
 
-			      yy_current_state =
-				  yy_get_previous_state (yyscanner);
+			      yy_next_state =
+				  yy_try_NUL_trans (yy_current_state,
+						    yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
 			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_find_action;
+
+			      if (yy_next_state)
+				{
+				    /* Consume the NUL. */
+				    yy_cp = ++yyg->yy_c_buf_p;
+				    yy_current_state = yy_next_state;
+				    goto yy_match;
+				}
+
+			      else
+				{
+				    yy_cp = yyg->yy_c_buf_p;
+				    goto yy_find_action;
+				}
 			  }
-		    break;
-		}
 
-	    default:
-		YY_FATAL_ERROR
-		    ("fatal flex scanner internal error--no action found");
-	    }			/* end of action switch */
-      }				/* end of scanning one token */
+			else
+			    switch (yy_get_next_buffer (yyscanner))
+			      {
+			      case EOB_ACT_END_OF_FILE:
+				  {
+				      yyg->yy_did_buffer_switch_on_eof = 0;
+
+				      if (Kmlwrap (yyscanner))
+					{
+					    /* Note: because we've taken care in
+					     * yy_get_next_buffer() to have set up
+					     * yytext, we can now set up
+					     * yy_c_buf_p so that if some total
+					     * hoser (like flex itself) wants to
+					     * call the scanner after we return the
+					     * YY_NULL, it'll still work - another
+					     * YY_NULL will get returned.
+					     */
+					    yyg->yy_c_buf_p =
+						yyg->yytext_ptr + YY_MORE_ADJ;
+
+					    yy_act = YY_STATE_EOF (YY_START);
+					    goto do_action;
+					}
+
+				      else
+					{
+					    if (!yyg->yy_did_buffer_switch_on_eof)
+						YY_NEW_FILE;
+					}
+				      break;
+				  }
+
+			      case EOB_ACT_CONTINUE_SCAN:
+				  yyg->yy_c_buf_p =
+				      yyg->yytext_ptr +
+				      yy_amount_of_matched_text;
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_match;
+
+			      case EOB_ACT_LAST_MATCH:
+				  yyg->yy_c_buf_p =
+				      &YY_CURRENT_BUFFER_LVALUE->
+				      yy_ch_buf[yyg->yy_n_chars];
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_find_action;
+			      }
+			break;
+		    }
+
+		default:
+		    YY_FATAL_ERROR
+			("fatal flex scanner internal error--no action found");
+		}		/* end of action switch */
+	  }			/* end of scanning one token */
+    }				/* end of user's declarations */
 }				/* end of Kmllex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1047,20 +1097,20 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
     else
       {
-	  int num_to_read =
+	  yy_size_t num_to_read =
 	      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 	  while (num_to_read <= 0)
 	    {			/* Not enough room in the buffer - grow it. */
 
 		/* just a shorter name for the current buffer */
-		YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+		YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 		int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 		if (b->yy_is_our_buffer)
 		  {
-		      int new_size = b->yy_buf_size * 2;
+		      yy_size_t new_size = b->yy_buf_size * 2;
 
 		      if (new_size <= 0)
 			  b->yy_buf_size += b->yy_buf_size / 8;
@@ -1092,7 +1142,7 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
 	  /* Read in more data. */
 	  YY_INPUT ((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-		    yyg->yy_n_chars, (size_t) num_to_read);
+		    yyg->yy_n_chars, num_to_read);
 
 	  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
       }
@@ -1163,7 +1213,7 @@ yy_get_previous_state (yyscan_t yyscanner)
 	  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
 	    {
 		yy_current_state = (int) yy_def[yy_current_state];
-		if (yy_current_state >= 19)
+		if (yy_current_state >= 21)
 		    yy_c = yy_meta[(unsigned int) yy_c];
 	    }
 	  yy_current_state =
@@ -1194,12 +1244,13 @@ yy_try_NUL_trans (yy_state_type yy_current_state, yyscan_t yyscanner)
     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
       {
 	  yy_current_state = (int) yy_def[yy_current_state];
-	  if (yy_current_state >= 19)
+	  if (yy_current_state >= 21)
 	      yy_c = yy_meta[(unsigned int) yy_c];
       }
     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 18);
+    yy_is_jam = (yy_current_state == 20);
 
+    (void) yyg;
     return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1230,7 +1281,7 @@ input (yyscan_t yyscanner)
 
 	  else
 	    {			/* need more input */
-		int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+		yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 		++yyg->yy_c_buf_p;
 
 		switch (yy_get_next_buffer (yyscanner))
@@ -1398,10 +1449,6 @@ Kml_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
     Kmlfree ((void *) b, yyscanner);
 }
 
-#ifndef __cplusplus
-extern int isatty (int);
-#endif /* __cplusplus */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a Kmlrestart() or at EOF.
@@ -1524,7 +1571,7 @@ Kmlpop_buffer_state (yyscan_t yyscanner)
 static void
 Kmlensure_buffer_stack (yyscan_t yyscanner)
 {
-    int num_to_alloc;
+    yy_size_t num_to_alloc;
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
 
     if (!yyg->yy_buffer_stack)
@@ -1623,18 +1670,19 @@ Kml_scan_string (yyconst char *yystr, yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to Kmllex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE
-Kml_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
+Kml_scan_bytes (yyconst char *yybytes, yy_size_t _yybytes_len,
+		yyscan_t yyscanner)
 {
     YY_BUFFER_STATE b;
     char *buf;
     yy_size_t n;
-    int i;
+    yy_size_t i;
 
     /* Get memory for full buffer, including space for trailing EOB's. */
     n = _yybytes_len + 2;
@@ -1666,7 +1714,7 @@ Kml_scan_bytes (yyconst char *yybytes, int _yybytes_len, yyscan_t yyscanner)
 static void
 yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
 {
-    (void) fprintf (stderr, "%s\n", msg);
+    (void) spatialite_e ("%s\n", msg);
     exit (YY_EXIT_FAILURE);
 }
 
@@ -1750,7 +1798,7 @@ Kmlget_out (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int
+yy_size_t
 Kmlget_leng (yyscan_t yyscanner)
 {
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
@@ -1790,7 +1838,7 @@ Kmlset_lineno (int line_number, yyscan_t yyscanner)
 
     /* lineno is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Kmlset_lineno called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Kmlset_lineno called with no buffer");
 
     yylineno = line_number;
 }
@@ -1806,7 +1854,7 @@ Kmlset_column (int column_no, yyscan_t yyscanner)
 
     /* column is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("Kmlset_column called with no buffer", yyscanner);
+	YY_FATAL_ERROR ("Kmlset_column called with no buffer");
 
     yycolumn = column_no;
 }
@@ -2035,6 +2083,10 @@ Kmlfree (void *ptr, yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
+#line 73 "kmlLexer.l"
+
+
+
 int
 Kmlwrap (yyscan_t yyscanner)
 {
diff --git a/src/gaiageo/lex.VanuatuWkt.c b/src/gaiageo/lex.VanuatuWkt.c
index b97e3ba..a951bd5 100644
--- a/src/gaiageo/lex.VanuatuWkt.c
+++ b/src/gaiageo/lex.VanuatuWkt.c
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -53,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -169,11 +170,17 @@ typedef void *yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -191,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -213,7 +215,7 @@ struct yy_buffer_state
     /* Number of characters read into yy_ch_buf, not including EOB
      * characters.
      */
-    int yy_n_chars;
+    yy_size_t yy_n_chars;
 
     /* Whether we "own" the buffer - i.e., we know we created it,
      * and can realloc() it to grow it, and should free() it to
@@ -298,7 +300,7 @@ YY_BUFFER_STATE VanuatuWkt_scan_buffer (char *base, yy_size_t size,
 					yyscan_t yyscanner);
 YY_BUFFER_STATE VanuatuWkt_scan_string (yyconst char *yy_str,
 					yyscan_t yyscanner);
-YY_BUFFER_STATE VanuatuWkt_scan_bytes (yyconst char *bytes, int len,
+YY_BUFFER_STATE VanuatuWkt_scan_bytes (yyconst char *bytes, yy_size_t len,
 				       yyscan_t yyscanner);
 
 void *VanuatuWktalloc (yy_size_t, yyscan_t yyscanner);
@@ -362,20 +364,25 @@ struct yy_trans_info
     flex_int32_t yy_verify;
     flex_int32_t yy_nxt;
 };
-static yyconst flex_int16_t yy_accept[114] = { 0,
+static yyconst flex_int16_t yy_accept[171] = { 0,
     0, 0, 37, 35, 33, 34, 3, 4, 35, 2,
-    35, 1, 35, 35, 35, 35, 1, 1, 1, 1,
-    0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
-    0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 5, 0, 0, 0, 0, 0, 0, 7,
-    6, 0, 0, 0, 0, 0, 8, 13, 0, 0,
-    0, 0, 0, 0, 15, 14, 0, 0, 0, 0,
-    0, 16, 0, 9, 0, 17, 0, 0, 0, 11,
-    10, 0, 0, 19, 18, 0, 0, 12, 0, 20,
-    25, 0, 0, 0, 27, 26, 0, 0, 28, 0,
-
-    21, 0, 0, 23, 22, 0, 24, 29, 0, 31,
-    30, 32, 0
+    35, 1, 1, 35, 35, 35, 35, 1, 1, 1,
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 5, 0, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+
+    0, 0, 7, 6, 0, 1, 1, 1, 1, 0,
+    0, 0, 0, 8, 13, 0, 0, 0, 0, 0,
+    0, 15, 14, 0, 0, 0, 0, 0, 16, 0,
+    9, 0, 17, 0, 0, 0, 11, 10, 0, 0,
+    19, 18, 0, 0, 12, 0, 20, 25, 0, 0,
+    0, 27, 26, 0, 0, 28, 0, 21, 0, 0,
+    23, 22, 0, 24, 29, 0, 31, 30, 32, 0
 };
 
 static yyconst flex_int32_t yy_ec[256] = { 0,
@@ -416,106 +423,132 @@ static yyconst flex_int32_t yy_meta[41] = { 0,
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
-static yyconst flex_int16_t yy_base[115] = { 0,
-    0, 33, 211, 255, 255, 255, 255, 255, 192, 255,
-    191, 2, 2, 3, 4, 0, 11, 13, 185, 15,
-    26, 28, 32, 36, 162, 161, 154, 37, 42, 33,
-    39, 33, 71, 16, 46, 53, 61, 54, 64, 56,
-    57, 65, 80, 67, 66, 67, 74, 79, 0, 255,
-    82, 87, 82, 93, 91, 95, 255, 112, 105, 100,
-    106, 109, 103, 0, 255, 113, 112, 121, 114, 114,
-    125, 255, 124, 144, 118, 154, 130, 143, 0, 255,
-    143, 141, 0, 255, 146, 148, 154, 255, 153, 255,
-    184, 157, 161, 0, 255, 172, 167, 177, 255, 177,
-
-    194, 174, 0, 255, 182, 182, 255, 214, 0, 255,
-    192, 255, 255, 0
+static yyconst flex_int16_t yy_base[171] = { 0,
+    0, 0, 328, 329, 329, 329, 329, 329, 32, 329,
+    34, 317, 36, 35, 35, 27, 33, 316, 43, 315,
+    47, 48, 314, 59, 70, 49, 55, 58, 69, 67,
+    313, 83, 80, 312, 94, 95, 85, 310, 309, 308,
+    65, 94, 86, 92, 86, 105, 104, 307, 306, 305,
+    112, 107, 304, 303, 301, 300, 299, 298, 120, 297,
+    115, 108, 118, 111, 122, 295, 294, 292, 130, 291,
+    290, 289, 288, 131, 286, 285, 283, 282, 281, 279,
+    121, 123, 134, 149, 128, 276, 275, 271, 270, 267,
+    259, 258, 254, 247, 225, 224, 220, 134, 135, 142,
+
+    139, 0, 329, 146, 146, 149, 75, 51, 44, 142,
+    153, 156, 161, 329, 181, 168, 168, 174, 170, 168,
+    0, 329, 177, 177, 183, 177, 177, 190, 329, 189,
+    213, 183, 220, 191, 202, 0, 329, 209, 206, 0,
+    329, 211, 211, 219, 329, 219, 329, 247, 226, 222,
+    0, 329, 231, 233, 243, 329, 244, 263, 241, 0,
+    329, 245, 250, 329, 281, 0, 329, 259, 329, 329
 };
 
-static yyconst flex_int16_t yy_def[115] = { 0,
-    114, 114, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 43, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 58, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 74, 113,
-    113, 113, 76, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 91, 113, 113, 113, 113, 113, 113,
-
-    113, 113, 101, 113, 113, 113, 113, 113, 108, 113,
-    113, 113, 0, 113
+static yyconst flex_int16_t yy_def[171] = { 0,
+    170, 1, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+
+    170, 84, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    115, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 131, 170, 170, 170, 133,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    148, 170, 170, 170, 170, 170, 170, 170, 170, 158,
+    170, 170, 170, 170, 170, 165, 170, 170, 170, 0
 };
 
-static yyconst flex_int16_t yy_nxt[296] = { 0,
-    4, 5, 6, 7, 8, 9, 10, 11, 113, 12,
-    19, 20, 13, 21, 14, 15, 22, 24, 16, 25,
-    17, 26, 18, 19, 20, 34, 23, 13, 21, 14,
-    15, 22, 24, 16, 5, 6, 7, 8, 9, 10,
-    11, 23, 12, 28, 29, 13, 30, 14, 15, 31,
-    32, 16, 35, 36, 37, 38, 39, 40, 28, 29,
-    13, 30, 14, 15, 31, 32, 16, 35, 36, 37,
-    38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    33, 49, 49, 48, 52, 53, 54, 55, 41, 42,
-    43, 44, 45, 46, 47, 50, 56, 57, 48, 52,
-
-    53, 54, 55, 58, 51, 59, 60, 61, 62, 63,
-    50, 56, 57, 64, 64, 67, 68, 69, 58, 51,
-    59, 60, 61, 62, 63, 70, 71, 65, 72, 73,
-    67, 68, 69, 74, 75, 76, 66, 77, 78, 82,
-    70, 71, 65, 72, 73, 79, 79, 86, 74, 75,
-    76, 66, 77, 78, 82, 83, 83, 87, 88, 80,
-    89, 90, 86, 27, 91, 92, 93, 97, 81, 84,
-    34, 33, 87, 88, 80, 89, 90, 98, 85, 91,
-    92, 93, 97, 81, 84, 94, 94, 99, 100, 101,
-    102, 106, 98, 85, 27, 103, 103, 107, 108, 95,
-
-    18, 17, 99, 100, 101, 102, 106, 112, 96, 104,
-    113, 113, 107, 108, 95, 109, 109, 113, 105, 113,
-    113, 113, 112, 96, 104, 113, 113, 113, 113, 110,
-    113, 113, 113, 105, 113, 113, 113, 113, 111, 113,
-    113, 113, 113, 113, 110, 113, 113, 113, 113, 113,
-    113, 113, 113, 111, 3, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113
+static yyconst flex_int16_t yy_nxt[370] = { 0,
+    4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+    4, 4, 14, 4, 15, 16, 4, 4, 17, 4,
+    4, 4, 4, 4, 4, 4, 4, 14, 4, 15,
+    16, 4, 4, 17, 4, 4, 4, 4, 4, 4,
+    18, 19, 20, 21, 23, 24, 26, 25, 27, 28,
+    29, 31, 19, 109, 32, 34, 21, 22, 35, 36,
+    108, 26, 25, 27, 28, 29, 41, 23, 24, 32,
+    25, 42, 43, 35, 36, 38, 30, 39, 46, 40,
+    61, 41, 44, 45, 107, 25, 42, 43, 48, 33,
+    49, 51, 50, 46, 37, 61, 59, 44, 45, 53,
+
+    56, 54, 57, 55, 58, 62, 51, 63, 64, 65,
+    66, 59, 67, 47, 68, 69, 52, 71, 74, 72,
+    62, 73, 63, 64, 65, 78, 81, 79, 82, 80,
+    69, 83, 84, 74, 85, 88, 93, 89, 94, 90,
+    95, 81, 98, 82, 99, 105, 83, 84, 100, 85,
+    102, 102, 101, 110, 111, 112, 113, 98, 106, 99,
+    105, 114, 115, 100, 103, 116, 117, 101, 110, 111,
+    112, 113, 118, 104, 119, 120, 114, 115, 124, 103,
+    116, 117, 121, 121, 125, 126, 127, 118, 104, 119,
+    120, 128, 129, 124, 130, 131, 122, 132, 133, 125,
+
+    126, 127, 134, 135, 139, 123, 128, 129, 143, 130,
+    131, 122, 132, 133, 136, 136, 144, 134, 135, 139,
+    123, 140, 140, 143, 145, 146, 147, 148, 137, 97,
+    149, 144, 150, 96, 95, 141, 154, 138, 155, 145,
+    146, 147, 148, 137, 142, 149, 156, 150, 151, 151,
+    141, 154, 138, 155, 157, 158, 109, 159, 163, 142,
+    164, 156, 152, 108, 160, 160, 165, 92, 91, 157,
+    158, 153, 159, 163, 169, 164, 90, 152, 161, 107,
+    106, 165, 166, 166, 87, 86, 153, 162, 80, 169,
+    97, 96, 77, 161, 76, 75, 167, 73, 92, 91,
+
+    70, 68, 162, 87, 86, 168, 60, 58, 77, 76,
+    55, 167, 55, 75, 50, 50, 70, 40, 40, 60,
+    168, 52, 47, 37, 33, 30, 22, 170, 3, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170
 };
 
-static yyconst flex_int16_t yy_chk[296] = { 0,
-    114, 1, 1, 1, 1, 1, 1, 1, 0, 1,
-    12, 12, 1, 13, 1, 1, 14, 16, 1, 17,
-    17, 18, 18, 20, 20, 34, 15, 1, 13, 1,
-    1, 14, 16, 1, 2, 2, 2, 2, 2, 2,
-    2, 15, 2, 21, 22, 2, 23, 2, 2, 24,
-    24, 2, 28, 29, 30, 31, 32, 35, 21, 22,
-    2, 23, 2, 2, 24, 24, 2, 28, 29, 30,
-    31, 32, 35, 36, 37, 38, 39, 40, 41, 42,
-    33, 43, 43, 42, 44, 45, 46, 47, 36, 37,
-    38, 39, 40, 41, 42, 43, 48, 51, 42, 44,
-
-    45, 46, 47, 52, 43, 53, 54, 55, 56, 56,
-    43, 48, 51, 58, 58, 59, 60, 61, 52, 43,
-    53, 54, 55, 56, 56, 62, 63, 58, 66, 67,
-    59, 60, 61, 68, 69, 70, 58, 71, 73, 75,
-    62, 63, 58, 66, 67, 74, 74, 77, 68, 69,
-    70, 58, 71, 73, 75, 76, 76, 78, 81, 74,
-    82, 85, 77, 27, 86, 87, 89, 92, 74, 76,
-    26, 25, 78, 81, 74, 82, 85, 93, 76, 86,
-    87, 89, 92, 74, 76, 91, 91, 96, 97, 98,
-    100, 102, 93, 76, 19, 101, 101, 105, 106, 91,
-
-    11, 9, 96, 97, 98, 100, 102, 111, 91, 101,
-    3, 0, 105, 106, 91, 108, 108, 0, 101, 0,
-    0, 0, 111, 91, 101, 0, 0, 0, 0, 108,
-    0, 0, 0, 101, 0, 0, 0, 0, 108, 0,
-    0, 0, 0, 0, 108, 0, 0, 0, 0, 0,
-    0, 0, 0, 108, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-    113, 113, 113, 113, 113
+static yyconst flex_int16_t yy_chk[370] = { 0,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    9, 9, 11, 11, 13, 13, 14, 13, 15, 16,
+    17, 19, 19, 109, 19, 21, 21, 22, 21, 22,
+    108, 14, 13, 15, 16, 17, 26, 24, 24, 19,
+    24, 27, 28, 21, 22, 25, 30, 25, 30, 25,
+    41, 26, 29, 29, 107, 24, 27, 28, 32, 33,
+    32, 33, 32, 30, 37, 41, 37, 29, 29, 35,
+
+    36, 35, 36, 35, 36, 42, 33, 43, 44, 45,
+    46, 37, 46, 47, 46, 47, 52, 51, 52, 51,
+    42, 51, 43, 44, 45, 59, 61, 59, 62, 59,
+    47, 63, 64, 52, 65, 69, 74, 69, 74, 69,
+    74, 61, 81, 62, 82, 85, 63, 64, 83, 65,
+    84, 84, 83, 98, 99, 100, 101, 81, 106, 82,
+    85, 104, 105, 83, 84, 110, 111, 83, 98, 99,
+    100, 101, 112, 84, 113, 113, 104, 105, 116, 84,
+    110, 111, 115, 115, 117, 118, 119, 112, 84, 113,
+    113, 120, 123, 116, 124, 125, 115, 126, 127, 117,
+
+    118, 119, 128, 130, 132, 115, 120, 123, 134, 124,
+    125, 115, 126, 127, 131, 131, 135, 128, 130, 132,
+    115, 133, 133, 134, 138, 139, 142, 143, 131, 97,
+    144, 135, 146, 96, 95, 133, 149, 131, 150, 138,
+    139, 142, 143, 131, 133, 144, 153, 146, 148, 148,
+    133, 149, 131, 150, 154, 155, 94, 157, 159, 133,
+    162, 153, 148, 93, 158, 158, 163, 92, 91, 154,
+    155, 148, 157, 159, 168, 162, 90, 148, 158, 89,
+    88, 163, 165, 165, 87, 86, 148, 158, 80, 168,
+    79, 78, 77, 158, 76, 75, 165, 73, 72, 71,
+
+    70, 68, 158, 67, 66, 165, 60, 58, 57, 56,
+    55, 165, 54, 53, 50, 49, 48, 40, 39, 38,
+    165, 34, 31, 23, 20, 18, 12, 3, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+    170, 170, 170, 170, 170, 170, 170, 170, 170
 };
 
 /* The intent behind this definition is that it'll catch
@@ -525,6 +558,7 @@ static yyconst flex_int16_t yy_chk[296] = { 0,
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "vanuatuLexer.l"
 /* 
  vanuatuLexer.l -- Vanuatu WKT parser - FLEX config
   
@@ -598,6 +632,7 @@ Greg Wilson			gvwilson at cs.toronto.ca
 *  Flex would match both POINT Z and POINT ZM, but since POINT ZM is the longer
 *  of the two tokens, FLEX will match POINT ZM.
 */
+#line 635 "lex.VanuatuWkt.c"
 
 #define INITIAL 0
 
@@ -624,8 +659,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max;	/**< capacity of stack. */
     YY_BUFFER_STATE *yy_buffer_stack;  /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -672,7 +707,7 @@ FILE *VanuatuWktget_out (yyscan_t yyscanner);
 
 void VanuatuWktset_out (FILE * out_str, yyscan_t yyscanner);
 
-int VanuatuWktget_leng (yyscan_t yyscanner);
+yy_size_t VanuatuWktget_leng (yyscan_t yyscanner);
 
 char *VanuatuWktget_text (yyscan_t yyscanner);
 
@@ -735,7 +770,7 @@ static int input (yyscan_t yyscanner);
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		unsigned n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -845,428 +880,509 @@ YY_DECL
 	  VanuatuWkt_load_buffer_state (yyscanner);
       }
 
-    while (1)			/* loops until end-of-file is reached */
-      {
-	  yy_cp = yyg->yy_c_buf_p;
+    {
+#line 81 "vanuatuLexer.l"
 
-	  /* Support of yytext. */
-	  *yy_cp = yyg->yy_hold_char;
+#line 885 "lex.VanuatuWkt.c"
 
-	  /* yy_bp points to the position in yy_ch_buf of the start of
-	   * the current run.
-	   */
-	  yy_bp = yy_cp;
+	while (1)		/* loops until end-of-file is reached */
+	  {
+	      yy_cp = yyg->yy_c_buf_p;
 
-	  yy_current_state = yyg->yy_start;
-	yy_match:
-	  do
-	    {
-		register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
-		if (yy_accept[yy_current_state])
-		  {
-		      yyg->yy_last_accepting_state = yy_current_state;
-		      yyg->yy_last_accepting_cpos = yy_cp;
-		  }
-		while (yy_chk[yy_base[yy_current_state] + yy_c] !=
-		       yy_current_state)
-		  {
-		      yy_current_state = (int) yy_def[yy_current_state];
-		      if (yy_current_state >= 114)
-			  yy_c = yy_meta[(unsigned int) yy_c];
-		  }
-		yy_current_state =
-		    yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		++yy_cp;
-	    }
-	  while (yy_base[yy_current_state] != 255);
-
-	yy_find_action:
-	  yy_act = yy_accept[yy_current_state];
-	  if (yy_act == 0)
-	    {			/* have to back up */
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		yy_act = yy_accept[yy_current_state];
-	    }
-
-	  YY_DO_BEFORE_ACTION;
+	      /* Support of yytext. */
+	      *yy_cp = yyg->yy_hold_char;
 
-	do_action:		/* This label is used only to access EOF actions. */
+	      /* yy_bp points to the position in yy_ch_buf of the start of
+	       * the current run.
+	       */
+	      yy_bp = yy_cp;
 
-	  switch (yy_act)
-	    {			/* beginning of action switch */
-	    case 0:		/* must back up */
-		/* undo the effects of YY_DO_BEFORE_ACTION */
-		*yy_cp = yyg->yy_hold_char;
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
-		goto yy_find_action;
-
-	    case 1:
-		YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->vanuatu_col +=
-			(int) strlen (yytext);
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
-			atof (yytext);
-		    return VANUATU_NUM;
-		}
-		YY_BREAK case 2:YY_RULE_SETUP
+	      yy_current_state = yyg->yy_start;
+	    yy_match:
+	      do
 		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_COMMA;
-		}
-		YY_BREAK case 3:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_OPEN_BRACKET;
-		}
-		YY_BREAK case 4:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_CLOSE_BRACKET;
+		    register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI (*yy_cp)];
+		    if (yy_accept[yy_current_state])
+		      {
+			  yyg->yy_last_accepting_state = yy_current_state;
+			  yyg->yy_last_accepting_cpos = yy_cp;
+		      }
+		    while (yy_chk[yy_base[yy_current_state] + yy_c] !=
+			   yy_current_state)
+		      {
+			  yy_current_state = (int) yy_def[yy_current_state];
+			  if (yy_current_state >= 171)
+			      yy_c = yy_meta[(unsigned int) yy_c];
+		      }
+		    yy_current_state =
+			yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		    ++yy_cp;
 		}
-		YY_BREAK case 5:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POINT;
+	      while (yy_base[yy_current_state] != 329);
+
+	    yy_find_action:
+	      yy_act = yy_accept[yy_current_state];
+	      if (yy_act == 0)
+		{		/* have to back up */
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    yy_act = yy_accept[yy_current_state];
 		}
-		YY_BREAK case 6:
+
+	      YY_DO_BEFORE_ACTION;
+
+	    do_action:		/* This label is used only to access EOF actions. */
+
+	      switch (yy_act)
+		{		/* beginning of action switch */
+		case 0:	/* must back up */
+		    /* undo the effects of YY_DO_BEFORE_ACTION */
+		    *yy_cp = yyg->yy_hold_char;
+		    yy_cp = yyg->yy_last_accepting_cpos;
+		    yy_current_state = yyg->yy_last_accepting_state;
+		    goto yy_find_action;
+
+		case 1:
+		    YY_RULE_SETUP
+#line 82 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->vanuatu_col +=
+			    (int) strlen (yytext);
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    atof (yytext);
+			return VANUATU_NUM;
+		    }
+		    YY_BREAK case 2:YY_RULE_SETUP
+#line 83 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_COMMA;
+		    }
+		    YY_BREAK case 3:YY_RULE_SETUP
+#line 84 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_OPEN_BRACKET;
+		    }
+		    YY_BREAK case 4:YY_RULE_SETUP
+#line 85 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_CLOSE_BRACKET;
+		    }
+		    YY_BREAK case 5:YY_RULE_SETUP
+#line 86 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POINT;
+		    }
+		    YY_BREAK case 6:
 /* rule 6 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POINT_Z;
-		}
-		YY_BREAK case 7:
+		      YY_RULE_SETUP
+#line 87 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POINT_Z;
+		    }
+		    YY_BREAK case 7:
 /* rule 7 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POINT_M;
-		}
-		YY_BREAK case 8:
+		      YY_RULE_SETUP
+#line 88 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POINT_M;
+		    }
+		    YY_BREAK case 8:
 /* rule 8 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POINT_ZM;
-		}
-		YY_BREAK case 9:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_LINESTRING;
-		}
-		YY_BREAK case 10:
+		      YY_RULE_SETUP
+#line 89 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POINT_ZM;
+		    }
+		    YY_BREAK case 9:YY_RULE_SETUP
+#line 90 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_LINESTRING;
+		    }
+		    YY_BREAK case 10:
 /* rule 10 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_LINESTRING_Z;
-		}
-		YY_BREAK case 11:
+		      YY_RULE_SETUP
+#line 91 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_LINESTRING_Z;
+		    }
+		    YY_BREAK case 11:
 /* rule 11 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_LINESTRING_M;
-		}
-		YY_BREAK case 12:
+		      YY_RULE_SETUP
+#line 92 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_LINESTRING_M;
+		    }
+		    YY_BREAK case 12:
 /* rule 12 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_LINESTRING_ZM;
-		}
-		YY_BREAK case 13:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POLYGON;
-		}
-		YY_BREAK case 14:
+		      YY_RULE_SETUP
+#line 93 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_LINESTRING_ZM;
+		    }
+		    YY_BREAK case 13:YY_RULE_SETUP
+#line 94 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POLYGON;
+		    }
+		    YY_BREAK case 14:
 /* rule 14 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POLYGON_Z;
-		}
-		YY_BREAK case 15:
+		      YY_RULE_SETUP
+#line 95 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POLYGON_Z;
+		    }
+		    YY_BREAK case 15:
 /* rule 15 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POLYGON_M;
-		}
-		YY_BREAK case 16:
+		      YY_RULE_SETUP
+#line 96 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POLYGON_M;
+		    }
+		    YY_BREAK case 16:
 /* rule 16 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_POLYGON_ZM;
-		}
-		YY_BREAK case 17:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOINT;
-		}
-		YY_BREAK case 18:
+		      YY_RULE_SETUP
+#line 97 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_POLYGON_ZM;
+		    }
+		    YY_BREAK case 17:YY_RULE_SETUP
+#line 98 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOINT;
+		    }
+		    YY_BREAK case 18:
 /* rule 18 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOINT_Z;
-		}
-		YY_BREAK case 19:
+		      YY_RULE_SETUP
+#line 99 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOINT_Z;
+		    }
+		    YY_BREAK case 19:
 /* rule 19 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOINT_M;
-		}
-		YY_BREAK case 20:
+		      YY_RULE_SETUP
+#line 100 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOINT_M;
+		    }
+		    YY_BREAK case 20:
 /* rule 20 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOINT_ZM;
-		}
-		YY_BREAK case 21:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTILINESTRING;
-		}
-		YY_BREAK case 22:
+		      YY_RULE_SETUP
+#line 101 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOINT_ZM;
+		    }
+		    YY_BREAK case 21:YY_RULE_SETUP
+#line 102 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTILINESTRING;
+		    }
+		    YY_BREAK case 22:
 /* rule 22 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTILINESTRING_Z;
-		}
-		YY_BREAK case 23:
+		      YY_RULE_SETUP
+#line 103 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTILINESTRING_Z;
+		    }
+		    YY_BREAK case 23:
 /* rule 23 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTILINESTRING_M;
-		}
-		YY_BREAK case 24:
+		      YY_RULE_SETUP
+#line 104 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTILINESTRING_M;
+		    }
+		    YY_BREAK case 24:
 /* rule 24 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTILINESTRING_ZM;
-		}
-		YY_BREAK case 25:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOLYGON;
-		}
-		YY_BREAK case 26:
+		      YY_RULE_SETUP
+#line 105 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTILINESTRING_ZM;
+		    }
+		    YY_BREAK case 25:YY_RULE_SETUP
+#line 106 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOLYGON;
+		    }
+		    YY_BREAK case 26:
 /* rule 26 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOLYGON_Z;
-		}
-		YY_BREAK case 27:
+		      YY_RULE_SETUP
+#line 107 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOLYGON_Z;
+		    }
+		    YY_BREAK case 27:
 /* rule 27 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOLYGON_M;
-		}
-		YY_BREAK case 28:
+		      YY_RULE_SETUP
+#line 108 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOLYGON_M;
+		    }
+		    YY_BREAK case 28:
 /* rule 28 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_MULTIPOLYGON_ZM;
-		}
-		YY_BREAK case 29:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_GEOMETRYCOLLECTION;
-		}
-		YY_BREAK case 30:
+		      YY_RULE_SETUP
+#line 109 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_MULTIPOLYGON_ZM;
+		    }
+		    YY_BREAK case 29:YY_RULE_SETUP
+#line 110 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_GEOMETRYCOLLECTION;
+		    }
+		    YY_BREAK case 30:
 /* rule 30 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_GEOMETRYCOLLECTION_Z;
-		}
-		YY_BREAK case 31:
+		      YY_RULE_SETUP
+#line 111 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_GEOMETRYCOLLECTION_Z;
+		    }
+		    YY_BREAK case 31:
 /* rule 31 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_GEOMETRYCOLLECTION_M;
-		}
-		YY_BREAK case 32:
+		      YY_RULE_SETUP
+#line 112 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_GEOMETRYCOLLECTION_M;
+		    }
+		    YY_BREAK case 32:
 /* rule 32 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval = 0;
-		    return VANUATU_GEOMETRYCOLLECTION_ZM;
-		}
-		YY_BREAK case 33:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->vanuatu_col +=
-			(int) strlen (yytext);
-		}		/* ignore but count white space */
-		YY_BREAK case 34:
+		      YY_RULE_SETUP
+#line 113 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->VanuatuWktlval.dval =
+			    0;
+			return VANUATU_GEOMETRYCOLLECTION_ZM;
+		    }
+		    YY_BREAK case 33:YY_RULE_SETUP
+#line 115 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->vanuatu_col +=
+			    (int) strlen (yytext);
+		    }		/* ignore but count white space */
+		    YY_BREAK case 34:
 /* rule 34 can match eol */
-		  YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->vanuatu_col = 0;
-		    VanuatuWktget_extra (yyscanner)->vanuatu_line++;
-		}
-		YY_BREAK case 35:YY_RULE_SETUP
-		{
-		    VanuatuWktget_extra (yyscanner)->vanuatu_col +=
-			(int) strlen (yytext);
-		    return -1;
-		}
-		YY_BREAK case 36:YY_RULE_SETUP ECHO;
-		YY_BREAK case YY_STATE_EOF (INITIAL):yyterminate ();
-
-	    case YY_END_OF_BUFFER:
-		{
-		    /* Amount of text matched not including the EOB char. */
-		    int yy_amount_of_matched_text =
-			(int) (yy_cp - yyg->yytext_ptr) - 1;
-
-		    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-		    *yy_cp = yyg->yy_hold_char;
-		    YY_RESTORE_YY_MORE_OFFSET
-			if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
-			    YY_BUFFER_NEW)
-		      {
-			  /* We're scanning a new file or input source.  It's
-			   * possible that this happened because the user
-			   * just pointed yyin at a new source and called
-			   * VanuatuWktlex().  If so, then we have to assure
-			   * consistency between YY_CURRENT_BUFFER and our
-			   * globals.  Here is the right place to do so, because
-			   * this is the first action (other than possibly a
-			   * back-up) that will match for the new input source.
-			   */
-			  yyg->yy_n_chars =
-			      YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-			      YY_BUFFER_NORMAL;
-		      }
-
-		    /* Note that here we test for yy_c_buf_p "<=" to the position
-		     * of the first EOB in the buffer, since yy_c_buf_p will
-		     * already have been incremented past the NUL character
-		     * (since all states make transitions on EOB to the
-		     * end-of-buffer state).  Contrast this with the test
-		     * in input().
-		     */
-		    if (yyg->yy_c_buf_p <=
-			&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-		      {		/* This was really a NUL. */
-			  yy_state_type yy_next_state;
-
-			  yyg->yy_c_buf_p =
-			      yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			  yy_current_state = yy_get_previous_state (yyscanner);
-
-			  /* Okay, we're now positioned to make the NUL
-			   * transition.  We couldn't have
-			   * yy_get_previous_state() go ahead and do it
-			   * for us because it doesn't know how to deal
-			   * with the possibility of jamming (and we don't
-			   * want to build jamming into it because then it
-			   * will run more slowly).
-			   */
-
-			  yy_next_state =
-			      yy_try_NUL_trans (yy_current_state, yyscanner);
-
-			  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			  if (yy_next_state)
-			    {
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-			    }
-
-			  else
-			    {
-				yy_cp = yyg->yy_c_buf_p;
-				goto yy_find_action;
-			    }
-		      }
-
-		    else
-			switch (yy_get_next_buffer (yyscanner))
+		      YY_RULE_SETUP
+#line 117 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->vanuatu_col = 0;
+			VanuatuWktget_extra (yyscanner)->vanuatu_line++;
+		    }
+		    YY_BREAK case 35:YY_RULE_SETUP
+#line 119 "vanuatuLexer.l"
+		    {
+			VanuatuWktget_extra (yyscanner)->vanuatu_col +=
+			    (int) strlen (yytext);
+			return -1;
+		    }
+		    YY_BREAK case 36:YY_RULE_SETUP
+#line 120 "vanuatuLexer.l"
+		      ECHO;
+		    YY_BREAK
+#line 1144 "lex.VanuatuWkt.c"
+		case YY_STATE_EOF (INITIAL):
+		    yyterminate ();
+
+		case YY_END_OF_BUFFER:
+		    {
+			/* Amount of text matched not including the EOB char. */
+			int yy_amount_of_matched_text =
+			    (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+			/* Undo the effects of YY_DO_BEFORE_ACTION. */
+			*yy_cp = yyg->yy_hold_char;
+			YY_RESTORE_YY_MORE_OFFSET
+			    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status ==
+				YY_BUFFER_NEW)
 			  {
-			  case EOB_ACT_END_OF_FILE:
-			      {
-				  yyg->yy_did_buffer_switch_on_eof = 0;
-
-				  if (VanuatuWktwrap (yyscanner))
-				    {
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p =
-					    yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF (YY_START);
-					goto do_action;
-				    }
-
-				  else
-				    {
-					if (!yyg->yy_did_buffer_switch_on_eof)
-					    YY_NEW_FILE;
-				    }
-				  break;
-			      }
+			      /* We're scanning a new file or input source.  It's
+			       * possible that this happened because the user
+			       * just pointed yyin at a new source and called
+			       * VanuatuWktlex().  If so, then we have to assure
+			       * consistency between YY_CURRENT_BUFFER and our
+			       * globals.  Here is the right place to do so, because
+			       * this is the first action (other than possibly a
+			       * back-up) that will match for the new input source.
+			       */
+			      yyg->yy_n_chars =
+				  YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				  YY_BUFFER_NORMAL;
+			  }
+
+			/* Note that here we test for yy_c_buf_p "<=" to the position
+			 * of the first EOB in the buffer, since yy_c_buf_p will
+			 * already have been incremented past the NUL character
+			 * (since all states make transitions on EOB to the
+			 * end-of-buffer state).  Contrast this with the test
+			 * in input().
+			 */
+			if (yyg->yy_c_buf_p <=
+			    &YY_CURRENT_BUFFER_LVALUE->
+			    yy_ch_buf[yyg->yy_n_chars])
+			  {	/* This was really a NUL. */
+			      yy_state_type yy_next_state;
 
-			  case EOB_ACT_CONTINUE_SCAN:
 			      yyg->yy_c_buf_p =
 				  yyg->yytext_ptr + yy_amount_of_matched_text;
 
 			      yy_current_state =
 				  yy_get_previous_state (yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
-			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_match;
-
-			  case EOB_ACT_LAST_MATCH:
-			      yyg->yy_c_buf_p =
-				  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->
-								       yy_n_chars];
+			      /* Okay, we're now positioned to make the NUL
+			       * transition.  We couldn't have
+			       * yy_get_previous_state() go ahead and do it
+			       * for us because it doesn't know how to deal
+			       * with the possibility of jamming (and we don't
+			       * want to build jamming into it because then it
+			       * will run more slowly).
+			       */
 
-			      yy_current_state =
-				  yy_get_previous_state (yyscanner);
+			      yy_next_state =
+				  yy_try_NUL_trans (yy_current_state,
+						    yyscanner);
 
-			      yy_cp = yyg->yy_c_buf_p;
 			      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-			      goto yy_find_action;
+
+			      if (yy_next_state)
+				{
+				    /* Consume the NUL. */
+				    yy_cp = ++yyg->yy_c_buf_p;
+				    yy_current_state = yy_next_state;
+				    goto yy_match;
+				}
+
+			      else
+				{
+				    yy_cp = yyg->yy_c_buf_p;
+				    goto yy_find_action;
+				}
 			  }
-		    break;
-		}
 
-	    default:
-		YY_FATAL_ERROR
-		    ("fatal flex scanner internal error--no action found");
-	    }			/* end of action switch */
-      }				/* end of scanning one token */
+			else
+			    switch (yy_get_next_buffer (yyscanner))
+			      {
+			      case EOB_ACT_END_OF_FILE:
+				  {
+				      yyg->yy_did_buffer_switch_on_eof = 0;
+
+				      if (VanuatuWktwrap (yyscanner))
+					{
+					    /* Note: because we've taken care in
+					     * yy_get_next_buffer() to have set up
+					     * yytext, we can now set up
+					     * yy_c_buf_p so that if some total
+					     * hoser (like flex itself) wants to
+					     * call the scanner after we return the
+					     * YY_NULL, it'll still work - another
+					     * YY_NULL will get returned.
+					     */
+					    yyg->yy_c_buf_p =
+						yyg->yytext_ptr + YY_MORE_ADJ;
+
+					    yy_act = YY_STATE_EOF (YY_START);
+					    goto do_action;
+					}
+
+				      else
+					{
+					    if (!yyg->yy_did_buffer_switch_on_eof)
+						YY_NEW_FILE;
+					}
+				      break;
+				  }
+
+			      case EOB_ACT_CONTINUE_SCAN:
+				  yyg->yy_c_buf_p =
+				      yyg->yytext_ptr +
+				      yy_amount_of_matched_text;
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_match;
+
+			      case EOB_ACT_LAST_MATCH:
+				  yyg->yy_c_buf_p =
+				      &YY_CURRENT_BUFFER_LVALUE->
+				      yy_ch_buf[yyg->yy_n_chars];
+
+				  yy_current_state =
+				      yy_get_previous_state (yyscanner);
+
+				  yy_cp = yyg->yy_c_buf_p;
+				  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				  goto yy_find_action;
+			      }
+			break;
+		    }
+
+		default:
+		    YY_FATAL_ERROR
+			("fatal flex scanner internal error--no action found");
+		}		/* end of action switch */
+	  }			/* end of scanning one token */
+    }				/* end of user's declarations */
 }				/* end of VanuatuWktlex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1325,20 +1441,20 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
     else
       {
-	  int num_to_read =
+	  yy_size_t num_to_read =
 	      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 	  while (num_to_read <= 0)
 	    {			/* Not enough room in the buffer - grow it. */
 
 		/* just a shorter name for the current buffer */
-		YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+		YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 		int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 		if (b->yy_is_our_buffer)
 		  {
-		      int new_size = b->yy_buf_size * 2;
+		      yy_size_t new_size = b->yy_buf_size * 2;
 
 		      if (new_size <= 0)
 			  b->yy_buf_size += b->yy_buf_size / 8;
@@ -1370,7 +1486,7 @@ yy_get_next_buffer (yyscan_t yyscanner)
 
 	  /* Read in more data. */
 	  YY_INPUT ((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-		    yyg->yy_n_chars, (size_t) num_to_read);
+		    yyg->yy_n_chars, num_to_read);
 
 	  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
       }
@@ -1442,7 +1558,7 @@ yy_get_previous_state (yyscan_t yyscanner)
 	  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
 	    {
 		yy_current_state = (int) yy_def[yy_current_state];
-		if (yy_current_state >= 114)
+		if (yy_current_state >= 171)
 		    yy_c = yy_meta[(unsigned int) yy_c];
 	    }
 	  yy_current_state =
@@ -1473,12 +1589,13 @@ yy_try_NUL_trans (yy_state_type yy_current_state, yyscan_t yyscanner)
     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
       {
 	  yy_current_state = (int) yy_def[yy_current_state];
-	  if (yy_current_state >= 114)
+	  if (yy_current_state >= 171)
 	      yy_c = yy_meta[(unsigned int) yy_c];
       }
     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 113);
+    yy_is_jam = (yy_current_state == 170);
 
+    (void) yyg;
     return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1509,7 +1626,7 @@ input (yyscan_t yyscanner)
 
 	  else
 	    {			/* need more input */
-		int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+		yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 		++yyg->yy_c_buf_p;
 
 		switch (yy_get_next_buffer (yyscanner))
@@ -1678,10 +1795,6 @@ VanuatuWkt_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
     VanuatuWktfree ((void *) b, yyscanner);
 }
 
-#ifndef __cplusplus
-extern int isatty (int);
-#endif /* __cplusplus */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a VanuatuWktrestart() or at EOF.
@@ -1804,7 +1917,7 @@ VanuatuWktpop_buffer_state (yyscan_t yyscanner)
 static void
 VanuatuWktensure_buffer_stack (yyscan_t yyscanner)
 {
-    int num_to_alloc;
+    yy_size_t num_to_alloc;
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
 
     if (!yyg->yy_buffer_stack)
@@ -1904,19 +2017,19 @@ VanuatuWkt_scan_string (yyconst char *yystr, yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to VanuatuWktlex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE
-VanuatuWkt_scan_bytes (yyconst char *yybytes, int _yybytes_len,
+VanuatuWkt_scan_bytes (yyconst char *yybytes, yy_size_t _yybytes_len,
 		       yyscan_t yyscanner)
 {
     YY_BUFFER_STATE b;
     char *buf;
     yy_size_t n;
-    int i;
+    yy_size_t i;
 
     /* Get memory for full buffer, including space for trailing EOB's. */
     n = _yybytes_len + 2;
@@ -1948,7 +2061,7 @@ VanuatuWkt_scan_bytes (yyconst char *yybytes, int _yybytes_len,
 static void
 yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
 {
-    (void) fprintf (stderr, "%s\n", msg);
+    (void) spatialite_e ("%s\n", msg);
     exit (YY_EXIT_FAILURE);
 }
 
@@ -2032,7 +2145,7 @@ VanuatuWktget_out (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int
+yy_size_t
 VanuatuWktget_leng (yyscan_t yyscanner)
 {
     struct yyguts_t *yyg = (struct yyguts_t *) yyscanner;
@@ -2072,8 +2185,7 @@ VanuatuWktset_lineno (int line_number, yyscan_t yyscanner)
 
     /* lineno is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("VanuatuWktset_lineno called with no buffer",
-			yyscanner);
+	YY_FATAL_ERROR ("VanuatuWktset_lineno called with no buffer");
 
     yylineno = line_number;
 }
@@ -2089,8 +2201,7 @@ VanuatuWktset_column (int column_no, yyscan_t yyscanner)
 
     /* column is only valid if an input buffer exists. */
     if (!YY_CURRENT_BUFFER)
-	yy_fatal_error ("VanuatuWktset_column called with no buffer",
-			yyscanner);
+	YY_FATAL_ERROR ("VanuatuWktset_column called with no buffer");
 
     yycolumn = column_no;
 }
@@ -2321,6 +2432,10 @@ VanuatuWktfree (void *ptr, yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
+#line 120 "vanuatuLexer.l"
+
+
+
 int
 VanuatuWktwrap (yyscan_t yyscanner)
 {
diff --git a/src/headers/spatialite.h b/src/headers/spatialite.h
index 9a572c1..46655d3 100644
--- a/src/headers/spatialite.h
+++ b/src/headers/spatialite.h
@@ -1136,6 +1136,35 @@ extern "C"
 					     int transaction);
 
 /**
+ Drops a layer-table, removing any related dependency
+
+ \param sqlite handle to current DB connection
+ \param prefix schema prefix identifying the target DB\n
+ "main" always identifies the main DB (primary, not Attached).
+ \param table name of the table to be removed
+ \param transaction boolean; if set to TRUE will internally handle
+ a SQL Transaction
+ \param error_message: will point to a diagnostic error message
+  in case of failute
+
+ \note this function will drop a SpatialTable, SpatialView or VirtualShape being
+ properly registered within the Metadata tables.
+ \n an eventual Spatial Index will be dropped as well, and any row referring the
+ selected table will be removed from the Metadata tables.
+ \n an eventual diagnostic message pointed by error_message must be
+ freed by calling sqlite3_free()
+
+ \return 0 on failure, any other value on success
+
+ \sa gaiaDropTable
+ */
+    SPATIALITE_DECLARE int gaiaDropTableEx3 (sqlite3 * sqlite,
+					     const char *prefix,
+					     const char *table,
+					     int transaction,
+					     char **error_message);
+
+/**
  Checks a Geometry Column for validity
 
  \param sqlite handle to current DB connection
diff --git a/src/headers/spatialite/gaia_topology.h b/src/headers/spatialite/gaia_topology.h
index ecee683..49f9f34 100644
--- a/src/headers/spatialite/gaia_topology.h
+++ b/src/headers/spatialite/gaia_topology.h
@@ -464,7 +464,7 @@ extern "C"
  \param ptr pointer to the Topology Accessor Object.
  \param face the unique identifier of the face.
 
- \return pointer to Geomtry (polygon); NULL on failure.
+ \return pointer to Geometry (polygon); NULL on failure.
 
  \sa gaiaTopologyFromDBMS
  */
@@ -636,6 +636,40 @@ extern "C"
 				  int line_max_points, double max_length);
 
 /**
+ Populates a Topology by importing a whole GeoTable - Extended mode
+
+ \param ptr pointer to the Topology Accessor Object.
+ \param sql_in an SQL statement (SELECT) returning input features
+ \param sql_out a second SQL statement (INSERT INTO) intended to
+ store failing features references into the "dustbin" table.
+ \param sql_in2 an SQL statement (SELECT) returning a single input 
+ feature (used for retrying to insert a failing feature)
+ \param tolerance approximation factor.
+ \param line_max_points if set to a positive number all input Linestrings
+ and/or Polygon Rings will be split into simpler Linestrings having no more 
+ than this maximum number of points. 
+ \param max_length if set to a positive value all input Linestrings 
+ and/or Polygon Rings will be split into simpler Lines having a length
+ not exceeding this threshold. If both line_max_points and max_legth
+ are set as the same time the first condition occurring will cause
+ a new Line to be started. 
+
+ \return 0 if all input features were succesfully importer, or a
+ positive number (total count of failing features raising an exception
+ and referenced by the "dustbin" table); -1 if some unexpected
+ error occurred.
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE int
+	gaiaTopoGeo_FromGeoTableExtended (GaiaTopologyAccessorPtr ptr,
+					  const char *sql_in,
+					  const char *sql_out,
+					  const char *sql_in2, double tolerance,
+					  int line_max_points,
+					  double max_length);
+
+/**
  Creates a temporary table containing a validation report for a given TopoGeo.
 
  \param ptr pointer to the Topology Accessor Object.
@@ -652,7 +686,7 @@ extern "C"
  \param ptr pointer to the Topology Accessor Object.
  \param edge the unique identifier of the edge.
 
- \return pointer to Geomtry (point); NULL on failure.
+ \return pointer to Geometry (point); NULL on failure.
 
  \sa gaiaTopologyFromDBMS
  */
@@ -665,7 +699,7 @@ extern "C"
  \param ptr pointer to the Topology Accessor Object.
  \param face the unique identifier of the face.
 
- \return pointer to Geomtry (point); NULL on failure.
+ \return pointer to Geometry (point); NULL on failure.
 
  \sa gaiaTopologyFromDBMS
  */
@@ -687,6 +721,36 @@ extern "C"
 	gaiaTopoGeoUpdateSeeds (GaiaTopologyAccessorPtr ptr, int mode);
 
 /**
+ Will snap a Point geometry to TopoSeeds
+
+ \param ptr pointer to the Topology Accessor Object.
+ \param pt pointer to the Point Geometry.
+ \param distance tolerance approximation factor.
+
+ \return pointer to Geometry (point); NULL on failure.
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE gaiaGeomCollPtr
+	gaiaTopoGeoSnapPointToSeed (GaiaTopologyAccessorPtr ptr,
+				    gaiaGeomCollPtr pt, double distance);
+
+/**
+ Will snap a Linestring geometry to TopoSeeds
+
+ \param ptr pointer to the Topology Accessor Object.
+ \param ln pointer to the Linestring Geometry.
+ \param distance tolerance approximation factor.
+
+ \return pointer to Geometry (linestring); NULL on failure.
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE gaiaGeomCollPtr
+	gaiaTopoGeoSnapLinestringToSeed (GaiaTopologyAccessorPtr ptr,
+					 gaiaGeomCollPtr ln, double distance);
+
+/**
  Extracts a Simple Features Table out from a Topology by matching
  Topology Seeds to a given reference Table.
 
@@ -740,6 +804,46 @@ extern "C"
 					  int with_spatial_index);
 
 /**
+ Removeas all small Faces from a Topology
+
+ \param ptr pointer to the Topology Accessor Object.
+ \param min_area threshold area to identify small Faces.
+
+ \return 1 on success; -1 on failure (will raise an exception).
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE int
+	gaiaTopoGeo_RemoveSmallFaces (GaiaTopologyAccessorPtr ptr,
+				      double min_area);
+
+/**
+ Removeas all dangling Edges from a Topology
+
+ \param ptr pointer to the Topology Accessor Object.
+
+ \return 1 on success; -1 on failure (will raise an exception).
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE int
+	gaiaTopoGeo_RemoveDanglingEdges (GaiaTopologyAccessorPtr ptr);
+
+/**
+ Removeas all dangling Nodes from a Topology
+
+ \param ptr pointer to the Topology Accessor Object.
+
+ \return 1 on success; -1 on failure (will raise an exception).
+
+ \sa gaiaTopologyFromDBMS
+ */
+    GAIATOPO_DECLARE int
+	gaiaTopoGeo_RemoveDanglingNodes (GaiaTopologyAccessorPtr ptr);
+
+
+
+/**
  creates a TopoLayer and its corresponding Feature relations for a given 
  Topology by matching Topology Seeds to a given reference Table.
 
diff --git a/src/headers/spatialite/gg_advanced.h b/src/headers/spatialite/gg_advanced.h
index aba496f..c981d6c 100644
--- a/src/headers/spatialite/gg_advanced.h
+++ b/src/headers/spatialite/gg_advanced.h
@@ -850,6 +850,26 @@ extern "C"
 
 /**
  return a Geometry detail causing a Geometry to be invalid
+ * 
+ \param geom pointer to the Geometry object to be validated.
+ \param esri_flag if set to TRUE if set to TRUE all ESRI-like holes (violating
+ the basic OGC model) will be considered to be valid.
+
+ \return pointer to a Geometry object causing invalidity, or NULL.
+
+ \sa gaiaIsValid, gaiaIsValidReason, gaiaIsValidDetail_r
+
+ \note you are responsible to destroy the returned Geometry\n
+ not reentrant and thread unsafe.
+
+ \remark \b GEOS support required.
+ */
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaIsValidDetailEx (gaiaGeomCollPtr geom,
+							 int esri_flag);
+
+
+/**
+ return a Geometry detail causing a Geometry to be invalid
 
  \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom pointer to the Geometry object to be validated.
@@ -866,6 +886,28 @@ extern "C"
     GAIAGEO_DECLARE gaiaGeomCollPtr gaiaIsValidDetail_r (const void *p_cache,
 							 gaiaGeomCollPtr geom);
 
+
+/**
+ return a Geometry detail causing a Geometry to be invalid
+
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
+ \param geom pointer to the Geometry object to be validated.
+ \param esri_flag if set to TRUE all ESRI-like holes (violating
+ the basic OGC model) will be considered to be valid.
+
+ \return pointer to a Geometry object causing invalidity, or NULL.
+
+ \sa gaiaIsValid_r, gaiaIsValidReason_r, gaiaIsValidDetail
+
+ \note you are responsible to destroy the returned Geometry\n
+ reentrant and thread-safe.
+
+ \remark \b GEOS support required.
+ */
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaIsValidDetailEx_r (const void *p_cache,
+							   gaiaGeomCollPtr geom,
+							   int esri_flag);
+
 /**
  Checks if a Geometry object represents an OGC Valid Geometry
 
@@ -3252,82 +3294,85 @@ extern "C"
 #endif				/* end GEOS experimental features */
 
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#ifdef ENABLE_LWGEOM
+#ifdef ENABLE_RTTOPO
 #endif
 
 /**
- Resets the LWGEOM error and warning messages to an empty state
-
- \sa gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg, gaiaSetLwGeomErrorMsg,
- gaiaSetLwGeomWarningMsg
-
- \note not reentrant and thread unsafe.
+ Resets the RTTOPO error and warning messages to an empty state
+ 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
+ 
+ \sa gaiaGetRtTopoErrorMsg, gaiaGetRtTopoWarningMsg, gaiaSetRtTopoErrorMsg,
+ gaiaSetRtTopoWarningMsg
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE void gaiaResetLwGeomMsg (void);
+    GAIAGEO_DECLARE void gaiaResetRtTopoMsg (const void *p_cache);
 
 /**
- Return the latest LWGEOM error message (if any)
+ Return the latest RTTOPO error message (if any)
 
- \return the latest LWGEOM error message: an empty string if no error was
+ \return the latest RTTOPO error message: an empty string if no error was
  previoysly found.
 
- \note not reentrant and thread unsafe.
-
- \sa gaiaResetLwGeomMsg, gaiaGetLwGeomWarningMsg, gaiaSetLwGeomErrorMsg,
- gaiaSetLwGeomWarningMsg
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
+ 
+ \sa gaiaResetRtTopoMsg, gaiaGetRtTopoWarningMsg, gaiaSetRtTopoErrorMsg,
+ gaiaSetRtTopoWarningMsg
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE const char *gaiaGetLwGeomErrorMsg (void);
+    GAIAGEO_DECLARE const char *gaiaGetRtTopoErrorMsg (const void *p_cache);
 
 /**
- Return the latest LWGEOM warning message (if any)
+ Return the latest RTTOPO warning message (if any)
 
- \return the latest LWGEOM warning message: an empty string if no warning was 
+ \return the latest RTTOPO warning message: an empty string if no warning was 
  previoysly found.
 
- \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaSetLwGeomErrorMsg,
- gaiaSetLwGeomWarningMsg
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
+
+ \sa gaiaResetRtTopoMsg, gaiaGetRtTopoErrorMsg, gaiaSetRtTopoErrorMsg,
+ gaiaSetRtTopoWarningMsg
 
  \note not reentrant and thread unsafe.
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE const char *gaiaGetLwGeomWarningMsg (void);
+    GAIAGEO_DECLARE const char *gaiaGetRtTopoWarningMsg (const void *p_cache);
 
 /**
- Set the current LWGEOM error message
+ Set the current RTTOPO error message
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param msg the error message to be set.
 
- \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg,
- gaiaSetLwGeomWarningMsg
-
- \note not reentrant and thread unsafe.
+ \sa gaiaResetRtTopoMsg, gaiaGetRtTopoErrorMsg, gaiaGetRtTopoWarningMsg,
+ gaiaSetRtTopoWarningMsg
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE void gaiaSetLwGeomErrorMsg (const char *msg);
+    GAIAGEO_DECLARE void gaiaSetRtTopoErrorMsg (const void *p_cache,
+						const char *msg);
 
 /**
- Set the current LWGEOM warning message
+ Set the current RTTOPO warning message
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param msg the warning message to be set.
 
- \sa gaiaResetLwGeomMsg, gaiaGetLwGeomErrorMsg, gaiaGetLwGeomWarningMsg,
- gaiaSetLwGeomErrorMsg
+ \sa gaiaResetRtTopoMsg, gaiaGetRtTopoErrorMsg, gaiaGetRtTopoWarningMsg,
+ gaiaSetRtTopoErrorMsg
 
- \note not reentrant and thread unsafe.
-
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE void gaiaSetLwGeomWarningMsg (const char *msg);
+    GAIAGEO_DECLARE void gaiaSetRtTopoWarningMsg (const void *p_cache,
+						  const char *msg);
 
 /**
  Utility function: MakeValid
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the input Geometry object.
 
  \return the pointer to newly created Geometry object: NULL on failure.
@@ -3341,13 +3386,15 @@ extern "C"
  \note you are responsible to destroy (before or after) any allocated Geometry,
  this including any Geometry returned by gaiaMakeValid()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValid (gaiaGeomCollPtr geom);
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValid (const void *p_cache,
+						   gaiaGeomCollPtr geom);
 
 /**
  Utility function: MakeValidDiscarded
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the input Geometry object.
 
  \return the pointer to newly created Geometry object: NULL on failure.
@@ -3362,14 +3409,16 @@ extern "C"
  \note you are responsible to destroy (before or after) any allocated Geometry,
  this including any Geometry returned by gaiaMakeValidDiscarded()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValidDiscarded (gaiaGeomCollPtr
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValidDiscarded (const void *p_cache,
+							    gaiaGeomCollPtr
 							    geom);
 
 /**
  Utility function: Segmentize
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the input Geometry object.
  \param dist the meximum segment length.
 
@@ -3384,14 +3433,16 @@ extern "C"
  \note you are responsible to destroy (before or after) any allocated Geometry,
  this including any Geometry returned by gaiaSegmentize()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (gaiaGeomCollPtr geom,
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (const void *p_cache,
+						    gaiaGeomCollPtr geom,
 						    double dist);
 
 /**
  Utility function: Azimuth
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param xa the X coordinate of PointA.
  \param ya the Y coordinate of PointA.
  \param xb the X ccordinate of PointB.
@@ -3404,14 +3455,15 @@ extern "C"
 
  \sa gaiaProjectedPoint
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaiaAzimuth (double xa, double ya, double xb,
-				     double yb, double *azimuth);
+    GAIAGEO_DECLARE int gaiaAzimuth (const void *p_cache, double xa, double ya,
+				     double xb, double yb, double *azimuth);
 
 /**
  Utility function: EllipsoidAzimuth
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param xa the X coordinate of PointA.
  \param ya the Y coordinate of PointA.
  \param xb the X ccordinate of PointB.
@@ -3426,15 +3478,17 @@ extern "C"
 
  \sa gaiaAzimuth
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaiaEllipsoidAzimuth (double xa, double ya, double xb,
-					      double yb, double a, double b,
+    GAIAGEO_DECLARE int gaiaEllipsoidAzimuth (const void *p_cache, double xa,
+					      double ya, double xb, double yb,
+					      double a, double b,
 					      double *azimuth);
 
 /**
  Utility function: ProjectedPoint
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param x1 the X coordinate of the Start Point.
  \param y1 the Y coordinate of the Start Point.
  \param a major axis of the reference spheroid.
@@ -3449,16 +3503,17 @@ extern "C"
 
  \return 0 on failure: any other value on success
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaiaProjectedPoint (double x1, double y1, double a,
-					    double b, double distance,
-					    double azimuth, double *x2,
-					    double *y2);
+    GAIAGEO_DECLARE int gaiaProjectedPoint (const void *p_cache, double x1,
+					    double y1, double a, double b,
+					    double distance, double azimuth,
+					    double *x2, double *y2);
 
 /**
  Utility function: GeoHash
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the input geometry.
  \param precision the expected precision: if <= 0 will be automatically determined.
 
@@ -3467,13 +3522,15 @@ extern "C"
  \note you are responsible to free (before or after) any text string returned
   by gaiaGeoHash()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE char *gaiaGeoHash (gaiaGeomCollPtr geom, int precision);
+    GAIAGEO_DECLARE char *gaiaGeoHash (const void *p_cache,
+				       gaiaGeomCollPtr geom, int precision);
 
 /**
  Utility function: AsX3D
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the input geometry.
  \param srs the WKT SRS definition.
  \param precision the expected precision (coord decimal digits).
@@ -3485,15 +3542,16 @@ extern "C"
  \note you are responsible to free (before or after) any text string returned
   by gaiaAsX3D()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE char *gaiaAsX3D (gaiaGeomCollPtr geom, const char *srs,
-				     int precision, int options,
-				     const char *refid);
+    GAIAGEO_DECLARE char *gaiaAsX3D (const void *p_cache, gaiaGeomCollPtr geom,
+				     const char *srs, int precision,
+				     int options, const char *refid);
 
 /**
  Calculates the minimum 3D distance intercurring between two Geometry objects
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom1 the first Geometry object 
  \param geom2 the second Geometry object 
  \param dist on completion this variable will contain the calculated distance
@@ -3504,14 +3562,16 @@ extern "C"
 
  \note this function computes the 3D cartesian distance (if Z is supported)
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaia3DDistance (gaiaGeomCollPtr geom1,
+    GAIAGEO_DECLARE int gaia3DDistance (const void *p_cache,
+					gaiaGeomCollPtr geom1,
 					gaiaGeomCollPtr geom2, double *dist);
 
 /**
  Calculates the maximum 2D distance intercurring between two Geometry objects
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom1 the first Geometry object 
  \param geom2 the second Geometry object 
  \param dist on completion this variable will contain the calculated distance
@@ -3522,14 +3582,16 @@ extern "C"
 
  \note this function computes the 2D maximum cartesian distance (Z is always ignored)
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaiaMaxDistance (gaiaGeomCollPtr geom1,
+    GAIAGEO_DECLARE int gaiaMaxDistance (const void *p_cache,
+					 gaiaGeomCollPtr geom1,
 					 gaiaGeomCollPtr geom2, double *dist);
 
 /**
  Calculates the maximum 3D distance intercurring between two Geometry objects
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom1 the first Geometry object 
  \param geom2 the second Geometry object 
  \param dist on completion this variable will contain the calculated distance
@@ -3540,15 +3602,17 @@ extern "C"
 
  \note this function computes the 3D maximum cartesian distance (if Z is supported)
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaia3DMaxDistance (gaiaGeomCollPtr geom1,
+    GAIAGEO_DECLARE int gaia3DMaxDistance (const void *p_cache,
+					   gaiaGeomCollPtr geom1,
 					   gaiaGeomCollPtr geom2, double *dist);
 
 /**
  Calculates the 2D or 3D Length for a Linestring or Multilinestring
  accordingly to the dimensions of Geometry
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom the Geometry object 
  \param length on completion this variable will contain the calculated length
 
@@ -3556,13 +3620,15 @@ extern "C"
 
  \sa gaiaGeomCollDistance
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaia3dLength (gaiaGeomCollPtr geom, double *length);
+    GAIAGEO_DECLARE int gaia3dLength (const void *p_cache, gaiaGeomCollPtr geom,
+				      double *length);
 
 /**
  Utility function: Split
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param input the input Geometry object.
  \param blade the blade Geometry object.
 
@@ -3576,14 +3642,16 @@ extern "C"
  
  \note gaiaSplit will return both the \b left and the \b right split halves at the same time.
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplit (gaiaGeomCollPtr input,
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplit (const void *p_cache,
+					       gaiaGeomCollPtr input,
 					       gaiaGeomCollPtr blade);
 
 /**
  Utility function: SplitLeft
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param input the input Geometry object.
  \param blade the blade Geometry object.
 
@@ -3598,14 +3666,16 @@ extern "C"
  \note gaiaSplitLeft will only return the \b left split half; NULL may be eventually
  returned if empty.
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitLeft (gaiaGeomCollPtr input,
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitLeft (const void *p_cache,
+						   gaiaGeomCollPtr input,
 						   gaiaGeomCollPtr blade);
 
 /**
  Utility function: SplitRight
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param input the input Geometry object.
  \param blade the blade Geometry object.
 
@@ -3620,14 +3690,16 @@ extern "C"
  \note gaiaSplitLeft will only return the \b right split half; NULL may be eventually
  returned if empty.
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (gaiaGeomCollPtr input,
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (const void *p_cache,
+						    gaiaGeomCollPtr input,
 						    gaiaGeomCollPtr blade);
 
 /**
  Measures the total Area for a Geometry object (geodesic)
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param geom pointer to Geometry object
  \param a major axis of the reference spheroid.
  \param b minor axis of the reference spheroid.
@@ -3639,15 +3711,17 @@ extern "C"
 
  \sa gaiaGeomCollLength, gaiaMeasureArea, gaiaGeomCollArea
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE int gaiaGeodesicArea (gaiaGeomCollPtr geom, double a,
+    GAIAGEO_DECLARE int gaiaGeodesicArea (const void *p_cache,
+					  gaiaGeomCollPtr geom, double a,
 					  double b, int use_ellipsoid,
 					  double *area);
 
 /**
  Utility function: re-noding lines
 
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
  \param input the input Geometry object.
 
  \return the pointer to newly created Geometry object: NULL on failure.
@@ -3659,11 +3733,12 @@ extern "C"
  \note you are responsible to destroy (before or after) any allocated Geometry,
  this including any Geometry returned by gaiaNode()
 
- \remark \b LWGEOM support required.
+ \remark \b RTTOPO support required.
  */
-    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaNodeLines (gaiaGeomCollPtr input);
+    GAIAGEO_DECLARE gaiaGeomCollPtr gaiaNodeLines (const void *p_cache,
+						   gaiaGeomCollPtr input);
 
-#endif				/* end LWGEOM support */
+#endif				/* end RTTOPO support */
 
 #endif				/* end including GEOS */
 
diff --git a/src/headers/spatialite_private.h b/src/headers/spatialite_private.h
index 9230028..c220c1d 100644
--- a/src/headers/spatialite_private.h
+++ b/src/headers/spatialite_private.h
@@ -125,6 +125,13 @@ extern "C"
 	void *schema;
     };
 
+    struct splite_savepoint
+    {
+	char *savepoint_name;
+	struct splite_savepoint *prev;
+	struct splite_savepoint *next;
+    };
+
 #define MAX_XMLSCHEMA_CACHE	16
 
     struct splite_internal_cache
@@ -135,6 +142,7 @@ extern "C"
 	int decimal_precision;
 	void *GEOS_handle;
 	void *PROJ_handle;
+	void *RTTOPO_handle;
 	void *xmlParsingErrors;
 	void *xmlSchemaValidationErrors;
 	void *xmlXPathErrors;
@@ -148,14 +156,18 @@ extern "C"
 	char *gaia_geos_error_msg;
 	char *gaia_geos_warning_msg;
 	char *gaia_geosaux_error_msg;
+	char *gaia_rttopo_error_msg;
+	char *gaia_rttopo_warning_msg;
 	void *firstTopology;
 	void *lastTopology;
 	void *firstNetwork;
 	void *lastNetwork;
 	unsigned int next_topo_savepoint;
-	char *topo_savepoint_name;
+	struct splite_savepoint *first_topo_svpt;
+	struct splite_savepoint *last_topo_svpt;
 	unsigned int next_network_savepoint;
-	char *network_savepoint_name;
+	struct splite_savepoint *first_net_svpt;
+	struct splite_savepoint *last_net_svpt;
 	unsigned char magic2;
     };
 
@@ -637,11 +649,7 @@ extern "C"
 							  *coverage_name,
 							  int transaction);
 
-    SPATIALITE_PRIVATE const char *splite_lwgeom_version (void);
-
-    SPATIALITE_PRIVATE void splite_lwgeom_init (void);
-
-    SPATIALITE_PRIVATE void splite_lwgeomtopo_init (void);
+    SPATIALITE_PRIVATE const char *splite_rttopo_version (void);
 
     SPATIALITE_PRIVATE void splite_free_geos_cache_item (struct
 							 splite_geos_cache_item
@@ -684,10 +692,6 @@ extern "C"
 
     SPATIALITE_PRIVATE void splite_cache_semaphore_unlock (void);
 
-    SPATIALITE_PRIVATE void splite_lwgeom_semaphore_lock (void);
-
-    SPATIALITE_PRIVATE void splite_lwgeom_semaphore_unlock (void);
-
     SPATIALITE_PRIVATE const void *gaiaAuxClonerCreate (const void *sqlite,
 							const char *db_prefix,
 							const char *in_table,
@@ -805,6 +809,10 @@ extern "C"
 							  int argc,
 							  const void *argv);
 
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_FromGeoTableExt (const void
+							     *context, int argc,
+							     const void *argv);
+
     SPATIALITE_PRIVATE void fnctaux_TopoGeo_ToGeoTable (const void *context,
 							int argc,
 							const void *argv);
@@ -815,6 +823,23 @@ extern "C"
 								  const void
 								  *argv);
 
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_RemoveSmallFaces (const void
+							      *context,
+							      int argc,
+							      const void *argv);
+
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_RemoveDanglingEdges (const void
+								 *context,
+								 int argc,
+								 const void
+								 *argv);
+
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_RemoveDanglingNodes (const void
+								 *context,
+								 int argc,
+								 const void
+								 *argv);
+
     SPATIALITE_PRIVATE void fnctaux_TopoGeo_CreateTopoLayer (const void
 							     *context, int argc,
 							     const void *argv);
@@ -859,6 +884,14 @@ extern "C"
 							 int argc,
 							 const void *argv);
 
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_SnapPointToSeed (const void
+							     *context, int argc,
+							     const void *argv);
+
+    SPATIALITE_PRIVATE void fnctaux_TopoGeo_SnapLineToSeed (const void *context,
+							    int argc,
+							    const void *argv);
+
     SPATIALITE_PRIVATE void start_topo_savepoint (const void *handle,
 						  const void *cache);
 
diff --git a/src/md5/gaia_md5.c b/src/md5/gaia_md5.c
index 34bd944..c4f70c1 100644
--- a/src/md5/gaia_md5.c
+++ b/src/md5/gaia_md5.c
@@ -88,7 +88,7 @@ gaiaUpdateMD5Checksum (void *p_md5, const unsigned char *blob, int blob_len)
     MD5_CTX *md5 = (MD5_CTX *) p_md5;
     if (md5 == NULL || blob == NULL)
 	return;
-    splite_MD5_Update (md5, (void *)blob, blob_len);
+    splite_MD5_Update (md5, (void *) blob, blob_len);
 }
 
 GAIAAUX_DECLARE char *
diff --git a/src/md5/md5.c b/src/md5/md5.c
index 656c145..6132192 100644
--- a/src/md5/md5.c
+++ b/src/md5/md5.c
@@ -89,111 +89,109 @@
  * This processes one or more 64-byte data blocks, but does NOT update
  * the bit counters.  There are no alignment requirements.
  */
-static void *body(MD5_CTX *ctx, void *data, unsigned long size)
+static void *
+body (MD5_CTX * ctx, void *data, unsigned long size)
 {
-	unsigned char *ptr;
-	MD5_u32plus a, b, c, d;
-	MD5_u32plus saved_a, saved_b, saved_c, saved_d;
+    unsigned char *ptr;
+    MD5_u32plus a, b, c, d;
+    MD5_u32plus saved_a, saved_b, saved_c, saved_d;
 
-	ptr = data;
+    ptr = data;
 
-	a = ctx->a;
-	b = ctx->b;
-	c = ctx->c;
-	d = ctx->d;
+    a = ctx->a;
+    b = ctx->b;
+    c = ctx->c;
+    d = ctx->d;
 
-	do {
-		saved_a = a;
-		saved_b = b;
-		saved_c = c;
-		saved_d = d;
+    do
+      {
+	  saved_a = a;
+	  saved_b = b;
+	  saved_c = c;
+	  saved_d = d;
 
 /* Round 1 */
-		STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
-		STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12)
-		STEP(F, c, d, a, b, SET(2), 0x242070db, 17)
-		STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22)
-		STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7)
-		STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12)
-		STEP(F, c, d, a, b, SET(6), 0xa8304613, 17)
-		STEP(F, b, c, d, a, SET(7), 0xfd469501, 22)
-		STEP(F, a, b, c, d, SET(8), 0x698098d8, 7)
-		STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12)
-		STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17)
-		STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22)
-		STEP(F, a, b, c, d, SET(12), 0x6b901122, 7)
-		STEP(F, d, a, b, c, SET(13), 0xfd987193, 12)
-		STEP(F, c, d, a, b, SET(14), 0xa679438e, 17)
-		STEP(F, b, c, d, a, SET(15), 0x49b40821, 22)
-
+	  STEP (F, a, b, c, d, SET (0), 0xd76aa478, 7)
+	      STEP (F, d, a, b, c, SET (1), 0xe8c7b756, 12)
+	      STEP (F, c, d, a, b, SET (2), 0x242070db, 17)
+	      STEP (F, b, c, d, a, SET (3), 0xc1bdceee, 22)
+	      STEP (F, a, b, c, d, SET (4), 0xf57c0faf, 7)
+	      STEP (F, d, a, b, c, SET (5), 0x4787c62a, 12)
+	      STEP (F, c, d, a, b, SET (6), 0xa8304613, 17)
+	      STEP (F, b, c, d, a, SET (7), 0xfd469501, 22)
+	      STEP (F, a, b, c, d, SET (8), 0x698098d8, 7)
+	      STEP (F, d, a, b, c, SET (9), 0x8b44f7af, 12)
+	      STEP (F, c, d, a, b, SET (10), 0xffff5bb1, 17)
+	      STEP (F, b, c, d, a, SET (11), 0x895cd7be, 22)
+	      STEP (F, a, b, c, d, SET (12), 0x6b901122, 7)
+	      STEP (F, d, a, b, c, SET (13), 0xfd987193, 12)
+	      STEP (F, c, d, a, b, SET (14), 0xa679438e, 17)
+	      STEP (F, b, c, d, a, SET (15), 0x49b40821, 22)
 /* Round 2 */
-		STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5)
-		STEP(G, d, a, b, c, GET(6), 0xc040b340, 9)
-		STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14)
-		STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20)
-		STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5)
-		STEP(G, d, a, b, c, GET(10), 0x02441453, 9)
-		STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14)
-		STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20)
-		STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5)
-		STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9)
-		STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14)
-		STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20)
-		STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5)
-		STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9)
-		STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14)
-		STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20)
-
+	      STEP (G, a, b, c, d, GET (1), 0xf61e2562, 5)
+	      STEP (G, d, a, b, c, GET (6), 0xc040b340, 9)
+	      STEP (G, c, d, a, b, GET (11), 0x265e5a51, 14)
+	      STEP (G, b, c, d, a, GET (0), 0xe9b6c7aa, 20)
+	      STEP (G, a, b, c, d, GET (5), 0xd62f105d, 5)
+	      STEP (G, d, a, b, c, GET (10), 0x02441453, 9)
+	      STEP (G, c, d, a, b, GET (15), 0xd8a1e681, 14)
+	      STEP (G, b, c, d, a, GET (4), 0xe7d3fbc8, 20)
+	      STEP (G, a, b, c, d, GET (9), 0x21e1cde6, 5)
+	      STEP (G, d, a, b, c, GET (14), 0xc33707d6, 9)
+	      STEP (G, c, d, a, b, GET (3), 0xf4d50d87, 14)
+	      STEP (G, b, c, d, a, GET (8), 0x455a14ed, 20)
+	      STEP (G, a, b, c, d, GET (13), 0xa9e3e905, 5)
+	      STEP (G, d, a, b, c, GET (2), 0xfcefa3f8, 9)
+	      STEP (G, c, d, a, b, GET (7), 0x676f02d9, 14)
+	      STEP (G, b, c, d, a, GET (12), 0x8d2a4c8a, 20)
 /* Round 3 */
-		STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4)
-		STEP(H, d, a, b, c, GET(8), 0x8771f681, 11)
-		STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)
-		STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23)
-		STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)
-		STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11)
-		STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)
-		STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23)
-		STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)
-		STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11)
-		STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)
-		STEP(H, b, c, d, a, GET(6), 0x04881d05, 23)
-		STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)
-		STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11)
-		STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)
-		STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23)
-
+	      STEP (H, a, b, c, d, GET (5), 0xfffa3942, 4)
+	      STEP (H, d, a, b, c, GET (8), 0x8771f681, 11)
+	      STEP (H, c, d, a, b, GET (11), 0x6d9d6122, 16)
+	      STEP (H, b, c, d, a, GET (14), 0xfde5380c, 23)
+	      STEP (H, a, b, c, d, GET (1), 0xa4beea44, 4)
+	      STEP (H, d, a, b, c, GET (4), 0x4bdecfa9, 11)
+	      STEP (H, c, d, a, b, GET (7), 0xf6bb4b60, 16)
+	      STEP (H, b, c, d, a, GET (10), 0xbebfbc70, 23)
+	      STEP (H, a, b, c, d, GET (13), 0x289b7ec6, 4)
+	      STEP (H, d, a, b, c, GET (0), 0xeaa127fa, 11)
+	      STEP (H, c, d, a, b, GET (3), 0xd4ef3085, 16)
+	      STEP (H, b, c, d, a, GET (6), 0x04881d05, 23)
+	      STEP (H, a, b, c, d, GET (9), 0xd9d4d039, 4)
+	      STEP (H, d, a, b, c, GET (12), 0xe6db99e5, 11)
+	      STEP (H, c, d, a, b, GET (15), 0x1fa27cf8, 16)
+	      STEP (H, b, c, d, a, GET (2), 0xc4ac5665, 23)
 /* Round 4 */
-		STEP(I, a, b, c, d, GET(0), 0xf4292244, 6)
-		STEP(I, d, a, b, c, GET(7), 0x432aff97, 10)
-		STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15)
-		STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21)
-		STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6)
-		STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10)
-		STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15)
-		STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21)
-		STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6)
-		STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10)
-		STEP(I, c, d, a, b, GET(6), 0xa3014314, 15)
-		STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21)
-		STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6)
-		STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10)
-		STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15)
-		STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21)
-
-		a += saved_a;
-		b += saved_b;
-		c += saved_c;
-		d += saved_d;
-
-		ptr += 64;
-	} while (size -= 64);
-
-	ctx->a = a;
-	ctx->b = b;
-	ctx->c = c;
-	ctx->d = d;
-
-	return ptr;
+	      STEP (I, a, b, c, d, GET (0), 0xf4292244, 6)
+	      STEP (I, d, a, b, c, GET (7), 0x432aff97, 10)
+	      STEP (I, c, d, a, b, GET (14), 0xab9423a7, 15)
+	      STEP (I, b, c, d, a, GET (5), 0xfc93a039, 21)
+	      STEP (I, a, b, c, d, GET (12), 0x655b59c3, 6)
+	      STEP (I, d, a, b, c, GET (3), 0x8f0ccc92, 10)
+	      STEP (I, c, d, a, b, GET (10), 0xffeff47d, 15)
+	      STEP (I, b, c, d, a, GET (1), 0x85845dd1, 21)
+	      STEP (I, a, b, c, d, GET (8), 0x6fa87e4f, 6)
+	      STEP (I, d, a, b, c, GET (15), 0xfe2ce6e0, 10)
+	      STEP (I, c, d, a, b, GET (6), 0xa3014314, 15)
+	      STEP (I, b, c, d, a, GET (13), 0x4e0811a1, 21)
+	      STEP (I, a, b, c, d, GET (4), 0xf7537e82, 6)
+	      STEP (I, d, a, b, c, GET (11), 0xbd3af235, 10)
+	      STEP (I, c, d, a, b, GET (2), 0x2ad7d2bb, 15)
+	      STEP (I, b, c, d, a, GET (9), 0xeb86d391, 21) a += saved_a;
+	  b += saved_b;
+	  c += saved_c;
+	  d += saved_d;
+
+	  ptr += 64;
+      }
+    while (size -= 64);
+
+    ctx->a = a;
+    ctx->b = b;
+    ctx->c = c;
+    ctx->d = d;
+
+    return ptr;
 }
 
 /* 
@@ -203,100 +201,107 @@ static void *body(MD5_CTX *ctx, void *data, unsigned long size)
   (not externally visible outside libspatialite itself)
 */
 
-MD5_PRIVATE void splite_MD5_Init(MD5_CTX *ctx)
+MD5_PRIVATE void
+splite_MD5_Init (MD5_CTX * ctx)
 {
-	ctx->a = 0x67452301;
-	ctx->b = 0xefcdab89;
-	ctx->c = 0x98badcfe;
-	ctx->d = 0x10325476;
+    ctx->a = 0x67452301;
+    ctx->b = 0xefcdab89;
+    ctx->c = 0x98badcfe;
+    ctx->d = 0x10325476;
 
-	ctx->lo = 0;
-	ctx->hi = 0;
+    ctx->lo = 0;
+    ctx->hi = 0;
 }
 
-MD5_PRIVATE void splite_MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
+MD5_PRIVATE void
+splite_MD5_Update (MD5_CTX * ctx, void *data, unsigned long size)
 {
-	MD5_u32plus saved_lo;
-	unsigned long used, free;
-
-	saved_lo = ctx->lo;
-	if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
-		ctx->hi++;
-	ctx->hi += size >> 29;
-
-	used = saved_lo & 0x3f;
-
-	if (used) {
-		free = 64 - used;
-
-		if (size < free) {
-			memcpy(&ctx->buffer[used], data, size);
-			return;
-		}
-
-		memcpy(&ctx->buffer[used], data, free);
-		data = (unsigned char *)data + free;
-		size -= free;
-		body(ctx, ctx->buffer, 64);
-	}
-
-	if (size >= 64) {
-		data = body(ctx, data, size & ~(unsigned long)0x3f);
-		size &= 0x3f;
-	}
-
-	memcpy(ctx->buffer, data, size);
+    MD5_u32plus saved_lo;
+    unsigned long used, free;
+
+    saved_lo = ctx->lo;
+    if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
+	ctx->hi++;
+    ctx->hi += size >> 29;
+
+    used = saved_lo & 0x3f;
+
+    if (used)
+      {
+	  free = 64 - used;
+
+	  if (size < free)
+	    {
+		memcpy (&ctx->buffer[used], data, size);
+		return;
+	    }
+
+	  memcpy (&ctx->buffer[used], data, free);
+	  data = (unsigned char *) data + free;
+	  size -= free;
+	  body (ctx, ctx->buffer, 64);
+      }
+
+    if (size >= 64)
+      {
+	  data = body (ctx, data, size & ~(unsigned long) 0x3f);
+	  size &= 0x3f;
+      }
+
+    memcpy (ctx->buffer, data, size);
 }
 
-MD5_PRIVATE void splite_MD5_Final(unsigned char *result, MD5_CTX *ctx)
+MD5_PRIVATE void
+splite_MD5_Final (unsigned char *result, MD5_CTX * ctx)
 {
-	unsigned long used, free;
-
-	used = ctx->lo & 0x3f;
-
-	ctx->buffer[used++] = 0x80;
-
-	free = 64 - used;
-
-	if (free < 8) {
-		memset(&ctx->buffer[used], 0, free);
-		body(ctx, ctx->buffer, 64);
-		used = 0;
-		free = 64;
-	}
-
-	memset(&ctx->buffer[used], 0, free - 8);
-
-	ctx->lo <<= 3;
-	ctx->buffer[56] = ctx->lo;
-	ctx->buffer[57] = ctx->lo >> 8;
-	ctx->buffer[58] = ctx->lo >> 16;
-	ctx->buffer[59] = ctx->lo >> 24;
-	ctx->buffer[60] = ctx->hi;
-	ctx->buffer[61] = ctx->hi >> 8;
-	ctx->buffer[62] = ctx->hi >> 16;
-	ctx->buffer[63] = ctx->hi >> 24;
-
-	body(ctx, ctx->buffer, 64);
-
-	result[0] = ctx->a;
-	result[1] = ctx->a >> 8;
-	result[2] = ctx->a >> 16;
-	result[3] = ctx->a >> 24;
-	result[4] = ctx->b;
-	result[5] = ctx->b >> 8;
-	result[6] = ctx->b >> 16;
-	result[7] = ctx->b >> 24;
-	result[8] = ctx->c;
-	result[9] = ctx->c >> 8;
-	result[10] = ctx->c >> 16;
-	result[11] = ctx->c >> 24;
-	result[12] = ctx->d;
-	result[13] = ctx->d >> 8;
-	result[14] = ctx->d >> 16;
-	result[15] = ctx->d >> 24;
-
-	memset(ctx, 0, sizeof(*ctx));
+    unsigned long used, free;
+
+    used = ctx->lo & 0x3f;
+
+    ctx->buffer[used++] = 0x80;
+
+    free = 64 - used;
+
+    if (free < 8)
+      {
+	  memset (&ctx->buffer[used], 0, free);
+	  body (ctx, ctx->buffer, 64);
+	  used = 0;
+	  free = 64;
+      }
+
+    memset (&ctx->buffer[used], 0, free - 8);
+
+    ctx->lo <<= 3;
+    ctx->buffer[56] = (char) (ctx->lo);
+    ctx->buffer[57] = (char) (ctx->lo >> 8);
+    ctx->buffer[58] = (char) (ctx->lo >> 16);
+    ctx->buffer[59] = (char) (ctx->lo >> 24);
+    ctx->buffer[60] = (char) (ctx->hi);
+    ctx->buffer[61] = (char) (ctx->hi >> 8);
+    ctx->buffer[62] = (char) (ctx->hi >> 16);
+    ctx->buffer[63] = (char) (ctx->hi >> 24);
+
+    body (ctx, ctx->buffer, 64);
+
+    result[0] = (char) (ctx->a);
+    result[1] = (char) (ctx->a >> 8);
+    result[2] = (char) (ctx->a >> 16);
+    result[3] = (char) (ctx->a >> 24);
+    result[4] = (char) (ctx->b);
+    result[5] = (char) (ctx->b >> 8);
+    result[6] = (char) (ctx->b >> 16);
+    result[7] = (char) (ctx->b >> 24);
+    result[8] = (char) (ctx->c);
+    result[9] = (char) (ctx->c >> 8);
+    result[10] = (char) (ctx->c >> 16);
+    result[11] = (char) (ctx->c >> 24);
+    result[12] = (char) (ctx->d);
+    result[13] = (char) (ctx->d >> 8);
+    result[14] = (char) (ctx->d >> 16);
+    result[15] = (char) (ctx->d >> 24);
+
+    memset (ctx, 0, sizeof (*ctx));
 }
 
 #endif
diff --git a/src/shapefiles/shapefiles.c b/src/shapefiles/shapefiles.c
index b15fff9..941f31d 100644
--- a/src/shapefiles/shapefiles.c
+++ b/src/shapefiles/shapefiles.c
@@ -374,6 +374,123 @@ getDbfField (struct auxdbf_list *aux, char *name)
 
 #ifndef OMIT_ICONV		/* ICONV enabled: supporting SHP */
 
+static int
+do_check_shp_unique_pk_values (sqlite3 * sqlite, gaiaShapefilePtr shp, int srid,
+			       int text_dates, const char *pk_name, int pk_type)
+{
+/* checking for duplicate PK values */
+    char *sql;
+    sqlite3_stmt *stmt = NULL;
+    gaiaDbfFieldPtr dbf_field;
+    int ret;
+    int duplicates = 0;
+    int current_row = 0;
+
+    sql = "CREATE TABLE TEMP.check_unique_pk (pkey ANYVALUE)";
+    ret = sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+    if (ret != SQLITE_OK)
+	return 0;
+
+    sql = "INSERT INTO TEMP.check_unique_pk (pkey) VALUES (?)";
+    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+    if (ret != SQLITE_OK)
+	goto error;
+
+    sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+
+    while (1)
+      {
+	  /* reading rows from shapefile */
+	  int ok_insert = 0;
+	  ret = gaiaReadShpEntity_ex (shp, current_row, srid, text_dates);
+	  if (ret < 0)
+	    {
+		/* found a DBF deleted record */
+		current_row++;
+		continue;
+	    }
+	  if (!ret)
+	      break;
+	  current_row++;
+	  /* binding query params */
+	  sqlite3_reset (stmt);
+	  sqlite3_clear_bindings (stmt);
+	  dbf_field = shp->Dbf->First;
+	  while (dbf_field)
+	    {
+		/* Primary Key value */
+		if (strcasecmp (pk_name, dbf_field->Name) == 0)
+		  {
+		      if (pk_type == SQLITE_TEXT)
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_text (stmt, 1,
+					       dbf_field->Value->TxtValue,
+					       strlen (dbf_field->
+						       Value->TxtValue),
+					       SQLITE_STATIC);
+			}
+		      else if (pk_type == SQLITE_FLOAT)
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_double (stmt, 1,
+						 dbf_field->Value->DblValue);
+			}
+		      else
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_int64 (stmt, 1,
+						dbf_field->Value->IntValue);
+			}
+		  }
+		dbf_field = dbf_field->Next;
+	    }
+	  if (ok_insert)
+	    {
+		ret = sqlite3_step (stmt);
+		if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+		    ;
+		else
+		    goto error;
+	    }
+      }
+    sqlite3_finalize (stmt);
+    stmt = NULL;
+    sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+
+    sql = "SELECT Count(*) FROM TEMP.check_unique_pk GROUP BY pkey";
+    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+    if (ret != SQLITE_OK)
+	goto error;
+
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		if (sqlite3_column_int (stmt, 0) > 1)
+		    duplicates = 1;
+	    }
+      }
+    sqlite3_finalize (stmt);
+
+    sqlite3_exec (sqlite, "DROP TABLE TEMP.check_unique_pk", NULL, NULL, NULL);
+    if (duplicates)
+	return 0;
+    else
+	return 1;
+
+  error:
+    if (stmt != NULL)
+	sqlite3_finalize (stmt);
+    sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+    sqlite3_exec (sqlite, "DROP TABLE TEMP.check_unique_pk", NULL, NULL, NULL);
+    return 0;
+}
+
 SPATIALITE_DECLARE int
 load_shapefile (sqlite3 * sqlite, char *shp_path, char *table, char *charset,
 		int srid, char *column, int coerce2d, int compressed,
@@ -413,27 +530,31 @@ load_shapefile_ex2 (sqlite3 * sqlite, char *shp_path, char *table,
     gaiaShapefilePtr shp = NULL;
     gaiaDbfFieldPtr dbf_field;
     int cnt;
-    int col_cnt;
+    int col_cnt = 0;
     int seed;
     int len;
     int dup;
     int idup;
-    int current_row;
+    int current_row = 0;
     int deleted = 0;
     char **col_name = NULL;
     unsigned char *blob;
     int blob_size;
-    char *geom_type;
+    char *geom_type = NULL;
     char *txt_dims;
     char *geo_column = g_column;
     char *xgtype = gtype;
     char *qtable = NULL;
     char *qpk_name = NULL;
-    char *pk_name = NULL;
+    const char *pk_name = NULL;
     int pk_autoincr = 1;
     char *xname;
     int pk_type = SQLITE_INTEGER;
     int pk_set;
+    const char *alt_pk[10] =
+	{ "PK_ALT0", "PK_ALT1", "PK_ALT2", "PK_ALT3", "PK_ALT4", "PK_ALT5",
+	"PK_ALT6", "PK_ALT7", "PK_ALT8", "PK_ALT9"
+    };
     gaiaOutBuffer sql_statement;
     if (!geo_column)
 	geo_column = "Geometry";
@@ -652,6 +773,32 @@ load_shapefile_ex2 (sqlite3 * sqlite, char *shp_path, char *table,
 	  else
 	      pk_name = "PK_UID";
       }
+    if (!do_check_shp_unique_pk_values
+	(sqlite, shp, srid, text_dates, pk_name, pk_type))
+      {
+	  const char *old_pk = pk_name;
+	  int antialias;
+	  for (antialias = 0; antialias < 10; antialias++)
+	    {
+		/* searching an alternative Primary Key column name */
+		int found = 0;
+		pk_name = alt_pk[antialias];
+		dbf_field = shp->Dbf->First;
+		while (dbf_field)
+		  {
+		      if (strcasecmp (pk_name, dbf_field->Name) == 0)
+			  found = 1;
+		      dbf_field = dbf_field->Next;
+		  }
+		if (!found)
+		  {
+		      pk_autoincr = 1;
+		      goto ok_pk;
+		  }
+	    }
+	  pk_name = old_pk;
+      }
+  ok_pk:
     qpk_name = gaiaDoubleQuotedSql (pk_name);
     dbf_field = shp->Dbf->First;
     while (dbf_field)
@@ -1506,7 +1653,8 @@ get_default_dbf_fields (sqlite3 * sqlite, const char *xtable,
 		  }
 		else
 		  {
-		      gaiaAddDbfField (list, name, 'C', offset, length, 0);
+		      gaiaAddDbfField (list, name, 'C', offset, (char) length,
+				       0);
 		      offset += length;
 		  }
 		row++;
@@ -1759,11 +1907,11 @@ get_attached_layer_v4 (sqlite3 * handle, const char *db_prefix,
 		    (const char *) sqlite3_column_text (stmt, 0);
 		const char *geometry_column =
 		    (const char *) sqlite3_column_text (stmt, 1);
-		int count;
-		double min_x;
-		double min_y;
-		double max_x;
-		double max_y;
+		int count = 0;
+		double min_x = 0.0;
+		double min_y = 0.0;
+		double max_x = 0.0;
+		double max_y = 0.0;
 		if (sqlite3_column_type (stmt, 2) == SQLITE_NULL)
 		    is_null = 1;
 		else
@@ -1823,11 +1971,11 @@ get_attached_layer_v4 (sqlite3 * handle, const char *db_prefix,
 		int null_max_size = 0;
 		int null_int_range = 0;
 		int null_double_range = 0;
-		int max_size;
+		int max_size = 0;
 		sqlite3_int64 integer_min;
 		sqlite3_int64 integer_max;
-		double double_min;
-		double double_max;
+		double double_min = DBL_MAX;
+		double double_max = 0.0 - DBL_MAX;
 		const char *table_name =
 		    (const char *) sqlite3_column_text (stmt, 0);
 		const char *geometry_column =
@@ -2400,11 +2548,11 @@ get_attached_table_extent_legacy (sqlite3 * handle, const char *db_prefix,
 		    (const char *) sqlite3_column_text (stmt, 0);
 		const char *geometry_column =
 		    (const char *) sqlite3_column_text (stmt, 1);
-		int count;
-		double min_x;
-		double min_y;
-		double max_x;
-		double max_y;
+		int count = 0;
+		double min_x = 0.0;
+		double min_y = 0.0;
+		double max_x = 0.0;
+		double max_y = 0.0;
 		if (sqlite3_column_type (stmt, 2) == SQLITE_NULL)
 		    is_null = 1;
 		else
@@ -2637,7 +2785,7 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
     char *xcolumn;
     const void *blob_value;
     gaiaShapefilePtr shp = NULL;
-    gaiaDbfListPtr dbf_list;
+    gaiaDbfListPtr dbf_list = NULL;
     gaiaDbfListPtr dbf_write;
     gaiaDbfFieldPtr dbf_field;
     gaiaVectorLayerPtr lyr = NULL;
@@ -2935,7 +3083,7 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
     while (fld)
       {
 	  int sql_type = SQLITE_NULL;
-	  int max_len;
+	  int max_len = 0;
 	  if (strcasecmp (fld->AttributeFieldName, column) == 0)
 	    {
 		/* ignoring the Geometry itself */
@@ -2985,7 +3133,7 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
 		      max_len = 254;
 		  }
 		gaiaAddDbfField (dbf_list, fld->AttributeFieldName, 'C', offset,
-				 max_len, 0);
+				 (unsigned char) max_len, 0);
 		offset += max_len;
 	    }
 	  if (sql_type == SQLITE_FLOAT)
@@ -2995,7 +3143,7 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
 		if (max_len < 8)
 		    max_len = 8;
 		gaiaAddDbfField (dbf_list, fld->AttributeFieldName, 'N', offset,
-				 max_len, 6);
+				 (unsigned char) max_len, 6);
 		offset += max_len;
 	    }
 	  if (sql_type == SQLITE_INTEGER)
@@ -3003,7 +3151,7 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
 		if (max_len > 18)
 		    max_len = 18;
 		gaiaAddDbfField (dbf_list, fld->AttributeFieldName, 'N', offset,
-				 max_len, 0);
+				 (unsigned char) max_len, 0);
 		offset += max_len;
 	    }
 	  fld = fld->Next;
@@ -3185,6 +3333,122 @@ dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *shp_path,
     return 0;
 }
 
+static int
+do_check_dbf_unique_pk_values (sqlite3 * sqlite, gaiaDbfPtr dbf, int text_dates, const char *pk_name, int pk_type)
+{
+/* checking for duplicate PK values */
+    char *sql;
+    sqlite3_stmt *stmt = NULL;
+    gaiaDbfFieldPtr dbf_field;
+    int ret;
+    int deleted;
+    int duplicates = 0;
+    int current_row = 0;
+
+    sql = "CREATE TABLE TEMP.check_unique_pk (pkey ANYVALUE)";
+    ret = sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+    if (ret != SQLITE_OK)
+	return 0;
+
+    sql = "INSERT INTO TEMP.check_unique_pk (pkey) VALUES (?)";
+    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+    if (ret != SQLITE_OK)
+	goto error;
+
+    sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+
+    while (1)
+      {
+	  /* reading rows from shapefile */
+	  int ok_insert = 0;
+	  ret = gaiaReadDbfEntity_ex (dbf, current_row, &deleted, text_dates);
+	  if (!ret)
+	      break;
+	  current_row++;
+	  if (deleted)
+	    {
+		/* skipping DBF deleted row */
+		continue;
+	    }
+	  /* binding query params */
+	  sqlite3_reset (stmt);
+	  sqlite3_clear_bindings (stmt);
+	  dbf_field = dbf->Dbf->First;
+	  while (dbf_field)
+	    {
+		/* Primary Key value */
+		if (strcasecmp (pk_name, dbf_field->Name) == 0)
+		  {
+		      if (pk_type == SQLITE_TEXT)
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_text (stmt, 1,
+					       dbf_field->Value->TxtValue,
+					       strlen (dbf_field->
+						       Value->TxtValue),
+					       SQLITE_STATIC);
+			}
+		      else if (pk_type == SQLITE_FLOAT)
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_double (stmt, 1,
+						 dbf_field->Value->DblValue);
+			}
+		      else
+			{
+			    ok_insert = 1;
+			    sqlite3_bind_int64 (stmt, 1,
+						dbf_field->Value->IntValue);
+			}
+		  }
+		dbf_field = dbf_field->Next;
+	    }
+	  if (ok_insert)
+	    {
+		ret = sqlite3_step (stmt);
+		if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+		    ;
+		else
+		    goto error;
+	    }
+      }
+    sqlite3_finalize (stmt);
+    stmt = NULL;
+    sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+
+    sql = "SELECT Count(*) FROM TEMP.check_unique_pk GROUP BY pkey";
+    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+    if (ret != SQLITE_OK)
+	goto error;
+
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		if (sqlite3_column_int (stmt, 0) > 1)
+		    duplicates = 1;
+	    }
+      }
+    sqlite3_finalize (stmt);
+
+    sqlite3_exec (sqlite, "DROP TABLE TEMP.check_unique_pk", NULL, NULL, NULL);
+    if (duplicates)
+	return 0;
+    else
+	return 1;
+
+  error:
+    if (stmt != NULL)
+	sqlite3_finalize (stmt);
+    sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+    sqlite3_exec (sqlite, "DROP TABLE TEMP.check_unique_pk", NULL, NULL, NULL);
+    return 0;
+}
+
 SPATIALITE_DECLARE int
 load_dbf (sqlite3 * sqlite, char *dbf_path, char *table, char *charset,
 	  int verbose, int *rows, char *err_msg)
@@ -3222,16 +3486,20 @@ load_dbf_ex2 (sqlite3 * sqlite, char *dbf_path, char *table, char *pk_column,
     int len;
     int dup;
     int idup;
-    int current_row;
+    int current_row = 0;
     char **col_name = NULL;
     int deleted;
     char *qtable = NULL;
     char *qpk_name = NULL;
-    char *pk_name = NULL;
+    const char *pk_name = NULL;
     int pk_autoincr = 1;
     gaiaOutBuffer sql_statement;
     int pk_type = SQLITE_INTEGER;
     int pk_set;
+    const char *alt_pk[10] =
+	{ "PK_ALT0", "PK_ALT1", "PK_ALT2", "PK_ALT3", "PK_ALT4", "PK_ALT5",
+	"PK_ALT6", "PK_ALT7", "PK_ALT8", "PK_ALT9"
+    };
     qtable = gaiaDoubleQuotedSql (table);
     if (rows)
 	*rows = -1;
@@ -3372,6 +3640,32 @@ load_dbf_ex2 (sqlite3 * sqlite, char *dbf_path, char *table, char *pk_column,
 	  else
 	      pk_name = "PK_UID";
       }
+    if (!do_check_dbf_unique_pk_values
+	(sqlite, dbf, text_dates, pk_name, pk_type))
+      {
+	  const char *old_pk = pk_name;
+	  int antialias;
+	  for (antialias = 0; antialias < 10; antialias++)
+	    {
+		/* searching an alternative Primary Key column name */
+		int found = 0;
+		pk_name = alt_pk[antialias];
+		dbf_field = dbf->Dbf->First;
+		while (dbf_field)
+		  {
+		      if (strcasecmp (pk_name, dbf_field->Name) == 0)
+			  found = 1;
+		      dbf_field = dbf_field->Next;
+		  }
+		if (!found)
+		  {
+		      pk_autoincr = 1;
+		      goto ok_pk;
+		  }
+	    }
+	  pk_name = old_pk;
+      }
+  ok_pk:
     qpk_name = gaiaDoubleQuotedSql (pk_name);
     dbf_field = dbf->Dbf->First;
     while (dbf_field)
@@ -3686,8 +3980,10 @@ load_dbf_ex2 (sqlite3 * sqlite, char *dbf_path, char *table, char *pk_column,
   clean_up:
     if (qtable)
 	free (qtable);
+    qtable = NULL;
     if (qpk_name)
 	free (qpk_name);
+    qpk_name = NULL;
     gaiaFreeDbf (dbf);
     if (col_name)
       {
@@ -3753,7 +4049,7 @@ dump_dbf_ex (sqlite3 * sqlite, char *table, char *dbf_path, char *charset,
     int rows;
     int i;
     char *sql;
-    char *xtable;
+    char *xtable = NULL;
     sqlite3_stmt *stmt;
     int row1 = 0;
     int n_cols = 0;
@@ -3881,7 +4177,7 @@ dump_dbf_ex (sqlite3 * sqlite, char *table, char *dbf_path, char *charset,
 	  if (sql_type[i] == SQLITE_TEXT)
 	    {
 		gaiaAddDbfField (dbf_list, dbf_field->Name, 'C', offset,
-				 max_length[i], 0);
+				 (unsigned char) (max_length[i]), 0);
 		offset += max_length[i];
 	    }
 	  if (sql_type[i] == SQLITE_FLOAT)
@@ -5821,7 +6117,9 @@ load_XL (sqlite3 * sqlite, const char *path, const char *table,
 	;
     else
 	goto error;
-    ret = freexl_select_active_worksheet (xl_handle, worksheetIndex);
+    ret =
+	freexl_select_active_worksheet (xl_handle,
+					(unsigned short) worksheetIndex);
     if (ret != FREEXL_OK)
 	goto error;
     ret = freexl_worksheet_dimensions (xl_handle, rows, &columns);
diff --git a/src/shapefiles/validator.c b/src/shapefiles/validator.c
index ace9ee9..1bf544b 100644
--- a/src/shapefiles/validator.c
+++ b/src/shapefiles/validator.c
@@ -294,7 +294,7 @@ check_table_column (sqlite3 * sqlite, const char *table, const char *geom,
     return ok;
 }
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
 
 static struct sanitize_report *
 alloc_sanitize_report (void)
@@ -1675,7 +1675,7 @@ sanitize_geometry_column_common (const void *p_cache, sqlite3 * sqlite,
 				 int *n_discarded, int *n_failures,
 				 char **err_msg)
 {
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 /* attempts to repair invalid Geometries from a Geometry Column */
     char *sql;
@@ -2005,11 +2005,11 @@ sanitize_geometry_column_common (const void *p_cache, sqlite3 * sqlite,
 			    gaiaGeomCollPtr repaired;
 			    gaiaGeomCollPtr discarded;
 			    report->n_invalids += 1;
-			    gaiaResetLwGeomMsg ();
-			    repaired = gaiaMakeValid (geom);
-			    discarded = gaiaMakeValidDiscarded (geom);
-			    error = gaiaGetLwGeomErrorMsg ();
-			    warning = gaiaGetLwGeomWarningMsg ();
+			    gaiaResetRtTopoMsg (p_cache);
+			    repaired = gaiaMakeValid (p_cache, geom);
+			    discarded = gaiaMakeValidDiscarded (p_cache, geom);
+			    error = gaiaGetRtTopoErrorMsg (p_cache);
+			    warning = gaiaGetRtTopoWarningMsg (p_cache);
 			    if (discarded == NULL)
 				p_summary = NULL;
 			    else
@@ -2410,7 +2410,7 @@ sanitize_geometry_column_common (const void *p_cache, sqlite3 * sqlite,
     if (out)
 	fclose (out);
 
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
 
     return 0;
 }
@@ -2716,9 +2716,9 @@ sanitize_all_geometry_columns (sqlite3 * sqlite,
 			       const char *output_dir, int *x_not_repaired,
 			       char **err_msg)
 {
-/* LWGEOM isn't enabled: always returning an error */
+/* RTTOPO isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPO\n"
 	"and is thus unable to support MakeValid";
 
 /* silencing stupid compiler warnings */
@@ -2740,9 +2740,9 @@ sanitize_all_geometry_columns_r (const void *p_cache, sqlite3 * sqlite,
 				 const char *output_dir, int *x_not_repaired,
 				 char **err_msg)
 {
-/* LWGEOM isn't enabled: always returning an error */
+/* RTTOPO isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPO\n"
 	"and is thus unable to support MakeValid";
 
 /* silencing stupid compiler warnings */
@@ -2764,9 +2764,9 @@ sanitize_geometry_column (sqlite3 * sqlite, const char *table, const char *geom,
 			  int *n_invalids, int *n_repaired, int *n_discarded,
 			  int *n_failures, char **err_msg)
 {
-/* LWGEOM isn't enabled: always returning an error */
+/* RTTOPO isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPO\n"
 	"and is thus unable to support MakeValid";
 
 /* silencing stupid compiler warnings */
@@ -2791,9 +2791,9 @@ sanitize_geometry_column_r (const void *p_cache, sqlite3 * sqlite,
 			    int *n_invalids, int *n_repaired, int *n_discarded,
 			    int *n_failures, char **err_msg)
 {
-/* LWGEOM isn't enabled: always returning an error */
+/* RTTOPO isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPO\n"
 	"and is thus unable to support MakeValid";
 
 /* silencing stupid compiler warnings */
@@ -2811,7 +2811,7 @@ sanitize_geometry_column_r (const void *p_cache, sqlite3 * sqlite,
     return 0;
 }
 
-#endif /* end LWGEOM conditionals */
+#endif /* end RTTOPO conditionals */
 
 
 #ifndef OMIT_GEOS		/* only if GEOS is supported */
@@ -2916,8 +2916,8 @@ check_geometry_column_common (const void *p_cache, sqlite3 * sqlite,
     char num[256];
     time_t v_time;
     struct tm *v_tm;
-    const char *day;
-    const char *month;
+    const char *day = "";
+    const char *month = "";
     FILE *out = NULL;
     const char *p_msg;
     int len;
@@ -3455,8 +3455,8 @@ check_all_geometry_columns_common (const void *p_cache, sqlite3 * sqlite,
     FILE *out = NULL;
     time_t v_time;
     struct tm *v_tm;
-    const char *day;
-    const char *month;
+    const char *day = "";
+    const char *month = "";
     int sum_invalids = 0;
 
 /* attempting to create the output directory */
@@ -3661,7 +3661,7 @@ check_all_geometry_columns (sqlite3 * sqlite,
 {
 /* GEOS isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPOM\n"
 	"and is thus unable to support IsValid";
 /* silencing stupid compiler warnings */
     if (sqlite == NULL || output_dir == NULL || x_invalids == NULL)
@@ -3682,7 +3682,7 @@ check_all_geometry_columns_r (const void *p_cache, sqlite3 * sqlite,
 {
 /* GEOS isn't enabled: always returning an error */
     int len;
-    const char *msg = "Sorry ... libspatialite was built disabling LWGEOM\n"
+    const char *msg = "Sorry ... libspatialite was built disabling RTTOPO\n"
 	"and is thus unable to support IsValid";
 /* silencing stupid compiler warnings */
     if (p_cache == NULL || sqlite == NULL || output_dir == NULL
diff --git a/src/spatialite/metatables.c b/src/spatialite/metatables.c
index ea99b27..2face04 100644
--- a/src/spatialite/metatables.c
+++ b/src/spatialite/metatables.c
@@ -2786,7 +2786,7 @@ upgradeGeometryTriggers (void *p_sqlite)
     int ret;
     sqlite3_stmt *stmt = NULL;
     char *sql_statement;
-    int retcode;
+    int retcode = 0;
     int metadata_version = checkSpatialMetaData (sqlite);
     if (metadata_version < 3)
 	return 0;
@@ -4552,8 +4552,8 @@ gaiaGetVectorLayersList_v4 (sqlite3 * handle, const char *table,
 		    (const char *) sqlite3_column_text (stmt, 0);
 		const char *geometry_column =
 		    (const char *) sqlite3_column_text (stmt, 1);
-		int read_only;
-		int hidden;
+		int read_only = 0;
+		int hidden = 0;
 		if (sqlite3_column_type (stmt, 2) == SQLITE_NULL)
 		    is_null = 1;
 		else
@@ -5335,8 +5335,8 @@ get_table_auth_legacy (sqlite3 * handle, const char *table,
 		    (const char *) sqlite3_column_text (stmt, 0);
 		const char *geometry_column =
 		    (const char *) sqlite3_column_text (stmt, 1);
-		int read_only;
-		int hidden;
+		int read_only = 0;
+		int hidden = 0;
 		if (sqlite3_column_type (stmt, 2) == SQLITE_NULL)
 		    is_null = 1;
 		else
@@ -6027,7 +6027,7 @@ gaiaGetLayerExtent (sqlite3 * handle, const char *table,
     double miny = -DBL_MAX;
     double maxx = DBL_MAX;
     double maxy = DBL_MAX;
-    int srid;
+    int srid = 0;
     gaiaGeomCollPtr bbox;
     gaiaPolygonPtr polyg;
     gaiaRingPtr rect;
diff --git a/src/spatialite/se_helpers.c b/src/spatialite/se_helpers.c
index 041a2ae..eeff78b 100644
--- a/src/spatialite/se_helpers.c
+++ b/src/spatialite/se_helpers.c
@@ -402,7 +402,7 @@ check_vector_style_by_name (sqlite3 * sqlite, const char *style_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_vector_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -497,7 +497,7 @@ check_vector_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     sqlite3_stmt *stmt;
     int count = 0;
     int ref_count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_vector_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -556,7 +556,6 @@ check_vector_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     if (ref_count > 0)
 	*has_refs = 1;
     return 1;
-    return 0;
   stop:
     return 0;
 }
@@ -882,7 +881,7 @@ check_vector_styled_layer_by_name (sqlite3 * sqlite, const char *coverage_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT l.style_id FROM SE_vector_styled_layers AS l "
 	"JOIN SE_vector_styles AS s ON (l.style_id = s.style_id) "
@@ -1162,7 +1161,7 @@ check_raster_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     sqlite3_stmt *stmt;
     int count = 0;
     int ref_count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_raster_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -1221,7 +1220,6 @@ check_raster_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     if (ref_count > 0)
 	*has_refs = 1;
     return 1;
-    return 0;
   stop:
     return 0;
 }
@@ -1351,7 +1349,7 @@ check_raster_style_by_name (sqlite3 * sqlite, const char *style_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_raster_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -1598,7 +1596,7 @@ check_raster_styled_layer_by_name (sqlite3 * sqlite, const char *coverage_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT l.style_id FROM SE_raster_styled_layers AS l "
 	"JOIN SE_raster_styles AS s ON (l.style_id = s.style_id) "
@@ -2152,7 +2150,7 @@ check_styled_group_raster (sqlite3 * sqlite, const char *group_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT id FROM SE_styled_group_refs WHERE "
 	"Lower(group_name) = Lower(?) AND Lower(raster_coverage_name) = Lower(?)";
@@ -2200,7 +2198,7 @@ check_styled_group_vector (sqlite3 * sqlite, const char *group_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT id FROM SE_styled_group_refs WHERE "
 	"Lower(group_name) = Lower(?) AND Lower(vector_coverage_name) = Lower(?) ";
@@ -2581,7 +2579,7 @@ check_group_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     sqlite3_stmt *stmt;
     int count = 0;
     int ref_count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_group_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -2640,7 +2638,6 @@ check_group_style_refs_by_name (sqlite3 * sqlite, const char *style_name,
     if (ref_count > 0)
 	*has_refs = 1;
     return 1;
-    return 0;
   stop:
     return 0;
 }
@@ -2770,7 +2767,7 @@ check_group_style_by_name (sqlite3 * sqlite, const char *style_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT style_id FROM SE_group_styles "
 	"WHERE Lower(style_name) = Lower(?)";
@@ -2999,7 +2996,7 @@ check_styled_group_style_by_name (sqlite3 * sqlite, const char *group_name,
     const char *sql;
     sqlite3_stmt *stmt;
     int count = 0;
-    sqlite3_int64 xid;
+    sqlite3_int64 xid = 0;
 
     sql = "SELECT l.style_id FROM SE_styled_group_styles AS l "
 	"JOIN SE_group_styles AS s ON (l.style_id = s.style_id) "
@@ -4239,10 +4236,10 @@ update_vector_coverage_extent (void *p_sqlite, const void *cache,
 			    int null_miny = 1;
 			    int null_maxx = 1;
 			    int null_maxy = 1;
-			    double minx;
-			    double miny;
-			    double maxx;
-			    double maxy;
+			    double minx = 0.0;
+			    double miny = 0.0;
+			    double maxx = 0.0;
+			    double maxy = 0.0;
 			    if (sqlite3_column_type (stmt_ext, 0) ==
 				SQLITE_FLOAT)
 			      {
@@ -5159,10 +5156,10 @@ update_raster_coverage_extent (void *p_sqlite, const void *cache,
 			    int null_miny = 1;
 			    int null_maxx = 1;
 			    int null_maxy = 1;
-			    double minx;
-			    double miny;
-			    double maxx;
-			    double maxy;
+			    double minx = 0.0;
+			    double miny = 0.0;
+			    double maxx = 0.0;
+			    double maxy = 0.0;
 			    if (sqlite3_column_type (stmt_ext, 0) ==
 				SQLITE_FLOAT)
 			      {
@@ -5266,7 +5263,7 @@ get_iso_metadata_id (void *p_sqlite, const char *fileIdentifier, void *p_id)
 /* auxiliary function: return the ID of the row corresponding to "fileIdentifier" */
     sqlite3 *sqlite = (sqlite3 *) p_sqlite;
     sqlite3_int64 *p64 = (sqlite3_int64 *) p_id;
-    sqlite3_int64 id;
+    sqlite3_int64 id = 0;
     int ret;
     const char *sql;
     sqlite3_stmt *stmt;
diff --git a/src/spatialite/spatialite.c b/src/spatialite/spatialite.c
index 977896c..406b846 100644
--- a/src/spatialite/spatialite.c
+++ b/src/spatialite/spatialite.c
@@ -501,18 +501,18 @@ fnct_has_geos_only_reentrant (sqlite3_context * context, int argc,
 }
 
 static void
-fnct_lwgeom_version (sqlite3_context * context, int argc, sqlite3_value ** argv)
+fnct_rttopo_version (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ lwgeom_version()
+/ rttopo_version()
 /
-/ return a text string representing the current LWGEOM version
-/ or NULL if LWGEOM is currently unsupported
+/ return a text string representing the current RTTOPO version
+/ or NULL if RTTOPO is currently unsupported
 */
 
-#ifdef ENABLE_LWGEOM		/* LWGEOM version */
+#ifdef ENABLE_RTTOPO		/* RTTOPO version */
     int len;
-    const char *p_result = splite_lwgeom_version ();
+    const char *p_result = splite_rttopo_version ();
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
     len = strlen (p_result);
     sqlite3_result_text (context, p_result, len, SQLITE_TRANSIENT);
@@ -546,15 +546,15 @@ fnct_libxml2_version (sqlite3_context * context, int argc,
 }
 
 static void
-fnct_has_lwgeom (sqlite3_context * context, int argc, sqlite3_value ** argv)
+fnct_has_rttopo (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ HasLwGeom()
+/ HasRtTopo()
 /
-/ return 1 if built including LWGEOM; otherwise 0
+/ return 1 if built including RTTOPO; otherwise 0
 */
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
-#ifdef ENABLE_LWGEOM		/* LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* RTTOPO is supported */
     sqlite3_result_int (context, 1);
 #else
     sqlite3_result_int (context, 0);
@@ -700,7 +700,7 @@ fnct_has_topology (sqlite3_context * context, int argc, sqlite3_value ** argv)
 / return 1 if built including GroundControlPoints support (GGP); otherwise 0
 */
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
-#ifdef POSTGIS_2_2		/* POSTGIS_2_2 is supported */
+#ifdef RTTOPO			/* RTTOPO is supported */
     sqlite3_result_int (context, 1);
 #else
     sqlite3_result_int (context, 0);
@@ -2108,12 +2108,15 @@ fnct_InitSpatialMetaData (sqlite3_context * context, int argc,
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
     if (ret != SQLITE_OK)
 	goto error;
+
+#ifndef OMIT_KNN		/* only if KNN is enabled */
 /* creating the KNN VIRTUAL TABLE */
     strcpy (sql, "CREATE VIRTUAL TABLE KNN ");
     strcat (sql, "USING VirtualKNN()");
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
     if (ret != SQLITE_OK)
 	goto error;
+#endif /* end KNN conditional */
 
     if (transaction)
       {
@@ -4048,8 +4051,8 @@ fnct_RecoverGeometryColumn (sqlite3_context * context, int argc,
     int exists = 0;
     const char *p_type = NULL;
     const char *p_dims = NULL;
-    int n_type;
-    int n_dims;
+    int n_type = GAIA_UNKNOWN;
+    int n_dims = -1;
     char *sql_statement;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
@@ -8617,7 +8620,7 @@ static void
 fnct_AsFGF (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ AsFGF(BLOB encoded geometry)
+/ AsFGF(BLOB encoded geometry, int dims)
 /
 / returns the corresponding FGF encoded value
 / or NULL if any error is encountered
@@ -18687,7 +18690,7 @@ fnct_CollectionExtract (sqlite3_context * context, int argc,
     int n_bytes;
     int type;
     gaiaGeomCollPtr geo = NULL;
-    gaiaGeomCollPtr result;
+    gaiaGeomCollPtr result = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     struct splite_internal_cache *cache = sqlite3_user_data (context);
@@ -19048,8 +19051,8 @@ static void
 fnct_IsValidReason (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ IsValidReason(geom)
-/ ST_IsValidReason(geom)
+/ IsValidReason(geom [ , esri_flag] )
+/ ST_IsValidReason(geom [ , esri_flag] )
 /
 / return a TEXT string stating if a Geometry is valid
 / and if not valid, a reason why
@@ -19059,6 +19062,7 @@ fnct_IsValidReason (sqlite3_context * context, int argc, sqlite3_value ** argv)
     int n_bytes;
     int len;
     gaiaGeomCollPtr geom;
+    int esri_flag = 0;
     char *str;
     void *data = sqlite3_user_data (context);
     int gpkg_amphibious = 0;
@@ -19077,9 +19081,33 @@ fnct_IsValidReason (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
     n_bytes = sqlite3_value_bytes (argv[0]);
+    if (argc >= 2)
+      {
+	  if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+	    {
+		sqlite3_result_null (context);
+		return;
+	    }
+	  esri_flag = sqlite3_value_int (argv[1]);
+      }
     geom =
 	gaiaFromSpatiaLiteBlobWkbEx (p_blob, n_bytes, gpkg_mode,
 				     gpkg_amphibious);
+    if (esri_flag)
+      {
+	  gaiaGeomCollPtr detail;
+	  if (data != NULL)
+	      detail = gaiaIsValidDetailEx_r (data, geom, esri_flag);
+	  else
+	      detail = gaiaIsValidDetailEx (geom, esri_flag);
+	  if (detail == NULL)
+	    {
+		sqlite3_result_null (context);
+		goto end;
+	    }
+	  else
+	      gaiaFreeGeomColl (detail);
+      }
     if (data != NULL)
 	str = gaiaIsValidReason_r (data, geom);
     else
@@ -19091,6 +19119,7 @@ fnct_IsValidReason (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  len = strlen (str);
 	  sqlite3_result_text (context, str, len, free);
       }
+  end:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
 }
@@ -19099,8 +19128,8 @@ static void
 fnct_IsValidDetail (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ IsValidDetail(geom)
-/ ST_IsValidDetail(geom)
+/ IsValidDetail(geom [ , esri_flag] )
+/ ST_IsValidDetail(geom [ , esri_flag] )
 /
 / return a Geometry detail causing a Geometry to be invalid
 / return NULL on any other case
@@ -19110,6 +19139,7 @@ fnct_IsValidDetail (sqlite3_context * context, int argc, sqlite3_value ** argv)
     int len;
     gaiaGeomCollPtr geom;
     gaiaGeomCollPtr detail;
+    int esri_flag = 0;
     unsigned char *p_result = NULL;
     void *data = sqlite3_user_data (context);
     int gpkg_amphibious = 0;
@@ -19128,13 +19158,22 @@ fnct_IsValidDetail (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
     n_bytes = sqlite3_value_bytes (argv[0]);
+    if (argc >= 2)
+      {
+	  if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+	    {
+		sqlite3_result_null (context);
+		return;
+	    }
+	  esri_flag = sqlite3_value_int (argv[1]);
+      }
     geom =
 	gaiaFromSpatiaLiteBlobWkbEx (p_blob, n_bytes, gpkg_mode,
 				     gpkg_amphibious);
     if (data != NULL)
-	detail = gaiaIsValidDetail_r (data, geom);
+	detail = gaiaIsValidDetailEx_r (data, geom, esri_flag);
     else
-	detail = gaiaIsValidDetail (geom);
+	detail = gaiaIsValidDetailEx (geom, esri_flag);
     if (detail == NULL)
 	sqlite3_result_null (context);
     else
@@ -19362,7 +19401,7 @@ static void
 fnct_IsValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
 /* SQL function:
-/ IsValid(BLOB encoded GEOMETRY)
+/ IsValid(BLOB encoded GEOMETRY [ , BOOLEAN esri_flag] )
 /
 / returns:
 / 1 if this GEOMETRY is a valid one
@@ -19373,6 +19412,7 @@ fnct_IsValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
     int n_bytes;
     int ret;
     gaiaGeomCollPtr geo = NULL;
+    int esri_flag = 0;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     struct splite_internal_cache *cache = sqlite3_user_data (context);
@@ -19389,6 +19429,15 @@ fnct_IsValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
     n_bytes = sqlite3_value_bytes (argv[0]);
+    if (argc >= 2)
+      {
+	  if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+	    {
+		sqlite3_result_null (context);
+		return;
+	    }
+	  esri_flag = sqlite3_value_int (argv[1]);
+      }
     geo =
 	gaiaFromSpatiaLiteBlobWkbEx (p_blob, n_bytes, gpkg_mode,
 				     gpkg_amphibious);
@@ -19397,6 +19446,22 @@ fnct_IsValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
     else
       {
 	  void *data = sqlite3_user_data (context);
+	  if (esri_flag)
+	    {
+		gaiaGeomCollPtr detail;
+		if (data != NULL)
+		    detail = gaiaIsValidDetailEx_r (data, geo, esri_flag);
+		else
+		    detail = gaiaIsValidDetailEx (geo, esri_flag);
+		if (detail == NULL)
+		    sqlite3_result_int (context, 1);
+		else
+		  {
+		      gaiaFreeGeomColl (detail);
+		      sqlite3_result_int (context, 0);
+		  }
+		goto end;
+	    }
 	  if (data != NULL)
 	      ret = gaiaIsValid_r (data, geo);
 	  else
@@ -19406,6 +19471,7 @@ fnct_IsValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  else
 	      sqlite3_result_int (context, ret);
       }
+  end:
     gaiaFreeGeomColl (geo);
 }
 
@@ -19653,7 +19719,7 @@ fnct_Perimeter (sqlite3_context * context, int argc, sqlite3_value ** argv)
     length_common (data, context, argc, argv, 1);
 }
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 static void
 fnct_3dLength (sqlite3_context * context, int argc, sqlite3_value ** argv)
@@ -19697,7 +19763,7 @@ fnct_3dLength (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  ret = gaia3dLength (geo, &length);
+	  ret = gaia3dLength (cache, geo, &length);
 	  if (!ret)
 	      sqlite3_result_null (context);
 	  else
@@ -19706,7 +19772,7 @@ fnct_3dLength (sqlite3_context * context, int argc, sqlite3_value ** argv)
     gaiaFreeGeomColl (geo);
 }
 
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
 
 static void
 fnct_Area (sqlite3_context * context, int argc, sqlite3_value ** argv)
@@ -19722,12 +19788,12 @@ fnct_Area (sqlite3_context * context, int argc, sqlite3_value ** argv)
     double area = 0.0;
     int ret;
     int use_ellipsoid = -1;
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     double a;
     double b;
     double rf;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
     gaiaGeomCollPtr geo = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
@@ -19765,15 +19831,17 @@ fnct_Area (sqlite3_context * context, int argc, sqlite3_value ** argv)
       {
 	  if (use_ellipsoid >= 0)
 	    {
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 		/* attempting to identify the corresponding ellipsoid */
 		if (getEllipsoidParams (sqlite, geo->Srid, &a, &b, &rf))
-		    ret = gaiaGeodesicArea (geo, a, b, use_ellipsoid, &area);
+		    ret =
+			gaiaGeodesicArea (cache, geo, a, b, use_ellipsoid,
+					  &area);
 		else
 		    ret = 0;
 #else
 		ret = 0;
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
 	    }
 	  else
 	    {
@@ -24289,21 +24357,22 @@ fnct_ConcaveHull (sqlite3_context * context, int argc, sqlite3_value ** argv)
 
 #endif /* end GEOS advanced features */
 
-#ifdef ENABLE_LWGEOM		/* enabling LWGEOM support */
+#ifdef ENABLE_RTTOPO		/* enabling RTTOPO support */
 
 static void
-fnct_LWGEOM_GetLastWarningMsg (sqlite3_context * context, int argc,
+fnct_RTTOPO_GetLastWarningMsg (sqlite3_context * context, int argc,
 			       sqlite3_value ** argv)
 {
 /* SQL function:
-/ LWGEOM_GetLastWarningMsg()
+/ RTTOPO_GetLastWarningMsg()
 /
-/ return the most recent LWGEOM warning message (if any)
+/ return the most recent RTTOPO warning message (if any)
 / return NULL on any other case
 */
     const char *msg;
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
-    msg = gaiaGetLwGeomWarningMsg ();
+    msg = gaiaGetRtTopoWarningMsg (cache);
     if (msg == NULL)
 	sqlite3_result_null (context);
     else
@@ -24311,18 +24380,19 @@ fnct_LWGEOM_GetLastWarningMsg (sqlite3_context * context, int argc,
 }
 
 static void
-fnct_LWGEOM_GetLastErrorMsg (sqlite3_context * context, int argc,
+fnct_RTTOPO_GetLastErrorMsg (sqlite3_context * context, int argc,
 			     sqlite3_value ** argv)
 {
 /* SQL function:
-/ LWGEOM_GetLastErrorMsg()
+/ RTTOPO_GetLastErrorMsg()
 /
-/ return the most recent LWGEOM error message (if any)
+/ return the most recent RTEOM error message (if any)
 / return NULL on any other case
 */
     const char *msg;
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
-    msg = gaiaGetLwGeomErrorMsg ();
+    msg = gaiaGetRtTopoErrorMsg (cache);
     if (msg == NULL)
 	sqlite3_result_null (context);
     else
@@ -24365,17 +24435,17 @@ fnct_MakeValid (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  result = gaiaMakeValid (geo);
+	  result = gaiaMakeValid (cache, geo);
 	  if (result == NULL)
 	    {
 		char *msg;
-		const char *lw_err = gaiaGetLwGeomErrorMsg ();
+		const char *lw_err = gaiaGetRtTopoErrorMsg (cache);
 		if (lw_err)
 		    msg = sqlite3_mprintf
-			("MakeValid error - LWGEOM reports: %s\n", lw_err);
+			("MakeValid error - RTTOPO reports: %s\n", lw_err);
 		else
 		    msg = sqlite3_mprintf
-			("MakeValid error - LWGEOM reports: Unknown Reason\n");
+			("MakeValid error - RTTOPO reports: Unknown Reason\n");
 		sqlite3_result_error (context, msg, strlen (msg));
 		sqlite3_free (msg);
 	    }
@@ -24431,7 +24501,7 @@ fnct_MakeValidDiscarded (sqlite3_context * context, int argc,
 	sqlite3_result_null (context);
     else
       {
-	  result = gaiaMakeValidDiscarded (geo);
+	  result = gaiaMakeValidDiscarded (cache, geo);
 	  if (result == NULL)
 	      sqlite3_result_null (context);
 	  else
@@ -24498,7 +24568,7 @@ fnct_Segmentize (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  result = gaiaSegmentize (geo, dist);
+	  result = gaiaSegmentize (cache, geo, dist);
 	  if (result == NULL)
 	      sqlite3_result_null (context);
 	  else
@@ -24571,7 +24641,7 @@ fnct_Split (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     else
       {
-	  result = gaiaSplit (input, blade);
+	  result = gaiaSplit (cache, input, blade);
 	  if (result == NULL)
 	      sqlite3_result_null (context);
 	  else
@@ -24645,7 +24715,7 @@ fnct_SplitLeft (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     else
       {
-	  result = gaiaSplitLeft (input, blade);
+	  result = gaiaSplitLeft (cache, input, blade);
 	  if (result == NULL)
 	      sqlite3_result_null (context);
 	  else
@@ -24719,7 +24789,7 @@ fnct_SplitRight (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
     else
       {
-	  result = gaiaSplitRight (input, blade);
+	  result = gaiaSplitRight (cache, input, blade);
 	  if (result == NULL)
 	      sqlite3_result_null (context);
 	  else
@@ -24832,14 +24902,14 @@ fnct_Azimuth (sqlite3_context * context, int argc, sqlite3_value ** argv)
 
     if (getEllipsoidParams (sqlite, srid, &a, &b, &rf))
       {
-	  if (gaiaEllipsoidAzimuth (x1, y1, x2, y2, a, b, &azimuth))
+	  if (gaiaEllipsoidAzimuth (cache, x1, y1, x2, y2, a, b, &azimuth))
 	      sqlite3_result_double (context, azimuth);
 	  else
 	      sqlite3_result_null (context);
 	  return;
       }
 
-    if (gaiaAzimuth (x1, y1, x2, y2, &azimuth))
+    if (gaiaAzimuth (cache, x1, y1, x2, y2, &azimuth))
 	sqlite3_result_double (context, azimuth);
     else
 	sqlite3_result_null (context);
@@ -24948,7 +25018,7 @@ fnct_Project (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  return;
       }
 
-    if (gaiaProjectedPoint (x1, y1, a, b, distance, azimuth, &x2, &y2))
+    if (gaiaProjectedPoint (cache, x1, y1, a, b, distance, azimuth, &x2, &y2))
       {
 	  gaiaMakePoint (x2, y2, srid, &p_blob, &n_bytes);
 	  if (!p_blob)
@@ -25011,7 +25081,7 @@ fnct_GeoHash (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  sqlite3_result_null (context);
 	  return;
       }
-    geo_hash = gaiaGeoHash (geom, precision);
+    geo_hash = gaiaGeoHash (cache, geom, precision);
     if (geo_hash != NULL)
       {
 	  int len = strlen (geo_hash);
@@ -25145,7 +25215,7 @@ fnct_AsX3D (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	      longshort = 1;
 	  srs = get_srs_by_srid (sqlite, geom->Srid, longshort);
       }
-    x3d = gaiaAsX3D (geom, srs, precision, options, refid);
+    x3d = gaiaAsX3D (cache, geom, srs, precision, options, refid);
     if (x3d != NULL)
       {
 	  int len = strlen (x3d);
@@ -25205,7 +25275,7 @@ fnct_3DDistance (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  ret = gaia3DDistance (geo1, geo2, &dist);
+	  ret = gaia3DDistance (cache, geo1, geo2, &dist);
 	  if (!ret)
 	      sqlite3_result_null (context);
 	  else
@@ -25262,7 +25332,7 @@ fnct_MaxDistance (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  ret = gaiaMaxDistance (geo1, geo2, &dist);
+	  ret = gaiaMaxDistance (cache, geo1, geo2, &dist);
 	  if (!ret)
 	      sqlite3_result_null (context);
 	  else
@@ -25319,7 +25389,7 @@ fnct_3DMaxDistance (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	sqlite3_result_null (context);
     else
       {
-	  ret = gaia3DMaxDistance (geo1, geo2, &dist);
+	  ret = gaia3DMaxDistance (cache, geo1, geo2, &dist);
 	  if (!ret)
 	      sqlite3_result_null (context);
 	  else
@@ -25369,7 +25439,7 @@ fnct_Node (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  return;
       }
 
-    result = gaiaNodeLines (input);
+    result = gaiaNodeLines (cache, input);
     if (result != NULL)
       {
 	  gaiaToSpatiaLiteBlobWkbEx (result, &p_blob, &n_bytes, gpkg_mode);
@@ -25638,7 +25708,7 @@ fnct_SelfIntersections (sqlite3_context * context, int argc,
 /* extracting all input nodes */
     nodes_in = get_nodes (input);
 
-    noded = gaiaNodeLines (input);
+    noded = gaiaNodeLines (cache, input);
     gaiaFreeGeomColl (input);
 /* extracting all output nodes */
     nodes_out = get_nodes (noded);
@@ -25659,7 +25729,7 @@ fnct_SelfIntersections (sqlite3_context * context, int argc,
 	sqlite3_result_null (context);
 }
 
-#endif /* end LWGEOM support */
+#endif /* end RTTOPO support */
 
 
 static void
@@ -26833,8 +26903,8 @@ fnct_math_atan2 (sqlite3_context * context, int argc, sqlite3_value ** argv)
 / or NULL if any error is encountered
 */
     int int_value;
-    double x;
-    double y;
+    double x = 0.0;
+    double y = 0.0;
     double t;
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
     if (sqlite3_value_type (argv[0]) == SQLITE_FLOAT)
@@ -28585,7 +28655,7 @@ fnct_DropGeoTable (sqlite3_context * context, int argc, sqlite3_value ** argv)
 / NULL on invalid arguments
 */
     char *db_prefix = "main";
-    char *table;
+    char *table = NULL;
     int transaction = 1;
     int ret;
     int cnt;
@@ -28631,7 +28701,7 @@ fnct_DropGeoTable (sqlite3_context * context, int argc, sqlite3_value ** argv)
       }
 
     cnt = sqlite3_total_changes (db_handle);
-    ret = gaiaDropTableEx2 (db_handle, db_prefix, table, transaction);
+    ret = gaiaDropTableEx3 (db_handle, db_prefix, table, transaction, NULL);
     if (ret)
       {
 	  if (sqlite3_total_changes (db_handle) <= cnt)
@@ -28852,6 +28922,10 @@ fnct_ImportSHP (sqlite3_context * context, int argc, sqlite3_value ** argv)
 /           TEXT geom_column, TEXT pk_column, TEXT geom_type,
 /           INT coerce2d, INT compressed, INT spatial_index,
 /           INT text_dates)
+/ ImportSHP(TEXT filename, TEXT table, TEXT charset, INT srid, 
+/           TEXT geom_column, TEXT pk_column, TEXT geom_type,
+/           INT coerce2d, INT compressed, INT spatial_index,
+/           INT text_dates, INT verbose)
 /
 / returns:
 / the number of imported rows
@@ -28866,6 +28940,7 @@ fnct_ImportSHP (sqlite3_context * context, int argc, sqlite3_value ** argv)
     int compressed = 0;
     int spatial_index = 0;
     int text_dates = 0;
+    int verbose = 1;
     char *pk_column = NULL;
     char *geo_column = NULL;
     char *geom_type = NULL;
@@ -28970,10 +29045,20 @@ fnct_ImportSHP (sqlite3_context * context, int argc, sqlite3_value ** argv)
 	  else
 	      text_dates = sqlite3_value_int (argv[10]);
       }
+    if (argc > 11)
+      {
+	  if (sqlite3_value_type (argv[11]) != SQLITE_INTEGER)
+	    {
+		sqlite3_result_null (context);
+		return;
+	    }
+	  else
+	      verbose = sqlite3_value_int (argv[11]);
+      }
 
     ret =
 	load_shapefile_ex2 (db_handle, path, table, charset, srid, geo_column,
-			    geom_type, pk_column, coerce2d, compressed, 1,
+			    geom_type, pk_column, coerce2d, compressed, verbose,
 			    spatial_index, text_dates, &rows, NULL);
 
     if (rows < 0 || !ret)
@@ -31586,7 +31671,7 @@ fnct_XB_Create (sqlite3_context * context, int argc, sqlite3_value ** argv)
 /   if such internal SchemaURI doesn't exists, or if the formal
 /   Schema Validation fails, NULL will be returned.
 */
-    int len;
+    int len = 0;
     unsigned char *p_result = NULL;
     const unsigned char *xml;
     int xml_len;
@@ -31839,7 +31924,7 @@ fnct_XB_SchemaValidate (sqlite3_context * context, int argc,
 / returns a validated XmlBLOB object if the SchemaValidation was successful
 / or NULL if any error is encountered
 */
-    int len;
+    int len = 0;
     unsigned char *p_result = NULL;
     const unsigned char *p_blob;
     int n_bytes;
@@ -33620,8 +33705,8 @@ fnct_AffineTransformMatrix_Translate (sqlite3_context * context, int argc,
     int int_value;
     unsigned char *blob;
     int blob_sz;
-    const unsigned char *iblob;
-    int iblob_sz;
+    const unsigned char *iblob = NULL;
+    int iblob_sz = 0;
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
 
 /* validating the input args */
@@ -33751,8 +33836,8 @@ fnct_AffineTransformMatrix_Scale (sqlite3_context * context, int argc,
     int int_value;
     unsigned char *blob;
     int blob_sz;
-    const unsigned char *iblob;
-    int iblob_sz;
+    const unsigned char *iblob = NULL;
+    int iblob_sz = 0;
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
 
 /* validating the input args */
@@ -34884,7 +34969,7 @@ fnct_getDecimalPrecision (sqlite3_context * context, int argc,
     sqlite3_result_int (context, cache->decimal_precision);
 }
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 static void
 fnct_CreateTopology (sqlite3_context * context, int argc, sqlite3_value ** argv)
@@ -35056,6 +35141,13 @@ fnct_TopoGeo_FromGeoTable (sqlite3_context * context, int argc,
 }
 
 static void
+fnct_TopoGeo_FromGeoTableExt (sqlite3_context * context, int argc,
+			      sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_FromGeoTableExt (context, argc, argv);
+}
+
+static void
 fnct_TopoGeo_ToGeoTable (sqlite3_context * context, int argc,
 			 sqlite3_value ** argv)
 {
@@ -35070,6 +35162,27 @@ fnct_TopoGeo_ToGeoTableGeneralize (sqlite3_context * context, int argc,
 }
 
 static void
+fnct_TopoGeo_RemoveSmallFaces (sqlite3_context * context, int argc,
+			       sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_RemoveSmallFaces (context, argc, argv);
+}
+
+static void
+fnct_TopoGeo_RemoveDanglingEdges (sqlite3_context * context, int argc,
+				  sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_RemoveDanglingEdges (context, argc, argv);
+}
+
+static void
+fnct_TopoGeo_RemoveDanglingNodes (sqlite3_context * context, int argc,
+				  sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_RemoveDanglingNodes (context, argc, argv);
+}
+
+static void
 fnct_TopoGeo_CreateTopoLayer (sqlite3_context * context, int argc,
 			      sqlite3_value ** argv)
 {
@@ -35139,6 +35252,20 @@ fnct_TopoGeo_UpdateSeeds (sqlite3_context * context, int argc,
 }
 
 static void
+fnct_TopoGeo_SnapPointToSeed (sqlite3_context * context, int argc,
+			      sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_SnapPointToSeed (context, argc, argv);
+}
+
+static void
+fnct_TopoGeo_SnapLineToSeed (sqlite3_context * context, int argc,
+			     sqlite3_value ** argv)
+{
+    fnctaux_TopoGeo_SnapLineToSeed (context, argc, argv);
+}
+
+static void
 fnct_CreateNetwork (sqlite3_context * context, int argc, sqlite3_value ** argv)
 {
     fnctaux_CreateNetwork (context, argc, argv);
@@ -35345,8 +35472,8 @@ splite_close_callback (void *p_cache)
 	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
 	return;
 
-#ifdef ENABLE_LWGEOM
-    gaiaResetLwGeomMsg ();
+#ifdef ENABLE_RTTOPO
+    gaiaResetRtTopoMsg (cache);
 #endif
 
     free_internal_cache (cache);
@@ -35385,9 +35512,9 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
     sqlite3_create_function_v2 (db, "geos_version", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				fnct_geos_version, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "lwgeom_version", 0,
+    sqlite3_create_function_v2 (db, "rttopo_version", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
-				fnct_lwgeom_version, 0, 0, 0);
+				fnct_rttopo_version, 0, 0, 0);
     sqlite3_create_function_v2 (db, "libxml2_version", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				fnct_libxml2_version, 0, 0, 0);
@@ -35409,9 +35536,9 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
     sqlite3_create_function_v2 (db, "HasGeosOnlyReentrant", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				fnct_has_geos_only_reentrant, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "HasLwGeom", 0,
+    sqlite3_create_function_v2 (db, "HasRtTopo", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
-				fnct_has_lwgeom, 0, 0, 0);
+				fnct_has_rttopo, 0, 0, 0);
     sqlite3_create_function_v2 (db, "HasMathSql", 0,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				fnct_has_math_sql, 0, 0, 0);
@@ -37120,6 +37247,9 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 	  sqlite3_create_function_v2 (db, "ImportSHP", 11,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				      fnct_ImportSHP, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "ImportSHP", 12,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
+				      fnct_ImportSHP, 0, 0, 0);
 	  sqlite3_create_function_v2 (db, "ExportSHP", 4,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
 				      fnct_ExportSHP, 0, 0, 0);
@@ -37485,13 +37615,29 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
     sqlite3_create_function_v2 (db, "GEOS_GetCriticalPointFromMsg", 1,
 				SQLITE_UTF8, cache,
 				fnct_GEOS_GetCriticalPointFromMsg, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "IsValidReason", 1, SQLITE_UTF8, cache,
+    sqlite3_create_function_v2 (db, "IsValidReason", 1,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValidReason, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "ST_IsValidReason", 1, SQLITE_UTF8, cache,
+    sqlite3_create_function_v2 (db, "IsValidReason", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValidReason, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "IsValidDetail", 1, SQLITE_UTF8, cache,
+    sqlite3_create_function_v2 (db, "ST_IsValidReason", 1,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValidReason, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "ST_IsValidReason", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValidReason, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "IsValidDetail", 1,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValidDetail, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "ST_IsValidDetail", 1, SQLITE_UTF8, cache,
+    sqlite3_create_function_v2 (db, "IsValidDetail", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValidDetail, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "ST_IsValidDetail", 1,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValidDetail, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "ST_IsValidDetail", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValidDetail, 0, 0, 0);
 
     sqlite3_create_function_v2 (db, "Boundary", 1,
@@ -37521,9 +37667,15 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
     sqlite3_create_function_v2 (db, "IsValid", 1,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValid, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "IsValid", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValid, 0, 0, 0);
     sqlite3_create_function_v2 (db, "ST_IsValid", 1,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_IsValid, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "ST_IsValid", 2,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				fnct_IsValid, 0, 0, 0);
     sqlite3_create_function_v2 (db, "GLength", 1,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_Length, 0, 0, 0);
@@ -37977,12 +38129,12 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 
 #endif /* end GEOS advanced features */
 
-#ifdef ENABLE_LWGEOM		/* enabling LWGEOM support */
+#ifdef ENABLE_RTTOPO		/* enabling RTTOPO support */
 
-    sqlite3_create_function_v2 (db, "LWGEOM_GetLastErrorMsg", 0, SQLITE_UTF8,
-				0, fnct_LWGEOM_GetLastErrorMsg, 0, 0, 0);
-    sqlite3_create_function_v2 (db, "LWGEOM_GetLastWarningMsg", 0, SQLITE_UTF8,
-				0, fnct_LWGEOM_GetLastWarningMsg, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "RTTOPO_GetLastErrorMsg", 0, SQLITE_UTF8,
+				0, fnct_RTTOPO_GetLastErrorMsg, 0, 0, 0);
+    sqlite3_create_function_v2 (db, "RTTOPO_GetLastWarningMsg", 0, SQLITE_UTF8,
+				0, fnct_RTTOPO_GetLastWarningMsg, 0, 0, 0);
 
     sqlite3_create_function_v2 (db, "MakeValid", 1,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
@@ -37991,7 +38143,7 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_MakeValid, 0, 0, 0);
     sqlite3_create_function_v2 (db, "MakeValidDiscarded", 1,
-				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
+				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_MakeValidDiscarded, 0, 0, 0);
     sqlite3_create_function_v2 (db, "ST_MakeValidDiscarded", 1,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
@@ -38099,7 +38251,7 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				fnct_3dLength, 0, 0, 0);
 
-#endif /* end LWGEOM support */
+#endif /* end RTTOPO support */
 
     sqlite3_create_function_v2 (db, "ST_Cutter", 7,
 				SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
@@ -38478,7 +38630,7 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 
 #endif /* end enabling GeoPackage extensions */
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     if (sqlite3_libversion_number () >= 3008003)
       {
 	  /* only SQLite >= 3.8.3 can suppoty WITH RECURSIVE */
@@ -38578,6 +38730,12 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 	  sqlite3_create_function_v2 (db, "TopoGeo_FromGeoTable", 7,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_FromGeoTable, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_FromGeoTableExt", 7,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_FromGeoTableExt, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_FromGeoTableExt", 9,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_FromGeoTableExt, 0, 0, 0);
 	  sqlite3_create_function_v2 (db, "TopoGeo_ToGeoTable", 5,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_ToGeoTable, 0, 0, 0);
@@ -38592,6 +38750,17 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_ToGeoTableGeneralize, 0, 0,
 				      0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_RemoveSmallFaces", 2,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_RemoveSmallFaces, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_RemoveDanglingEdges", 1,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_RemoveDanglingEdges, 0, 0,
+				      0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_RemoveDanglingNodes", 1,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_RemoveDanglingNodes, 0, 0,
+				      0);
 	  sqlite3_create_function_v2 (db, "TopoGeo_Clone", 3,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_Clone, 0, 0, 0);
@@ -38610,6 +38779,12 @@ register_spatialite_sql_functions (void *p_db, const void *p_cache)
 	  sqlite3_create_function_v2 (db, "TopoGeo_UpdateSeeds", 2,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_UpdateSeeds, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_SnapPointToSeed", 3,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_SnapPointToSeed, 0, 0, 0);
+	  sqlite3_create_function_v2 (db, "TopoGeo_SnapLineToSeed", 3,
+				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
+				      fnct_TopoGeo_SnapLineToSeed, 0, 0, 0);
 	  sqlite3_create_function_v2 (db, "TopoGeo_CreateTopoLayer", 5,
 				      SQLITE_UTF8 | SQLITE_DETERMINISTIC, cache,
 				      fnct_TopoGeo_CreateTopoLayer, 0, 0, 0);
@@ -38782,8 +38957,11 @@ init_spatialite_virtualtables (void *p_db, const void *p_cache)
     virtual_spatialindex_extension_init (db);
 /* initializing the VirtualElementary  extension */
     virtual_elementary_extension_init (db);
+
+#ifndef OMIT_KNN		/* only if KNN is enabled */
 /* initializing the VirtualKNN  extension */
     virtual_knn_extension_init (db);
+#endif /* end KNN conditional */
 
 #ifdef ENABLE_GEOPACKAGE	/* only if GeoPackage support is enabled */
 /* initializing the VirtualFDO  extension */
@@ -38806,10 +38984,6 @@ init_spatialite_extension (sqlite3 * db, char **pzErrMsg,
 	(struct splite_internal_cache *) p_cache;
     SQLITE_EXTENSION_INIT2 (pApi);
 
-#ifdef POSTGIS_2_1		/* initializing liblwgeom from PostGIS 2.1.x (or later) */
-    splite_lwgeom_init ();
-#endif /* end POSTGIS_2_1 */
-
 /* setting the POSIX locale for numeric */
     setlocale (LC_NUMERIC, "POSIX");
     *pzErrMsg = NULL;
@@ -38828,7 +39002,7 @@ init_spatialite_extension (sqlite3 * db, char **pzErrMsg,
 SPATIALITE_DECLARE void
 spatialite_init_geos (void)
 {
-/* initializes GEOS (or resets to initial state - as required by LWGEOM) */
+/* initializes GEOS (or resets to initial state - as required by RTTOPO) */
 #ifndef OMIT_GEOS		/* initializing GEOS */
 #ifndef GEOS_USE_ONLY_R_API	/* obsolete versions non fully thread-safe */
     initGEOS (geos_warning, geos_error);
@@ -38865,8 +39039,11 @@ spatialite_splash_screen (int verbose)
 		    ("\t- 'VirtualSpatialIndex'\t[R*Tree metahandler]\n");
 		spatialite_i
 		    ("\t- 'VirtualElementary'\t[ElemGeoms metahandler]\n");
+
+#ifndef OMIT_KNN		/* only if KNN is enabled */
 		spatialite_i
 		    ("\t- 'VirtualKNN'\t[K-Nearest Neighbors metahandler]\n");
+#endif /* end KNN conditional */
 
 #ifdef ENABLE_LIBXML2		/* VirtualXPath is supported */
 		spatialite_i
@@ -38891,11 +39068,11 @@ spatialite_splash_screen (int verbose)
 	  if (verbose)
 	      spatialite_i ("GEOS version ........: %s\n", GEOSversion ());
 #endif /* end GEOS version */
-#ifdef ENABLE_LWGEOM		/* LWGEOM version */
+#ifdef ENABLE_RTTOPO		/* RTTOPO version */
 	  if (verbose)
-	      spatialite_i ("LWGEOM version ......: %s\n",
-			    splite_lwgeom_version ());
-#endif /* end LWGEOM version */
+	      spatialite_i ("RTTOPO version ......: %s\n",
+			    splite_rttopo_version ());
+#endif /* end RTTOPO version */
 	  if (verbose)
 	      spatialite_i ("TARGET CPU ..........: %s\n",
 			    spatialite_target_cpu ());
@@ -38919,10 +39096,6 @@ spatialite_init_ex (sqlite3 * db_handle, const void *p_cache, int verbose)
 /* setting the POSIX locale for numeric */
     setlocale (LC_NUMERIC, "POSIX");
 
-#ifdef POSTGIS_2_1		/* initializing liblwgeom from PostGIS 2.1.x (or later) */
-    splite_lwgeom_init ();
-#endif /* end POSTGIS_2_1 */
-
     register_spatialite_sql_functions (db_handle, cache);
 
     init_spatialite_virtualtables (db_handle, p_cache);
@@ -38943,8 +39116,8 @@ spatialite_cleanup_ex (const void *ptr)
 	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
 	return;
 
-#ifdef ENABLE_LWGEOM
-    gaiaResetLwGeomMsg ();
+#ifdef ENABLE_RTTOPO
+    gaiaResetRtTopoMsg (cache);
 #endif
 
     free_internal_cache (cache);
diff --git a/src/spatialite/spatialite_init.c b/src/spatialite/spatialite_init.c
index 30fdfbd..a239fa3 100644
--- a/src/spatialite/spatialite_init.c
+++ b/src/spatialite/spatialite_init.c
@@ -119,10 +119,6 @@ spatialite_init (int verbose)
 #endif
 #endif /* end GEOS  */
 
-#ifdef POSTGIS_2_1		/* initializing liblwgeom from PostGIS 2.1.x (or later) */
-    splite_lwgeom_init ();
-#endif /* end POSTGIS_2_1 */
-
     sqlite3_auto_extension ((void (*)(void)) init_spatialite_extension);
     spatialite_splash_screen (verbose);
 }
diff --git a/src/spatialite/srid_aux.c b/src/spatialite/srid_aux.c
index 5b60e8e..291a7a8 100644
--- a/src/spatialite/srid_aux.c
+++ b/src/spatialite/srid_aux.c
@@ -1653,7 +1653,7 @@ srid_get_axis (sqlite3 * sqlite, int srid, char axis, char mode)
     char *result = NULL;
     int ret;
     sqlite3_stmt *stmt = NULL;
-    const char *sql;
+    const char *sql = "";
 
     if ((axis == SPLITE_AXIS_1 || axis == SPLITE_AXIS_2)
 	&& (mode == SPLITE_AXIS_NAME || mode == SPLITE_AXIS_ORIENTATION))
diff --git a/src/spatialite/statistics.c b/src/spatialite/statistics.c
index 759bb55..104ad43 100644
--- a/src/spatialite/statistics.c
+++ b/src/spatialite/statistics.c
@@ -1707,6 +1707,7 @@ struct drop_params
     int ok_layer_params;
     int ok_layer_sub_classes;
     int ok_layer_table_layout;
+    char *error_message;
 };
 
 static int
@@ -1718,6 +1719,8 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
     char *q_prefix;
     char *q_name;
     int i;
+    int ret;
+    char *errMsg = NULL;
 
     if (aux->is_view)
       {
@@ -1729,8 +1732,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       q_name);
 	  free (q_prefix);
 	  free (q_name);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     else
       {
@@ -1742,8 +1750,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       q_name);
 	  free (q_prefix);
 	  free (q_name);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
 
     for (i = 0; i < aux->n_rtrees; i++)
@@ -1756,8 +1769,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       q_name);
 	  free (q_prefix);
 	  free (q_name);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
 
     if (aux->ok_layer_params)
@@ -1768,8 +1786,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_layer_sub_classes)
       {
@@ -1779,8 +1802,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_layer_table_layout)
       {
@@ -1790,8 +1818,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_geometry_columns_auth)
       {
@@ -1801,8 +1834,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(f_table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_geometry_columns_field_infos)
       {
@@ -1810,11 +1848,16 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 	  q_prefix = gaiaDoubleQuotedSql (prefix);
 	  sql =
 	      sqlite3_mprintf
-	      ("DELETE FROM \"%s\".geometry_columns_fiels_infos "
+	      ("DELETE FROM \"%s\".geometry_columns_field_infos "
 	       "WHERE lower(f_table_name) = lower(%Q)", q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_geometry_columns_statistics)
       {
@@ -1825,8 +1868,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       "WHERE lower(f_table_name) = lower(%Q)",
 			       q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_views_geometry_columns_auth)
       {
@@ -1837,8 +1885,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       "WHERE lower(view_name) = lower(%Q)", q_prefix,
 			       table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_views_geometry_columns_field_infos)
       {
@@ -1846,11 +1899,16 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 	  q_prefix = gaiaDoubleQuotedSql (prefix);
 	  sql =
 	      sqlite3_mprintf
-	      ("DELETE FROM \"%s\".views_geometry_columns_fiels_infos "
+	      ("DELETE FROM \"%s\".views_geometry_columns_field_infos "
 	       "WHERE view_name = %Q", q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_views_geometry_columns_statistics)
       {
@@ -1861,8 +1919,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 	      ("DELETE FROM \"%s\".views_geometry_columns_statistics "
 	       "WHERE lower(view_name) = lower(%Q)", q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_virts_geometry_columns_auth)
       {
@@ -1873,8 +1936,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 			       "WHERE lower(virt_name) = lower(%Q)", q_prefix,
 			       table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_virts_geometry_columns_field_infos)
       {
@@ -1882,11 +1950,16 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 	  q_prefix = gaiaDoubleQuotedSql (prefix);
 	  sql =
 	      sqlite3_mprintf
-	      ("DELETE FROM \"%s\".virts_geometry_columns_fiels_infos "
+	      ("DELETE FROM \"%s\".virts_geometry_columns_field_infos "
 	       "WHERE lower(virt_name) = lower(%Q)", q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_virts_geometry_columns_statistics)
       {
@@ -1897,8 +1970,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 	      ("DELETE FROM \"%s\".virts_geometry_columns_statistics "
 	       "WHERE lower(virt_name) = lower(%Q)", q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_layer_statistics)
       {
@@ -1908,8 +1986,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_views_layer_statistics)
       {
@@ -1919,8 +2002,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(view_name) = lower(%Q)", q_prefix,
 				 table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_virts_layer_statistics)
       {
@@ -1930,8 +2018,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(virt_name) = lower(%Q)", q_prefix,
 				 table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_geometry_columns)
       {
@@ -1941,8 +2034,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(f_table_name) = lower(%Q)",
 				 q_prefix, table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_views_geometry_columns)
       {
@@ -1952,8 +2050,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(view_name) = lower(%Q)", q_prefix,
 				 table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
     if (aux->ok_virts_geometry_columns)
       {
@@ -1963,8 +2066,13 @@ do_drop_table (sqlite3 * sqlite, const char *prefix, const char *table,
 				 "WHERE lower(virt_name) = lower(%Q)", q_prefix,
 				 table);
 	  free (q_prefix);
-	  sqlite3_exec (sqlite, sql, NULL, NULL, NULL);
+	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg);
 	  sqlite3_free (sql);
+	  if (ret != SQLITE_OK)
+	    {
+		aux->error_message = errMsg;
+		return 0;
+	    }
       }
 
     return 1;
@@ -2278,6 +2386,13 @@ SPATIALITE_DECLARE int
 gaiaDropTableEx2 (sqlite3 * sqlite, const char *prefix, const char *table,
 		  int transaction)
 {
+    return gaiaDropTableEx3 (sqlite, prefix, table, transaction, NULL);
+}
+
+SPATIALITE_DECLARE int
+gaiaDropTableEx3 (sqlite3 * sqlite, const char *prefix, const char *table,
+		  int transaction, char **error_message)
+{
 /* dropping a Spatial Table and any other related stuff */
     int ret;
     struct drop_params aux;
@@ -2304,6 +2419,10 @@ gaiaDropTableEx2 (sqlite3 * sqlite, const char *prefix, const char *table,
     aux.ok_layer_params = 0;
     aux.ok_layer_sub_classes = 0;
     aux.ok_layer_table_layout = 0;
+    aux.error_message = NULL;
+
+    if (error_message != NULL)
+	*error_message = NULL;
     if (prefix == NULL)
 	return 0;
     if (table == NULL)
@@ -2369,5 +2488,15 @@ gaiaDropTableEx2 (sqlite3 * sqlite, const char *prefix, const char *table,
 	    }
 	  free (aux.rtrees);
       }
+    if (aux.error_message != NULL)
+      {
+	  if (error_message != NULL)
+	      *error_message = aux.error_message;
+	  else
+	    {
+		spatialite_e ("DropTable error: %s\r", aux.error_message);
+		sqlite3_free (aux.error_message);
+	    }
+      }
     return 0;
 }
diff --git a/src/spatialite/virtualXL.c b/src/spatialite/virtualXL.c
index dcc7d80..495baa4 100644
--- a/src/spatialite/virtualXL.c
+++ b/src/spatialite/virtualXL.c
@@ -244,7 +244,7 @@ vXL_create (sqlite3 * db, void *pAux, int argc, const char *const *argv,
 	  return SQLITE_OK;
       }
 /* selecting the currently active XL Worksheet */
-    freexl_select_active_worksheet (handle, worksheet);
+    freexl_select_active_worksheet (handle, (unsigned short) worksheet);
     freexl_worksheet_dimensions (handle, &rows, &columns);
     p_vt->XL_handle = handle;
     p_vt->rows = rows;
@@ -506,6 +506,7 @@ vXL_eval_constraints (VirtualXLCursorPtr cursor)
     VirtualXLConstraintPtr pC = cursor->firstConstraint;
     if (pC == NULL)
 	return 1;
+    cell.value.int_value = 0;
     while (pC)
       {
 	  int ok = 0;
@@ -547,8 +548,8 @@ vXL_eval_constraints (VirtualXLCursorPtr cursor)
 	      && cursor->current_row <= cursor->pVtab->rows
 	      && pC->iColumn <= cursor->pVtab->columns)
 	      freexl_get_cell_value (cursor->pVtab->XL_handle,
-				     cursor->current_row - 1, pC->iColumn - 1,
-				     &cell);
+				     (int) cursor->current_row - 1,
+				     (unsigned short) pC->iColumn - 1, &cell);
 	  else
 	      cell.type = FREEXL_CELL_NULL;
 	  if (cell.type == FREEXL_CELL_INT)
@@ -690,6 +691,12 @@ vXL_eval_constraints (VirtualXLCursorPtr cursor)
 		      if (ret >= 0)
 			  ok = 1;
 		      break;
+#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE
+		  case SQLITE_INDEX_CONSTRAINT_LIKE:
+		      if (ret >= 0)
+			  ok = 1;
+		      break;
+#endif
 		  };
 	    }
 	done:
@@ -802,6 +809,7 @@ vXL_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext,
 {
 /* fetching value for the Nth column */
     FreeXL_CellValue cell;
+    cell.value.int_value = 0;
     VirtualXLCursorPtr cursor = (VirtualXLCursorPtr) pCursor;
     if (column == 0)
       {
@@ -816,7 +824,8 @@ vXL_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext,
 	&& cursor->current_row <= cursor->pVtab->rows
 	&& column <= cursor->pVtab->columns)
 	freexl_get_cell_value (cursor->pVtab->XL_handle,
-			       cursor->current_row - 1, column - 1, &cell);
+			       cursor->current_row - 1,
+			       (unsigned short) column - 1, &cell);
     else
 	cell.type = FREEXL_CELL_NULL;
     switch (cell.type)
diff --git a/src/spatialite/virtualbbox.c b/src/spatialite/virtualbbox.c
index b55c2ab..ce2171e 100644
--- a/src/spatialite/virtualbbox.c
+++ b/src/spatialite/virtualbbox.c
@@ -307,7 +307,7 @@ vbbox_read_row (VirtualBBoxCursorPtr cursor)
     double miny = DBL_MAX;
     double maxx = 0.0 - DBL_MAX;
     double maxy = 0.0 - DBL_MAX;
-    int srid;
+    int srid = -1;
     char ok_minx = 'N';
     char ok_miny = 'N';
     char ok_maxx = 'N';
@@ -711,7 +711,7 @@ static int
 vbbox_open (sqlite3_vtab * pVTab, sqlite3_vtab_cursor ** ppCursor)
 {
 /* opening a new cursor */
-    sqlite3_stmt *stmt;
+    sqlite3_stmt *stmt = NULL;
     gaiaOutBuffer sql_statement;
     int ret;
     char *sql;
diff --git a/src/spatialite/virtualdbf.c b/src/spatialite/virtualdbf.c
index 9ac3644..1a9b67f 100644
--- a/src/spatialite/virtualdbf.c
+++ b/src/spatialite/virtualdbf.c
@@ -661,6 +661,12 @@ vdbf_eval_constraints (VirtualDbfCursorPtr cursor)
 					      if (ret >= 0)
 						  ok = 1;
 					      break;
+#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE
+					  case SQLITE_INDEX_CONSTRAINT_LIKE:
+					      if (ret >= 0)
+						  ok = 1;
+					      break;
+#endif
 					  };
 				    }
 				  break;
diff --git a/src/spatialite/virtualelementary.c b/src/spatialite/virtualelementary.c
index 201eacd..03823f6 100644
--- a/src/spatialite/virtualelementary.c
+++ b/src/spatialite/virtualelementary.c
@@ -633,7 +633,7 @@ velem_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr,
     char *table_nameQ;
     char *geo_nameQ;
     char *sql_statement;
-    sqlite3_int64 rowid_value;
+    sqlite3_int64 rowid_value = 0;
     int ok_prefix = 0;
     int ok_table = 0;
     int ok_geom = 0;
diff --git a/src/spatialite/virtualfdo.c b/src/spatialite/virtualfdo.c
index 0c4b13f..86db5b9 100644
--- a/src/spatialite/virtualfdo.c
+++ b/src/spatialite/virtualfdo.c
@@ -854,7 +854,7 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc,
 		 sqlite3_value ** argv)
 {
 /* trying to insert a row into FDO-OGR real-table */
-    sqlite3_stmt *stmt;
+    sqlite3_stmt *stmt = NULL;
     int ret;
     int i;
     int ic;
@@ -1097,7 +1097,7 @@ vfdo_update_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid, int argc,
 		 sqlite3_value ** argv)
 {
 /* trying to update a row in FDO-OGR real-table */
-    sqlite3_stmt *stmt;
+    sqlite3_stmt *stmt = NULL;
     int ret;
     int i;
     int ic;
@@ -1952,7 +1952,7 @@ static int
 vfdo_open (sqlite3_vtab * pVTab, sqlite3_vtab_cursor ** ppCursor)
 {
 /* opening a new cursor */
-    sqlite3_stmt *stmt;
+    sqlite3_stmt *stmt = NULL;
     gaiaOutBuffer sql_statement;
     int ret;
     char *sql;
diff --git a/src/spatialite/virtualknn.c b/src/spatialite/virtualknn.c
index 7e9e790..66580b3 100644
--- a/src/spatialite/virtualknn.c
+++ b/src/spatialite/virtualknn.c
@@ -68,12 +68,19 @@ CIG: 644544015A
 #include "config.h"
 #endif
 
+#ifndef OMIT_KNN		/* only if KNN is enabled */
+
 #include <spatialite/sqlite.h>
 
 #include <spatialite/spatialite.h>
 #include <spatialite/gaiaaux.h>
 #include <spatialite/gaiageo.h>
 
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define strcasecmp    _stricmp
+#define strncasecmp    _strnicmp
+#endif
+
 static struct sqlite3_module my_knn_module;
 
 #define MAX_MBR	8
@@ -1585,3 +1592,5 @@ virtual_knn_extension_init (void *xdb)
     sqlite3 *db = (sqlite3 *) xdb;
     return spliteKnnInit (db);
 }
+
+#endif /* end KNN conditional */
diff --git a/src/spatialite/virtualnetwork.c b/src/spatialite/virtualnetwork.c
index 5616508..9f9aa4f 100644
--- a/src/spatialite/virtualnetwork.c
+++ b/src/spatialite/virtualnetwork.c
@@ -1055,7 +1055,7 @@ build_solution (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution,
     int base = 0;
     int block = 128;
     int how_many;
-    sqlite3_stmt *stmt;
+    sqlite3_stmt *stmt = NULL;
     char *xfrom;
     char *xto;
     char *xgeom;
@@ -2700,7 +2700,6 @@ vnet_update (sqlite3_vtab * pVTab, int argc, sqlite3_value ** argv,
 		return SQLITE_OK;
 	    }
       }
-    return SQLITE_READONLY;
 }
 
 static int
diff --git a/src/spatialite/virtualshape.c b/src/spatialite/virtualshape.c
index 842fdd0..63c81a9 100644
--- a/src/spatialite/virtualshape.c
+++ b/src/spatialite/virtualshape.c
@@ -947,6 +947,12 @@ vshp_eval_constraints (VirtualShapeCursorPtr cursor)
 					      if (ret >= 0)
 						  ok = 1;
 					      break;
+#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE
+					  case SQLITE_INDEX_CONSTRAINT_LIKE:
+					      if (ret >= 0)
+						  ok = 1;
+					      break;
+#endif
 					  };
 				    }
 				  break;
diff --git a/src/spatialite/virtualspatialindex.c b/src/spatialite/virtualspatialindex.c
index 6170a18..7a40258 100644
--- a/src/spatialite/virtualspatialindex.c
+++ b/src/spatialite/virtualspatialindex.c
@@ -173,7 +173,7 @@ vspidx_check_view_rtree (sqlite3 * sqlite, const char *table_name,
     sqlite3_finalize (stmt);
     if (count != 1)
 	return 0;
-    if (!validateRowid (sqlite, table_name))
+    if (validateRowid (sqlite, table_name))
       {
 	  free (rt);
 	  free (rg);
@@ -637,7 +637,7 @@ vspidx_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr,
 /* setting up a cursor filter */
     char *db_prefix = NULL;
     char *table_name = NULL;
-    char *geom_column;
+    char *geom_column = NULL;
     char *xtable = NULL;
     char *xgeom = NULL;
     char *idx_name;
diff --git a/src/srsinit/epsg_inlined_extra.c b/src/srsinit/epsg_inlined_extra.c
index d461787..9d227d5 100644
--- a/src/srsinit/epsg_inlined_extra.c
+++ b/src/srsinit/epsg_inlined_extra.c
@@ -164,7 +164,7 @@ initialize_epsg_extra (int filter, struct epsg_defs **first, struct epsg_defs **
     p = add_epsg_def (filter, first, last, 40000, "gfoss.it", 1,
         "Italy mainland zone 1 GB Roma40");
     add_proj4text (p, 0,
-        "+proj=tmerc+lat_0=0 +lon_0=9  +k=0.9996 +x_0=1500000 +y_");
+        "+proj=tmerc +lat_0=0 +lon_0=9  +k=0.9996 +x_0=1500000 +y_");
     add_proj4text (p, 1,
         "0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.97");
     add_proj4text (p, 2, "1,-2.917,0.714,-11.68 +no_defs");
diff --git a/src/topology/gaia_auxnet.c b/src/topology/gaia_auxnet.c
index 255bf2e..6addec2 100644
--- a/src/topology/gaia_auxnet.c
+++ b/src/topology/gaia_auxnet.c
@@ -53,7 +53,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -65,8 +65,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include <spatialite.h>
 #include <spatialite_private.h>
 
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
+#include <librttopo.h>
 
 #include <lwn_network.h>
 
@@ -1226,12 +1225,19 @@ gaiaNetworkFromDBMS (sqlite3 * handle, const void *p_cache,
 		     const char *network_name)
 {
 /* attempting to create a Network Accessor Object into the Connection Cache */
+    const RTCTX *ctx = NULL;
     LWN_BE_CALLBACKS *callbacks;
     struct gaia_network *ptr;
     struct splite_internal_cache *cache =
 	(struct splite_internal_cache *) p_cache;
     if (cache == 0)
 	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
 /* allocating and initializing the opaque object */
     ptr = malloc (sizeof (struct gaia_network));
@@ -1243,7 +1249,7 @@ gaiaNetworkFromDBMS (sqlite3 * handle, const void *p_cache,
     ptr->spatial = 0;
     ptr->allow_coincident = 0;
     ptr->last_error_message = NULL;
-    ptr->lwn_iface = lwn_CreateBackendIface ((const LWN_BE_DATA *) ptr);
+    ptr->lwn_iface = lwn_CreateBackendIface (ctx, (const LWN_BE_DATA *) ptr);
     ptr->prev = cache->lastNetwork;
     ptr->next = NULL;
 
@@ -3444,6 +3450,7 @@ do_eval_toponet_seeds (struct gaia_network *net, sqlite3_stmt * stmt_ref,
 				gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
 			    if (geom != NULL)
 			      {
+				  gaiaGeomCollPtr result;
 				  unsigned char *p_blob;
 				  int n_bytes;
 				  int gpkg_mode = 0;
@@ -3454,7 +3461,7 @@ do_eval_toponet_seeds (struct gaia_network *net, sqlite3_stmt * stmt_ref,
 					     *) (net->cache);
 					gpkg_mode = cache->gpkg_mode;
 				    }
-				  gaiaGeomCollPtr result =
+				  result =
 				      do_eval_toponet_geom (net, geom,
 							    stmt_seed_link,
 							    stmt_node,
@@ -3830,4 +3837,4 @@ gaiaTopoNet_ToGeoTable (GaiaNetworkAccessorPtr accessor,
 					     with_spatial_index);
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/gaia_auxtopo.c b/src/topology/gaia_auxtopo.c
index d8552fb..5970035 100644
--- a/src/topology/gaia_auxtopo.c
+++ b/src/topology/gaia_auxtopo.c
@@ -59,6 +59,7 @@ CIG: 6038019AE5
 #include <stdio.h>
 #include <string.h>
 #include <float.h>
+#include <math.h>
 
 #if defined(_WIN32) && !defined(__MINGW32__)
 #include "config-msvc.h"
@@ -66,7 +67,7 @@ CIG: 6038019AE5
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -78,8 +79,7 @@ CIG: 6038019AE5
 #include <spatialite.h>
 #include <spatialite_private.h>
 
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
+#include <librttopo.h>
 
 #include <lwn_network.h>
 
@@ -2153,12 +2153,19 @@ gaiaTopologyFromDBMS (sqlite3 * handle, const void *p_cache,
 		      const char *topo_name)
 {
 /* attempting to create a Topology Accessor Object into the Connection Cache */
-    LWT_BE_CALLBACKS *callbacks;
+    const RTCTX *ctx = NULL;
+    RTT_BE_CALLBACKS *callbacks;
     struct gaia_topology *ptr;
     struct splite_internal_cache *cache =
 	(struct splite_internal_cache *) p_cache;
     if (cache == 0)
 	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
 /* allocating and initializing the opaque object */
     ptr = malloc (sizeof (struct gaia_topology));
@@ -2168,13 +2175,12 @@ gaiaTopologyFromDBMS (sqlite3 * handle, const void *p_cache,
     ptr->srid = -1;
     ptr->tolerance = 0;
     ptr->has_z = 0;
-    ptr->inside_lwt_callback = 0;
     ptr->last_error_message = NULL;
-    ptr->lwt_iface = lwt_CreateBackendIface ((const LWT_BE_DATA *) ptr);
+    ptr->rtt_iface = rtt_CreateBackendIface (ctx, (const RTT_BE_DATA *) ptr);
     ptr->prev = cache->lastTopology;
     ptr->next = NULL;
 
-    callbacks = malloc (sizeof (LWT_BE_CALLBACKS));
+    callbacks = malloc (sizeof (RTT_BE_CALLBACKS));
     callbacks->lastErrorMessage = callback_lastErrorMessage;
     callbacks->topoGetSRID = callback_topoGetSRID;
     callbacks->topoGetPrecision = callback_topoGetPrecision;
@@ -2215,8 +2221,8 @@ gaiaTopologyFromDBMS (sqlite3 * handle, const void *p_cache,
     callbacks->getFaceWithinBox2D = callback_getFaceWithinBox2D;
     ptr->callbacks = callbacks;
 
-    lwt_BackendIfaceRegisterCallbacks (ptr->lwt_iface, callbacks);
-    ptr->lwt_topology = lwt_LoadTopology (ptr->lwt_iface, topo_name);
+    rtt_BackendIfaceRegisterCallbacks (ptr->rtt_iface, callbacks);
+    ptr->rtt_topology = rtt_LoadTopology (ptr->rtt_iface, topo_name);
 
     ptr->stmt_getNodeWithinDistance2D = NULL;
     ptr->stmt_insertNodes = NULL;
@@ -2236,8 +2242,13 @@ gaiaTopologyFromDBMS (sqlite3 * handle, const void *p_cache,
     ptr->stmt_deleteFacesById = NULL;
     ptr->stmt_deleteNodesById = NULL;
     ptr->stmt_getRingEdges = NULL;
-    if (ptr->lwt_topology == NULL)
-	goto invalid;
+    if (ptr->rtt_topology == NULL)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("Topology \"%s\" is undefined !!!", topo_name);
+	  gaiaSetRtTopoErrorMsg (p_cache, msg);
+	  goto invalid;
+      }
 
 /* creating the SQL prepared statements */
     create_topogeo_prepared_stmts ((GaiaTopologyAccessorPtr) ptr);
@@ -2263,10 +2274,10 @@ gaiaTopologyDestroy (GaiaTopologyAccessorPtr topo_ptr)
     prev = ptr->prev;
     next = ptr->next;
     cache = (struct splite_internal_cache *) (ptr->cache);
-    if (ptr->lwt_topology != NULL)
-	lwt_FreeTopology ((LWT_TOPOLOGY *) (ptr->lwt_topology));
-    if (ptr->lwt_iface != NULL)
-	lwt_FreeBackendIface ((LWT_BE_IFACE *) (ptr->lwt_iface));
+    if (ptr->rtt_topology != NULL)
+	rtt_FreeTopology ((RTT_TOPOLOGY *) (ptr->rtt_topology));
+    if (ptr->rtt_iface != NULL)
+	rtt_FreeBackendIface ((RTT_BE_IFACE *) (ptr->rtt_iface));
     if (ptr->callbacks != NULL)
 	free (ptr->callbacks);
     if (ptr->topology_name != NULL)
@@ -2445,6 +2456,8 @@ gaiatopo_reset_last_error_msg (GaiaTopologyAccessorPtr accessor)
     if (topo == NULL)
 	return;
 
+    if (topo->cache != NULL)
+	gaiaResetRtTopoMsg (topo->cache);
     if (topo->last_error_message != NULL)
 	free (topo->last_error_message);
     topo->last_error_message = NULL;
@@ -2568,40 +2581,44 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaAddIsoNode (GaiaTopologyAccessorPtr accessor,
 		sqlite3_int64 face, gaiaPointPtr pt, int skip_checks)
 {
-/* LWT wrapper - AddIsoNode */
+/* RTT wrapper - AddIsoNode */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_AddIsoNode ((LWT_TOPOLOGY *) (topo->lwt_topology), face, lw_pt,
+	rtt_AddIsoNode ((RTT_TOPOLOGY *) (topo->rtt_topology), face, rt_pt,
 			skip_checks);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
 
-    lwpoint_free (lw_pt);
+    rtpoint_free (ctx, rt_pt);
     return ret;
 }
 
@@ -2609,38 +2626,42 @@ GAIATOPO_DECLARE int
 gaiaMoveIsoNode (GaiaTopologyAccessorPtr accessor,
 		 sqlite3_int64 node, gaiaPointPtr pt)
 {
-/* LWT wrapper - MoveIsoNode */
+/* RTT wrapper - MoveIsoNode */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     int ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
-    ret = lwt_MoveIsoNode ((LWT_TOPOLOGY *) (topo->lwt_topology), node, lw_pt);
-    splite_lwgeom_init ();
+    gaiaResetRtTopoMsg (cache);
+    ret = rtt_MoveIsoNode ((RTT_TOPOLOGY *) (topo->rtt_topology), node, rt_pt);
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-
-    lwpoint_free (lw_pt);
+    rtpoint_free (ctx, rt_pt);
     if (ret == 0)
 	return 1;
     return 0;
@@ -2649,22 +2670,22 @@ gaiaMoveIsoNode (GaiaTopologyAccessorPtr accessor,
 GAIATOPO_DECLARE int
 gaiaRemIsoNode (GaiaTopologyAccessorPtr accessor, sqlite3_int64 node)
 {
-/* LWT wrapper - RemIsoNode */
+/* RTT wrapper - RemIsoNode */
+    struct splite_internal_cache *cache = NULL;
     int ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
-    ret = lwt_RemoveIsoNode ((LWT_TOPOLOGY *) (topo->lwt_topology), node);
-    splite_lwgeom_init ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    gaiaResetRtTopoMsg (cache);
+    ret = rtt_RemoveIsoNode ((RTT_TOPOLOGY *) (topo->rtt_topology), node);
 
     if (ret == 0)
 	return 1;
@@ -2676,51 +2697,56 @@ gaiaAddIsoEdge (GaiaTopologyAccessorPtr accessor,
 		sqlite3_int64 start_node, sqlite3_int64 end_node,
 		gaiaLinestringPtr ln)
 {
-/* LWT wrapper - AddIsoEdge */
+/* RTT wrapper - AddIsoEdge */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
-    LWLINE *lw_line;
+    RTLINE *rt_line;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_line = gaia_convert_linestring_to_lwline (ln, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_line =
+	gaia_convert_linestring_to_rtline (ctx, ln, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_AddIsoEdge ((LWT_TOPOLOGY *) (topo->lwt_topology), start_node,
-			end_node, lw_line);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+	rtt_AddIsoEdge ((RTT_TOPOLOGY *) (topo->rtt_topology), start_node,
+			end_node, rt_line);
 
-    lwline_free (lw_line);
+    rtline_free (ctx, rt_line);
     return ret;
 }
 
 GAIATOPO_DECLARE int
 gaiaRemIsoEdge (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge)
 {
-/* LWT wrapper - RemIsoEdge */
+/* RTT wrapper - RemIsoEdge */
+    struct splite_internal_cache *cache = NULL;
     int ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
-    ret = lwt_RemIsoEdge ((LWT_TOPOLOGY *) (topo->lwt_topology), edge);
-    splite_lwgeom_init ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    gaiaResetRtTopoMsg (cache);
+    ret = rtt_RemIsoEdge ((RTT_TOPOLOGY *) (topo->rtt_topology), edge);
 
     if (ret == 0)
 	return 1;
@@ -2731,72 +2757,390 @@ GAIATOPO_DECLARE int
 gaiaChangeEdgeGeom (GaiaTopologyAccessorPtr accessor,
 		    sqlite3_int64 edge_id, gaiaLinestringPtr ln)
 {
-/* LWT wrapper - ChangeEdgeGeom  */
+/* RTT wrapper - ChangeEdgeGeom  */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     int ret;
-    LWLINE *lw_line;
+    RTLINE *rt_line;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_line = gaia_convert_linestring_to_lwline (ln, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_line =
+	gaia_convert_linestring_to_rtline (ctx, ln, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_ChangeEdgeGeom ((LWT_TOPOLOGY *) (topo->lwt_topology), edge_id,
-			    lw_line);
-    splite_lwgeom_init ();
+	rtt_ChangeEdgeGeom ((RTT_TOPOLOGY *) (topo->rtt_topology), edge_id,
+			    rt_line);
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-
-    lwline_free (lw_line);
+    rtline_free (ctx, rt_line);
     if (ret == 0)
 	return 1;
     return 0;
 }
 
+static void
+do_check_mod_split_edge3d (struct gaia_topology *topo, gaiaPointPtr pt,
+			   sqlite3_int64 old_edge)
+{
+/*
+/ defensive programming: carefully ensuring that lwgeom could
+/ never shift Edges' start/end points after computing ModSplit
+/ 3D topology
+*/
+    sqlite3_stmt *stmt = NULL;
+    int ret;
+    char *sql;
+    char *table;
+    char *xtable;
+    double x1s;
+    double y1s;
+    double z1s;
+    double x1e;
+    double y1e;
+    double z1e;
+    double x2s;
+    double y2s;
+    double z2s;
+    double x2e;
+    double y2e;
+    double z2e;
+    sqlite3_int64 new_edge = sqlite3_last_insert_rowid (topo->db_handle);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("SELECT ST_X(ST_StartPoint(geom)), ST_Y(ST_StartPoint(geom)), "
+	 "ST_Z(ST_StartPoint(geom)), ST_X(ST_EndPoint(geom)), ST_Y(ST_EndPoint(geom)), "
+	 "ST_Z(ST_EndPoint(geom)) FROM \"%s\" WHERE edge_id = ?", xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_int64 (stmt, 1, old_edge);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		x1s = sqlite3_column_double (stmt, 0);
+		y1s = sqlite3_column_double (stmt, 1);
+		z1s = sqlite3_column_double (stmt, 2);
+		x1e = sqlite3_column_double (stmt, 3);
+		y1e = sqlite3_column_double (stmt, 4);
+		z1e = sqlite3_column_double (stmt, 5);
+	    }
+	  else
+	      goto error;
+      }
+
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_int64 (stmt, 1, new_edge);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		x2s = sqlite3_column_double (stmt, 0);
+		y2s = sqlite3_column_double (stmt, 1);
+		z2s = sqlite3_column_double (stmt, 2);
+		x2e = sqlite3_column_double (stmt, 3);
+		y2e = sqlite3_column_double (stmt, 4);
+		z2e = sqlite3_column_double (stmt, 5);
+	    }
+	  else
+	      goto error;
+      }
+    if (x1s == x2e && y1s == y2e && z1s == z2e)
+      {
+	  /* just silencing stupid compiler warnings */
+	  ;
+      }
+    if (x1e == x2s && y1e == y2s && z1e == z2s)
+      {
+	  if (x1e != pt->X || y1e != pt->Y || z1e != pt->Z)
+	      goto fixme;
+      }
+  error:
+    sqlite3_finalize (stmt);
+    return;
+
+  fixme:
+    sqlite3_finalize (stmt);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("UPDATE \"%s\" SET geom = ST_SetEndPoint(geom, MakePointZ(?, ?, ?)) WHERE edge_id = ?",
+	 xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_double (stmt, 1, pt->X);
+    sqlite3_bind_double (stmt, 2, pt->Y);
+    sqlite3_bind_double (stmt, 3, pt->Z);
+    sqlite3_bind_int64 (stmt, 4, old_edge);
+    ret = sqlite3_step (stmt);
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+	;
+    else
+	goto error2;
+
+    sqlite3_finalize (stmt);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("UPDATE \"%s\" SET geom = ST_SetStartPoint(geom, MakePointZ(?, ?, ?)) WHERE edge_id = ?",
+	 xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_double (stmt, 1, pt->X);
+    sqlite3_bind_double (stmt, 2, pt->Y);
+    sqlite3_bind_double (stmt, 3, pt->Z);
+    sqlite3_bind_int64 (stmt, 4, new_edge);
+    ret = sqlite3_step (stmt);
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+	;
+    else
+	goto error2;
+
+  error2:
+    sqlite3_finalize (stmt);
+    return;
+}
+
+static void
+do_check_mod_split_edge (struct gaia_topology *topo, gaiaPointPtr pt,
+			 sqlite3_int64 old_edge)
+{
+/*
+/ defensive programming: carefully ensuring that lwgeom could
+/ never shift Edges' start/end points after computing ModSplit
+/ 2D topology
+*/
+    sqlite3_stmt *stmt = NULL;
+    int ret;
+    char *sql;
+    char *table;
+    char *xtable;
+    double x1s;
+    double y1s;
+    double x1e;
+    double y1e;
+    double x2s;
+    double y2s;
+    double x2e;
+    double y2e;
+    sqlite3_int64 new_edge;
+    if (topo->has_z)
+      {
+	  do_check_mod_split_edge3d (topo, pt, old_edge);
+	  return;
+      }
+
+    new_edge = sqlite3_last_insert_rowid (topo->db_handle);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("SELECT ST_X(ST_StartPoint(geom)), ST_Y(ST_StartPoint(geom)), "
+	 "ST_X(ST_EndPoint(geom)), ST_Y(ST_EndPoint(geom)) FROM \"%s\" WHERE edge_id = ?",
+	 xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_int64 (stmt, 1, old_edge);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		x1s = sqlite3_column_double (stmt, 0);
+		y1s = sqlite3_column_double (stmt, 1);
+		x1e = sqlite3_column_double (stmt, 2);
+		y1e = sqlite3_column_double (stmt, 3);
+	    }
+	  else
+	      goto error;
+      }
+
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_int64 (stmt, 1, new_edge);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		x2s = sqlite3_column_double (stmt, 0);
+		y2s = sqlite3_column_double (stmt, 1);
+		x2e = sqlite3_column_double (stmt, 2);
+		y2e = sqlite3_column_double (stmt, 3);
+	    }
+	  else
+	      goto error;
+      }
+    if (x1s == x2e && y1s == y2e)
+      {
+	  /* just silencing stupid compiler warnings */
+	  ;
+      }
+    if (x1e == x2s && y1e == y2s)
+      {
+	  if (x1e != pt->X || y1e != pt->Y)
+	      goto fixme;
+      }
+  error:
+    sqlite3_finalize (stmt);
+    return;
+
+  fixme:
+    sqlite3_finalize (stmt);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("UPDATE \"%s\" SET geom = ST_SetEndPoint(geom, MakePoint(?, ?)) WHERE edge_id = ?",
+	 xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_double (stmt, 1, pt->X);
+    sqlite3_bind_double (stmt, 2, pt->Y);
+    sqlite3_bind_int64 (stmt, 3, old_edge);
+    ret = sqlite3_step (stmt);
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+	;
+    else
+	goto error2;
+
+    sqlite3_finalize (stmt);
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf
+	("UPDATE \"%s\" SET geom = ST_SetStartPoint(geom, MakePoint(?, ?)) WHERE edge_id = ?",
+	 xtable);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return;
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_double (stmt, 1, pt->X);
+    sqlite3_bind_double (stmt, 2, pt->Y);
+    sqlite3_bind_int64 (stmt, 3, new_edge);
+    ret = sqlite3_step (stmt);
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+	;
+    else
+	goto error2;
+
+  error2:
+    sqlite3_finalize (stmt);
+    return;
+}
+
 GAIATOPO_DECLARE sqlite3_int64
 gaiaModEdgeSplit (GaiaTopologyAccessorPtr accessor,
 		  sqlite3_int64 edge, gaiaPointPtr pt, int skip_checks)
 {
-/* LWT wrapper - ModEdgeSplit */
+/* RTT wrapper - ModEdgeSplit */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_ModEdgeSplit ((LWT_TOPOLOGY *) (topo->lwt_topology), edge, lw_pt,
+	rtt_ModEdgeSplit ((RTT_TOPOLOGY *) (topo->rtt_topology), edge, rt_pt,
 			  skip_checks);
-    splite_lwgeom_init ();
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    rtpoint_free (ctx, rt_pt);
+
+    if (ret > 0)
+	do_check_mod_split_edge (topo, pt, edge);
 
-    lwpoint_free (lw_pt);
     return ret;
 }
 
@@ -2804,40 +3148,44 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaNewEdgesSplit (GaiaTopologyAccessorPtr accessor,
 		   sqlite3_int64 edge, gaiaPointPtr pt, int skip_checks)
 {
-/* LWT wrapper - NewEdgesSplit */
+/* RTT wrapper - NewEdgesSplit */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_NewEdgesSplit ((LWT_TOPOLOGY *) (topo->lwt_topology), edge, lw_pt,
+	rtt_NewEdgesSplit ((RTT_TOPOLOGY *) (topo->rtt_topology), edge, rt_pt,
 			   skip_checks);
-    splite_lwgeom_init ();
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-
-    lwpoint_free (lw_pt);
+    rtpoint_free (ctx, rt_pt);
     return ret;
 }
 
@@ -2846,29 +3194,34 @@ gaiaAddEdgeModFace (GaiaTopologyAccessorPtr accessor,
 		    sqlite3_int64 start_node, sqlite3_int64 end_node,
 		    gaiaLinestringPtr ln, int skip_checks)
 {
-/* LWT wrapper - AddEdgeModFace */
+/* RTT wrapper - AddEdgeModFace */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
-    LWLINE *lw_line;
+    RTLINE *rt_line;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_line = gaia_convert_linestring_to_lwline (ln, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_line =
+	gaia_convert_linestring_to_rtline (ctx, ln, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_AddEdgeModFace ((LWT_TOPOLOGY *) (topo->lwt_topology), start_node,
-			    end_node, lw_line, skip_checks);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+	rtt_AddEdgeModFace ((RTT_TOPOLOGY *) (topo->rtt_topology), start_node,
+			    end_node, rt_line, skip_checks);
 
-    lwline_free (lw_line);
+    rtline_free (ctx, rt_line);
     return ret;
 }
 
@@ -2877,51 +3230,56 @@ gaiaAddEdgeNewFaces (GaiaTopologyAccessorPtr accessor,
 		     sqlite3_int64 start_node, sqlite3_int64 end_node,
 		     gaiaLinestringPtr ln, int skip_checks)
 {
-/* LWT wrapper - AddEdgeNewFaces */
+/* RTT wrapper - AddEdgeNewFaces */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
-    LWLINE *lw_line;
+    RTLINE *rt_line;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_line = gaia_convert_linestring_to_lwline (ln, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_line =
+	gaia_convert_linestring_to_rtline (ctx, ln, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_AddEdgeNewFaces ((LWT_TOPOLOGY *) (topo->lwt_topology), start_node,
-			     end_node, lw_line, skip_checks);
-    splite_lwgeom_init ();
+	rtt_AddEdgeNewFaces ((RTT_TOPOLOGY *) (topo->rtt_topology), start_node,
+			     end_node, rt_line, skip_checks);
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-
-    lwline_free (lw_line);
+    rtline_free (ctx, rt_line);
     return ret;
 }
 
 GAIATOPO_DECLARE sqlite3_int64
 gaiaRemEdgeNewFace (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id)
 {
-/* LWT wrapper - RemEdgeNewFace */
+/* RTT wrapper - RemEdgeNewFace */
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
-    ret = lwt_RemEdgeNewFace ((LWT_TOPOLOGY *) (topo->lwt_topology), edge_id);
-    splite_lwgeom_init ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    gaiaResetRtTopoMsg (cache);
+    ret = rtt_RemEdgeNewFace ((RTT_TOPOLOGY *) (topo->rtt_topology), edge_id);
 
     return ret;
 }
@@ -2929,22 +3287,22 @@ gaiaRemEdgeNewFace (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id)
 GAIATOPO_DECLARE sqlite3_int64
 gaiaRemEdgeModFace (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id)
 {
-/* LWT wrapper - RemEdgeModFace */
+/* RTT wrapper - RemEdgeModFace */
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
-    ret = lwt_RemEdgeModFace ((LWT_TOPOLOGY *) (topo->lwt_topology), edge_id);
-    splite_lwgeom_init ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    gaiaResetRtTopoMsg (cache);
+    ret = rtt_RemEdgeModFace ((RTT_TOPOLOGY *) (topo->rtt_topology), edge_id);
 
     return ret;
 }
@@ -2953,24 +3311,24 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaNewEdgeHeal (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id1,
 		 sqlite3_int64 edge_id2)
 {
-/* LWT wrapper - NewEdgeHeal */
+/* RTT wrapper - NewEdgeHeal */
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_NewEdgeHeal ((LWT_TOPOLOGY *) (topo->lwt_topology), edge_id1,
+	rtt_NewEdgeHeal ((RTT_TOPOLOGY *) (topo->rtt_topology), edge_id1,
 			 edge_id2);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
 
     return ret;
 }
@@ -2979,24 +3337,24 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaModEdgeHeal (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id1,
 		 sqlite3_int64 edge_id2)
 {
-/* LWT wrapper - ModEdgeHeal */
+/* RTT wrapper - ModEdgeHeal */
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_ModEdgeHeal ((LWT_TOPOLOGY *) (topo->lwt_topology), edge_id1,
+	rtt_ModEdgeHeal ((RTT_TOPOLOGY *) (topo->rtt_topology), edge_id1,
 			 edge_id2);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
 
     return ret;
 }
@@ -3004,12 +3362,14 @@ gaiaModEdgeHeal (GaiaTopologyAccessorPtr accessor, sqlite3_int64 edge_id1,
 GAIATOPO_DECLARE gaiaGeomCollPtr
 gaiaGetFaceGeometry (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 {
-/* LWT wrapper - GetFaceGeometry */
-    LWGEOM *result = NULL;
-    LWPOLY *lwpoly;
+/* RTT wrapper - GetFaceGeometry */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    RTGEOM *result = NULL;
+    RTPOLY *rtpoly;
     int has_z = 0;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int iv;
     int ib;
     double x;
@@ -3023,42 +3383,36 @@ gaiaGetFaceGeometry (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
     if (topo == NULL)
 	return 0;
 
-    if (topo->inside_lwt_callback == 0)
-      {
-	  /* locking the semaphore if not already inside a callback context */
-	  splite_lwgeom_semaphore_lock ();
-	  splite_lwgeomtopo_init ();
-	  gaiaResetLwGeomMsg ();
-      }
-
-    result = lwt_GetFaceGeometry ((LWT_TOPOLOGY *) (topo->lwt_topology), face);
-
-    if (topo->inside_lwt_callback == 0)
-      {
-	  /* unlocking the semaphore if not already inside a callback context */
-	  splite_lwgeom_init ();
-	  splite_lwgeom_semaphore_unlock ();
-      }
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
+    result = rtt_GetFaceGeometry ((RTT_TOPOLOGY *) (topo->rtt_topology), face);
     if (result == NULL)
 	return NULL;
 
 /* converting the result as a Gaia Geometry */
-    lwpoly = (LWPOLY *) result;
-    if (lwpoly->nrings <= 0)
+    rtpoly = (RTPOLY *) result;
+    if (rtpoly->nrings <= 0)
       {
 	  /* empty geometry */
-	  lwgeom_free (result);
+	  rtgeom_free (ctx, result);
 	  return NULL;
       }
-    pa = lwpoly->rings[0];
+    pa = rtpoly->rings[0];
     if (pa->npoints <= 0)
       {
 	  /* empty geometry */
-	  lwgeom_free (result);
+	  rtgeom_free (ctx, result);
 	  return NULL;
       }
-    if (FLAGS_GET_Z (pa->flags))
+    if (RTFLAGS_GET_Z (pa->flags))
 	has_z = 1;
     if (has_z)
       {
@@ -3070,12 +3424,12 @@ gaiaGetFaceGeometry (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 	  dimension_model = GAIA_XY;
 	  geom = gaiaAllocGeomColl ();
       }
-    pg = gaiaAddPolygonToGeomColl (geom, pa->npoints, lwpoly->nrings - 1);
+    pg = gaiaAddPolygonToGeomColl (geom, pa->npoints, rtpoly->nrings - 1);
     rng = pg->Exterior;
     for (iv = 0; iv < pa->npoints; iv++)
       {
 	  /* copying Exterior Ring vertices */
-	  getPoint4d_p (pa, iv, &pt4d);
+	  rt_getPoint4d_p (ctx, pa, iv, &pt4d);
 	  x = pt4d.x;
 	  y = pt4d.y;
 	  if (has_z)
@@ -3091,17 +3445,17 @@ gaiaGetFaceGeometry (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 		gaiaSetPoint (rng->Coords, iv, x, y);
 	    }
       }
-    for (ib = 1; ib < lwpoly->nrings; ib++)
+    for (ib = 1; ib < rtpoly->nrings; ib++)
       {
 	  has_z = 0;
-	  pa = lwpoly->rings[ib];
-	  if (FLAGS_GET_Z (pa->flags))
+	  pa = rtpoly->rings[ib];
+	  if (RTFLAGS_GET_Z (pa->flags))
 	      has_z = 1;
 	  rng = gaiaAddInteriorRing (pg, ib - 1, pa->npoints);
 	  for (iv = 0; iv < pa->npoints; iv++)
 	    {
 		/* copying Exterior Ring vertices */
-		getPoint4d_p (pa, iv, &pt4d);
+		rt_getPoint4d_p (ctx, pa, iv, &pt4d);
 		x = pt4d.x;
 		y = pt4d.y;
 		if (has_z)
@@ -3118,7 +3472,7 @@ gaiaGetFaceGeometry (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 		  }
 	    }
       }
-    lwgeom_free (result);
+    rtgeom_free (ctx, result);
     geom->DeclaredType = GAIA_POLYGON;
     geom->Srid = topo->srid;
     return geom;
@@ -3216,7 +3570,7 @@ do_check_create_faceedges_table (GaiaTopologyAccessorPtr accessor)
 
 static int
 do_populate_faceedges_table (GaiaTopologyAccessorPtr accessor,
-			     sqlite3_int64 face, LWT_ELEMID * edges,
+			     sqlite3_int64 face, RTT_ELEMID * edges,
 			     int num_edges)
 {
 /* populating the target table */
@@ -3312,24 +3666,29 @@ do_populate_faceedges_table (GaiaTopologyAccessorPtr accessor,
 GAIATOPO_DECLARE int
 gaiaGetFaceEdges (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 {
-/* LWT wrapper - GetFaceEdges */
-    LWT_ELEMID *edges = NULL;
+/* RTT wrapper - GetFaceEdges */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    RTT_ELEMID *edges = NULL;
     int num_edges;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    /* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-    num_edges =
-	lwt_GetFaceEdges ((LWT_TOPOLOGY *) (topo->lwt_topology), face, &edges);
+    gaiaResetRtTopoMsg (cache);
 
-    /* unlocking the semaphore */
-    splite_lwgeom_init ();
-    splite_lwgeom_semaphore_unlock ();
+    num_edges =
+	rtt_GetFaceEdges ((RTT_TOPOLOGY *) (topo->rtt_topology), face, &edges);
 
     if (num_edges < 0)
 	return 0;
@@ -3339,18 +3698,18 @@ gaiaGetFaceEdges (GaiaTopologyAccessorPtr accessor, sqlite3_int64 face)
 	  /* attemtping to create or validate the target table */
 	  if (!do_check_create_faceedges_table (accessor))
 	    {
-		lwfree (edges);
+		rtfree (ctx, edges);
 		return 0;
 	    }
 
 	  /* populating the target table */
 	  if (!do_populate_faceedges_table (accessor, face, edges, num_edges))
 	    {
-		lwfree (edges);
+		rtfree (ctx, edges);
 		return 0;
 	    }
       }
-    lwfree (edges);
+    rtfree (ctx, edges);
     return 1;
 }
 
@@ -4724,39 +5083,43 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaGetNodeByPoint (GaiaTopologyAccessorPtr accessor, gaiaPointPtr pt,
 		    double tolerance)
 {
-/* LWT wrapper - GetNodeByPoint */
+/* RTT wrapper - GetNodeByPoint */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_GetNodeByPoint ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_pt,
+	rtt_GetNodeByPoint ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_pt,
 			    tolerance);
-    lwpoint_free (lw_pt);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    rtpoint_free (ctx, rt_pt);
 
     return ret;
 }
@@ -4765,39 +5128,43 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaGetEdgeByPoint (GaiaTopologyAccessorPtr accessor, gaiaPointPtr pt,
 		    double tolerance)
 {
-/* LWT wrapper - GetEdgeByPoint */
+/* RTT wrapper - GetEdgeByPoint */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_GetEdgeByPoint ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_pt,
+	rtt_GetEdgeByPoint ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_pt,
 			    tolerance);
-    lwpoint_free (lw_pt);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    rtpoint_free (ctx, rt_pt);
 
     return ret;
 }
@@ -4806,39 +5173,43 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaGetFaceByPoint (GaiaTopologyAccessorPtr accessor, gaiaPointPtr pt,
 		    double tolerance)
 {
-/* LWT wrapper - GetFaceByPoint */
+/* RTT wrapper - GetFaceByPoint */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
-
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_GetFaceByPoint ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_pt,
+	rtt_GetFaceByPoint ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_pt,
 			    tolerance);
-    lwpoint_free (lw_pt);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+    rtpoint_free (ctx, rt_pt);
 
     return ret;
 }
@@ -4847,38 +5218,42 @@ GAIATOPO_DECLARE sqlite3_int64
 gaiaTopoGeo_AddPoint (GaiaTopologyAccessorPtr accessor, gaiaPointPtr pt,
 		      double tolerance)
 {
-/* LWT wrapper - AddPoint */
+/* RTT wrapper - AddPoint */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     sqlite3_int64 ret;
     int has_z = 0;
-    LWPOINT *lw_pt;
-    POINTARRAY *pa;
-    POINT4D point;
+    RTPOINT *rt_pt;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
     if (pt->DimensionModel == GAIA_XY_Z || pt->DimensionModel == GAIA_XY_Z_M)
 	has_z = 1;
-    pa = ptarray_construct (has_z, 0, 1);
+    pa = ptarray_construct (ctx, has_z, 0, 1);
     point.x = pt->X;
     point.y = pt->Y;
     if (has_z)
 	point.z = pt->Z;
-    ptarray_set_point4d (pa, 0, &point);
-    lw_pt = lwpoint_construct (topo->srid, NULL, pa);
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rt_pt = rtpoint_construct (ctx, topo->srid, NULL, pa);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     ret =
-	lwt_AddPoint ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_pt, tolerance);
-    lwpoint_free (lw_pt);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+	rtt_AddPoint ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_pt, tolerance);
+    rtpoint_free (ctx, rt_pt);
 
     return ret;
 }
@@ -4888,33 +5263,38 @@ gaiaTopoGeo_AddLineString (GaiaTopologyAccessorPtr accessor,
 			   gaiaLinestringPtr ln, double tolerance,
 			   sqlite3_int64 ** edge_ids, int *ids_count)
 {
-/* LWT wrapper - AddLinestring */
+/* RTT wrapper - AddLinestring */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     int ret = 0;
-    LWT_ELEMID *edgeids;
+    RTT_ELEMID *edgeids;
     int nedges;
     int i;
     sqlite3_int64 *ids;
-    LWLINE *lw_line;
+    RTLINE *rt_line;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_line = gaia_convert_linestring_to_lwline (ln, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_line =
+	gaia_convert_linestring_to_rtline (ctx, ln, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     edgeids =
-	lwt_AddLine ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_line, tolerance,
+	rtt_AddLine ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_line, tolerance,
 		     &nedges);
-    splite_lwgeom_init ();
-
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
 
-    lwline_free (lw_line);
+    rtline_free (ctx, rt_line);
     if (edgeids != NULL)
       {
 	  ids = malloc (sizeof (sqlite3_int64) * nedges);
@@ -4923,7 +5303,7 @@ gaiaTopoGeo_AddLineString (GaiaTopologyAccessorPtr accessor,
 	  *edge_ids = ids;
 	  *ids_count = nedges;
 	  ret = 1;
-	  lwfree (edgeids);
+	  rtfree (ctx, edgeids);
       }
     return ret;
 }
@@ -4933,33 +5313,38 @@ gaiaTopoGeo_AddPolygon (GaiaTopologyAccessorPtr accessor, gaiaPolygonPtr pg,
 			double tolerance, sqlite3_int64 ** face_ids,
 			int *ids_count)
 {
-/* LWT wrapper - AddPolygon */
+/* RTT wrapper - AddPolygon */
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
     int ret = 0;
-    LWT_ELEMID *faceids;
+    RTT_ELEMID *faceids;
     int nfaces;
     int i;
     sqlite3_int64 *ids;
-    LWPOLY *lw_polyg;
+    RTPOLY *rt_polyg;
     struct gaia_topology *topo = (struct gaia_topology *) accessor;
     if (topo == NULL)
 	return 0;
 
-    lw_polyg = gaia_convert_polygon_to_lwpoly (pg, topo->srid, topo->has_z);
+    cache = (struct splite_internal_cache *) topo->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    rt_polyg =
+	gaia_convert_polygon_to_rtpoly (ctx, pg, topo->srid, topo->has_z);
 
-    splite_lwgeomtopo_init ();
-    gaiaResetLwGeomMsg ();
+    gaiaResetRtTopoMsg (cache);
     faceids =
-	lwt_AddPolygon ((LWT_TOPOLOGY *) (topo->lwt_topology), lw_polyg,
+	rtt_AddPolygon ((RTT_TOPOLOGY *) (topo->rtt_topology), rt_polyg,
 			tolerance, &nfaces);
-    splite_lwgeom_init ();
 
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
-
-    lwpoly_free (lw_polyg);
+    rtpoly_free (ctx, rt_polyg);
     if (faceids != NULL)
       {
 	  ids = malloc (sizeof (sqlite3_int64) * nfaces);
@@ -4968,7 +5353,7 @@ gaiaTopoGeo_AddPolygon (GaiaTopologyAccessorPtr accessor, gaiaPolygonPtr pg,
 	  *face_ids = ids;
 	  *ids_count = nfaces;
 	  ret = 1;
-	  lwfree (faceids);
+	  rtfree (ctx, faceids);
       }
     return ret;
 }
@@ -5462,24 +5847,349 @@ gaiaTopoGeo_FromGeoTable (GaiaTopologyAccessorPtr accessor,
 		      goto error;
 		  }
 	    }
-	  else
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf ("TopoGeo_FromGeoTable error: \"%s\"",
+				     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg (accessor, msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+
+    sqlite3_finalize (stmt);
+    return 1;
+
+  error:
+    if (stmt != NULL)
+	sqlite3_finalize (stmt);
+    return 0;
+}
+
+static int
+insert_into_dustbin (sqlite3 * sqlite, const void *cache, sqlite3_stmt * stmt,
+		     sqlite3_stmt * stmt_dustbin, const char *message,
+		     double tolerance, int *count)
+{
+/* failing feature: inserting a reference into the dustbin table */
+    int icol;
+    int maxcol;
+    int ret;
+
+    start_topo_savepoint (sqlite, cache);
+    sqlite3_reset (stmt_dustbin);
+    sqlite3_clear_bindings (stmt_dustbin);
+    maxcol = sqlite3_column_count (stmt);
+    for (icol = 1; icol < maxcol - 1; icol++)
+      {
+	  /* binding column values */
+	  switch (sqlite3_column_type (stmt, icol))
+	    {
+	    case SQLITE_INTEGER:
+		sqlite3_bind_int64 (stmt_dustbin, icol,
+				    sqlite3_column_int64 (stmt, icol));
+		break;
+	    case SQLITE_FLOAT:
+		sqlite3_bind_double (stmt_dustbin, icol,
+				     sqlite3_column_double (stmt, icol));
+		break;
+	    case SQLITE_TEXT:
+		sqlite3_bind_text (stmt_dustbin, icol,
+				   (const char *) sqlite3_column_text (stmt,
+								       icol),
+				   sqlite3_column_bytes (stmt, icol),
+				   SQLITE_STATIC);
+		break;
+	    case SQLITE_BLOB:
+		sqlite3_bind_blob (stmt_dustbin, icol,
+				   sqlite3_column_blob (stmt, icol),
+				   sqlite3_column_bytes (stmt, icol),
+				   SQLITE_STATIC);
+		break;
+	    default:
+		sqlite3_bind_null (stmt_dustbin, icol);
+		break;
+	    }
+      }
+/* binding the error message */
+    maxcol = sqlite3_bind_parameter_count (stmt_dustbin);
+    sqlite3_bind_text (stmt_dustbin, maxcol - 1, message, strlen (message),
+		       SQLITE_STATIC);
+    sqlite3_bind_double (stmt_dustbin, maxcol, tolerance);
+    ret = sqlite3_step (stmt_dustbin);
+
+/* inserting the row into the dustbin table */
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+      {
+	  release_topo_savepoint (sqlite, cache);
+	  *count += 1;
+	  return 1;
+      }
+
+    /* some unexpected error occurred */
+    spatialite_e ("TopoGeo_FromGeoTableExt error: \"%s\"",
+		  sqlite3_errmsg (sqlite));
+    rollback_topo_savepoint (sqlite, cache);
+    return 0;
+}
+
+static int
+do_FromGeoTableExtended_block (GaiaTopologyAccessorPtr accessor,
+			       sqlite3_stmt * stmt, sqlite3_stmt * stmt_dustbin,
+			       double tolerance, int line_max_points,
+			       double max_length, sqlite3_int64 start,
+			       sqlite3_int64 * last, sqlite3_int64 * invalid,
+			       int *dustbin_count, sqlite3_int64 * dustbin_row)
+{
+/* attempting to import a whole block of input features */
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    int ret;
+    int gpkg_amphibious = 0;
+    int gpkg_mode = 0;
+    int totcnt = 0;
+    sqlite3_int64 last_rowid;
+
+    if (topo->cache != NULL)
+      {
+	  struct splite_internal_cache *cache =
+	      (struct splite_internal_cache *) (topo->cache);
+	  gpkg_amphibious = cache->gpkg_amphibious_mode;
+	  gpkg_mode = cache->gpkg_mode;
+      }
+
+    start_topo_savepoint (topo->db_handle, topo->cache);
+
+/* setting up the prepared statement */
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_int64 (stmt, 1, start);
+
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		sqlite3_int64 rowid = sqlite3_column_int64 (stmt, 0);
+		int igeo = sqlite3_column_count (stmt) - 1;	/* geometry always corresponds to the last resultset column */
+		if (rowid == *invalid)
+		  {
+		      /* succesfully recovered a previously failing block */
+		      release_topo_savepoint (topo->db_handle, topo->cache);
+		      *last = last_rowid;
+		      return 1;
+		  }
+		totcnt++;
+		if (totcnt > 256)
+		  {
+		      /* succesfully imported a full block */
+		      release_topo_savepoint (topo->db_handle, topo->cache);
+		      *last = last_rowid;
+		      return 1;
+		  }
+		if (sqlite3_column_type (stmt, igeo) == SQLITE_NULL)
+		  {
+		      last_rowid = rowid;
+		      continue;
+		  }
+		if (sqlite3_column_type (stmt, igeo) == SQLITE_BLOB)
+		  {
+		      const unsigned char *blob =
+			  sqlite3_column_blob (stmt, igeo);
+		      int blob_sz = sqlite3_column_bytes (stmt, igeo);
+		      gaiaGeomCollPtr geom =
+			  gaiaFromSpatiaLiteBlobWkbEx (blob, blob_sz, gpkg_mode,
+						       gpkg_amphibious);
+		      if (geom != NULL)
+			{
+			    gaiatopo_reset_last_error_msg (accessor);
+			    if (!auxtopo_insert_into_topology
+				(accessor, geom, tolerance, line_max_points,
+				 max_length))
+			      {
+				  char *msg;
+				  const char *rt_msg =
+				      gaiaGetRtTopoErrorMsg (topo->cache);
+				  if (rt_msg == NULL)
+				      msg =
+					  sqlite3_mprintf
+					  ("TopoGeo_FromGeoTableExt exception: UNKNOWN reason");
+				  else
+				      msg = sqlite3_mprintf ("%s", rt_msg);
+				  gaiaFreeGeomColl (geom);
+				  rollback_topo_savepoint (topo->db_handle,
+							   topo->cache);
+				  if (!insert_into_dustbin
+				      (topo->db_handle, topo->cache, stmt,
+				       stmt_dustbin, msg, tolerance,
+				       dustbin_count))
+				      goto error;
+				  last_rowid = rowid;
+				  *invalid = rowid;
+				  *dustbin_row =
+				      sqlite3_last_insert_rowid
+				      (topo->db_handle);
+				  return 0;
+			      }
+			    gaiaFreeGeomColl (geom);
+			    last_rowid = rowid;
+			}
+		      else
+			{
+			    rollback_topo_savepoint (topo->db_handle,
+						     topo->cache);
+			    if (!insert_into_dustbin
+				(topo->db_handle, topo->cache, stmt,
+				 stmt_dustbin,
+				 "TopoGeo_FromGeoTableExt error: Invalid Geometry",
+				 tolerance, dustbin_count))
+				goto error;
+			}
+		      last_rowid = rowid;
+		  }
+		else
+		  {
+		      rollback_topo_savepoint (topo->db_handle, topo->cache);
+		      if (!insert_into_dustbin
+			  (topo->db_handle, topo->cache, stmt, stmt_dustbin,
+			   "TopoGeo_FromGeoTableExt error: not a BLOB value",
+			   tolerance, dustbin_count))
+			  goto error;
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf ("TopoGeo_FromGeoTableExt error: \"%s\"",
+				     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg (accessor, msg);
+		sqlite3_free (msg);
+		rollback_topo_savepoint (topo->db_handle, topo->cache);
+		goto error;
+	    }
+      }
+/* eof */
+    release_topo_savepoint (topo->db_handle, topo->cache);
+    return 2;
+
+  error:
+    return -1;
+}
+
+GAIATOPO_DECLARE int
+gaiaTopoGeo_FromGeoTableExtended (GaiaTopologyAccessorPtr accessor,
+				  const char *sql_in, const char *sql_out,
+				  const char *sql_in2, double tolerance,
+				  int line_max_points, double max_length)
+{
+/* attempting to import a whole GeoTable into a Topology-Geometry - Extended mode */
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    sqlite3_stmt *stmt = NULL;
+    sqlite3_stmt *stmt_dustbin = NULL;
+    sqlite3_stmt *stmt_retry = NULL;
+    int ret;
+    int dustbin_count = 0;
+    sqlite3_int64 start = -1;
+    sqlite3_int64 last;
+    sqlite3_int64 invalid = -1;
+    sqlite3_int64 dustbin_row = -1;
+
+    if (topo == NULL)
+	return 0;
+    if (sql_in == NULL)
+	return 0;
+    if (sql_out == NULL)
+	return 0;
+
+/* building the SQL statement */
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql_in, strlen (sql_in), &stmt,
+			    NULL);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg = sqlite3_mprintf ("TopoGeo_FromGeoTableExt error: \"%s\"",
+				       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* building the SQL dustbin statement */
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql_out, strlen (sql_out),
+			    &stmt_dustbin, NULL);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg = sqlite3_mprintf ("TopoGeo_FromGeoTableExt error: \"%s\"",
+				       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* building the SQL retry statement */
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql_in2, strlen (sql_in2),
+			    &stmt_retry, NULL);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg = sqlite3_mprintf ("TopoGeo_FromGeoTableExt error: \"%s\"",
+				       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+    while (1)
+      {
+	  /* main loop: attempting to import a block of features */
+	  ret =
+	      do_FromGeoTableExtended_block (accessor, stmt, stmt_dustbin,
+					     tolerance, line_max_points,
+					     max_length, start, &last, &invalid,
+					     &dustbin_count, &dustbin_row);
+	  if (ret < 0)		/* some unexpected error occurred */
+	      goto error;
+	  if (ret > 1)
+	    {
+		/* eof */
+		break;
+	    }
+	  if (ret == 0)
 	    {
-		char *msg =
-		    sqlite3_mprintf ("TopoGeo_FromGeoTable error: \"%s\"",
-				     sqlite3_errmsg (topo->db_handle));
-		gaiatopo_set_last_error_msg (accessor, msg);
-		sqlite3_free (msg);
-		goto error;
+		/* found a failing feature; recovering */
+		ret =
+		    do_FromGeoTableExtended_block (accessor, stmt, stmt_dustbin,
+						   tolerance, line_max_points,
+						   max_length, start, &last,
+						   &invalid, &dustbin_count,
+						   &dustbin_row);
+		if (ret != 1)
+		    goto error;
+		start = invalid;
+		invalid = -1;
+		dustbin_row = -1;
+		continue;
 	    }
+	  start = last;
+	  invalid = -1;
+	  dustbin_row = -1;
       }
 
     sqlite3_finalize (stmt);
-    return 1;
+    sqlite3_finalize (stmt_dustbin);
+    sqlite3_finalize (stmt_retry);
+    return dustbin_count;
 
   error:
     if (stmt != NULL)
 	sqlite3_finalize (stmt);
-    return 0;
+    if (stmt_dustbin != NULL)
+	sqlite3_finalize (stmt_dustbin);
+    return -1;
 }
 
 GAIATOPO_DECLARE gaiaGeomCollPtr
@@ -6123,6 +6833,365 @@ gaiaTopoGeoUpdateSeeds (GaiaTopologyAccessorPtr accessor, int incremental_mode)
     return 1;
 }
 
+GAIATOPO_DECLARE gaiaGeomCollPtr
+gaiaTopoGeoSnapPointToSeed (GaiaTopologyAccessorPtr accessor,
+			    gaiaGeomCollPtr pt, double distance)
+{
+/* snapping a Point to TopoSeeds */
+    char *sql;
+    char *table;
+    char *xtable;
+    sqlite3_stmt *stmt = NULL;
+    sqlite3_stmt *stmt_snap = NULL;
+    int ret;
+    unsigned char *blob;
+    int blob_size;
+    unsigned char *blob2;
+    int blob_size2;
+    gaiaGeomCollPtr result = NULL;
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    if (topo == NULL)
+	return NULL;
+
+/* preparing the Snap statement */
+    sql = "SELECT ST_Snap(?, ?, ?)";
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt_snap,
+			    NULL);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_SnapPointToSeed() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* preparing the SELECT statement */
+    table = sqlite3_mprintf ("%s_node", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql = sqlite3_mprintf ("SELECT geom "
+			   "FROM \"%s\" WHERE ST_Distance(?, geom) <= ? AND rowid IN "
+			   "(SELECT rowid FROM SpatialIndex WHERE f_table_name = %Q AND search_frame = ST_Buffer(?, ?))",
+			   xtable, table);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_SnapPointToSeed() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* querying Seeds */
+    if (topo->has_z)
+	result = gaiaAllocGeomCollXYZ ();
+    else
+	result = gaiaAllocGeomColl ();
+    result->Srid = pt->Srid;
+    gaiaToSpatiaLiteBlobWkb (pt, &blob, &blob_size);
+    gaiaToSpatiaLiteBlobWkb (pt, &blob2, &blob_size2);
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_blob (stmt, 1, blob, blob_size, free);
+    sqlite3_bind_double (stmt, 2, distance);
+    sqlite3_bind_blob (stmt, 3, blob2, blob_size2, free);
+    sqlite3_bind_double (stmt, 4, distance * 1.2);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		const unsigned char *p_blob = sqlite3_column_blob (stmt, 0);
+		int blobsz = sqlite3_column_bytes (stmt, 0);
+		gaiaGeomCollPtr geom =
+		    gaiaFromSpatiaLiteBlobWkb (p_blob, blobsz);
+		if (geom != NULL)
+		  {
+		      gaiaPointPtr pt = geom->FirstPoint;
+		      while (pt != NULL)
+			{
+			    /* copying all Points into the result Geometry */
+			    if (topo->has_z)
+				gaiaAddPointToGeomCollXYZ (result, pt->X, pt->Y,
+							   pt->Z);
+			    else
+				gaiaAddPointToGeomColl (result, pt->X, pt->Y);
+			    pt = pt->Next;
+			}
+		      gaiaFreeGeomColl (geom);
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf ("TopoGeo_SnapPointToSeed error: \"%s\"",
+				     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
+					     msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+
+    sqlite3_finalize (stmt);
+    stmt = NULL;
+    if (result->FirstPoint == NULL)
+	goto error;
+
+/* Snap */
+    gaiaToSpatiaLiteBlobWkb (pt, &blob, &blob_size);
+    gaiaToSpatiaLiteBlobWkb (result, &blob2, &blob_size2);
+    gaiaFreeGeomColl (result);
+    result = NULL;
+    sqlite3_reset (stmt_snap);
+    sqlite3_clear_bindings (stmt_snap);
+    sqlite3_bind_blob (stmt_snap, 1, blob, blob_size, free);
+    sqlite3_bind_blob (stmt_snap, 2, blob2, blob_size2, free);
+    sqlite3_bind_double (stmt_snap, 3, distance);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt_snap);
+
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		if (sqlite3_column_type (stmt_snap, 0) != SQLITE_NULL)
+		  {
+		      const unsigned char *p_blob =
+			  sqlite3_column_blob (stmt_snap, 0);
+		      int blobsz = sqlite3_column_bytes (stmt_snap, 0);
+		      if (result != NULL)
+			  gaiaFreeGeomColl (result);
+		      result = gaiaFromSpatiaLiteBlobWkb (p_blob, blobsz);
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf ("TopoGeo_SnapPointToSeed error: \"%s\"",
+				     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
+					     msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+    sqlite3_finalize (stmt_snap);
+    stmt_snap = NULL;
+    if (result == NULL)
+	goto error;
+    if (result->FirstLinestring != NULL || result->FirstPolygon != NULL)
+	goto error;
+    if (result->FirstPoint == NULL)
+	goto error;
+    if (result->FirstPoint != result->LastPoint)
+	goto error;
+    return result;
+
+  error:
+    if (stmt != NULL)
+	sqlite3_finalize (stmt);
+    if (stmt_snap != NULL)
+	sqlite3_finalize (stmt_snap);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    return NULL;
+}
+
+GAIATOPO_DECLARE gaiaGeomCollPtr
+gaiaTopoGeoSnapLinestringToSeed (GaiaTopologyAccessorPtr accessor,
+				 gaiaGeomCollPtr ln, double distance)
+{
+/* snapping a Linestring to TopoSeeds */
+    char *sql;
+    char *table;
+    char *xtable;
+    int ret;
+    unsigned char *blob;
+    int blob_size;
+    unsigned char *blob2;
+    int blob_size2;
+    gaiaGeomCollPtr result = NULL;
+    sqlite3_stmt *stmt = NULL;
+    sqlite3_stmt *stmt_snap = NULL;
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    if (topo == NULL)
+	return NULL;
+
+/* preparing the Snap statement */
+    sql = "SELECT ST_Snap(?, ?, ?)";
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt_snap,
+			    NULL);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_SnapLinestringToSeed() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* preparing the SELECT statement */
+    table = sqlite3_mprintf ("%s_seeds", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql = sqlite3_mprintf ("SELECT edge_id, geom "
+			   "FROM \"%s\" WHERE ST_Distance(?, geom) <= ? AND rowid IN "
+			   "(SELECT rowid FROM SpatialIndex WHERE f_table_name = %Q AND search_frame = ST_Buffer(?, ?))",
+			   xtable, table);
+    free (xtable);
+    sqlite3_free (table);
+    ret = sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_SnapLinestringToSeed() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* querying Seeds */
+    if (topo->has_z)
+	result = gaiaAllocGeomCollXYZ ();
+    else
+	result = gaiaAllocGeomColl ();
+    result->Srid = ln->Srid;
+    gaiaToSpatiaLiteBlobWkb (ln, &blob, &blob_size);
+    gaiaToSpatiaLiteBlobWkb (ln, &blob2, &blob_size2);
+    sqlite3_reset (stmt);
+    sqlite3_clear_bindings (stmt);
+    sqlite3_bind_blob (stmt, 1, blob, blob_size, free);
+    sqlite3_bind_double (stmt, 2, distance);
+    sqlite3_bind_blob (stmt, 3, blob2, blob_size2, free);
+    sqlite3_bind_double (stmt, 4, distance * 1.2);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		if (sqlite3_column_type (stmt, 0) != SQLITE_NULL)
+		  {
+		      const unsigned char *p_blob =
+			  sqlite3_column_blob (stmt, 1);
+		      int blobsz = sqlite3_column_bytes (stmt, 1);
+		      gaiaGeomCollPtr geom =
+			  gaiaFromSpatiaLiteBlobWkb (p_blob, blobsz);
+		      if (geom != NULL)
+			{
+			    gaiaPointPtr pt = geom->FirstPoint;
+			    while (pt != NULL)
+			      {
+				  /* copying all Points into the result Geometry */
+				  if (topo->has_z)
+				      gaiaAddPointToGeomCollXYZ (result, pt->X,
+								 pt->Y, pt->Z);
+				  else
+				      gaiaAddPointToGeomColl (result, pt->X,
+							      pt->Y);
+				  pt = pt->Next;
+			      }
+			}
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf
+		    ("TopoGeo_SnapLinestringToSeed error: \"%s\"",
+		     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
+					     msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+
+    sqlite3_finalize (stmt);
+    stmt = NULL;
+    if (result->FirstPoint == NULL)
+	goto error;
+
+/* Snap */
+    gaiaToSpatiaLiteBlobWkb (ln, &blob, &blob_size);
+    gaiaToSpatiaLiteBlobWkb (result, &blob2, &blob_size2);
+    gaiaFreeGeomColl (result);
+    result = NULL;
+    sqlite3_reset (stmt_snap);
+    sqlite3_clear_bindings (stmt_snap);
+    sqlite3_bind_blob (stmt_snap, 1, blob, blob_size, free);
+    sqlite3_bind_blob (stmt_snap, 2, blob2, blob_size2, free);
+    sqlite3_bind_double (stmt_snap, 3, distance);
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt_snap);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		if (sqlite3_column_type (stmt_snap, 0) == SQLITE_BLOB)
+		  {
+		      const unsigned char *p_blob =
+			  sqlite3_column_blob (stmt_snap, 0);
+		      int blobsz = sqlite3_column_bytes (stmt_snap, 0);
+		      if (result != NULL)
+			  gaiaFreeGeomColl (result);
+		      result = gaiaFromSpatiaLiteBlobWkb (p_blob, blobsz);
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf
+		    ("TopoGeo_SnapLinestringToSeed error: \"%s\"",
+		     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
+					     msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+    sqlite3_finalize (stmt_snap);
+    stmt_snap = NULL;
+    if (result == NULL)
+	goto error;
+    if (result->FirstPoint != NULL || result->FirstPolygon != NULL)
+	goto error;
+    if (result->FirstLinestring == NULL)
+	goto error;
+    if (result->FirstLinestring != result->LastLinestring)
+	goto error;
+    return result;
+
+  error:
+    if (stmt != NULL)
+	sqlite3_finalize (stmt);
+    if (stmt_snap != NULL)
+	sqlite3_finalize (stmt_snap);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    return NULL;
+}
+
 static gaiaGeomCollPtr
 make_geom_from_polyg (int srid, gaiaPolygonPtr pg)
 {
@@ -6816,6 +7885,7 @@ do_eval_topogeo_seeds (struct gaia_topology *topo, sqlite3_stmt * stmt_ref,
 				gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
 			    if (geom != NULL)
 			      {
+				  gaiaGeomCollPtr result;
 				  unsigned char *p_blob;
 				  int n_bytes;
 				  int gpkg_mode = 0;
@@ -6826,15 +7896,14 @@ do_eval_topogeo_seeds (struct gaia_topology *topo, sqlite3_stmt * stmt_ref,
 					     *) (topo->cache);
 					gpkg_mode = cache->gpkg_mode;
 				    }
-				  gaiaGeomCollPtr result =
-				      do_eval_topogeo_geom (topo, geom,
-							    stmt_seed_edge,
-							    stmt_seed_face,
-							    stmt_node,
-							    stmt_edge,
-							    stmt_face,
-							    out_type,
-							    tolerance);
+				  result = do_eval_topogeo_geom (topo, geom,
+								 stmt_seed_edge,
+								 stmt_seed_face,
+								 stmt_node,
+								 stmt_edge,
+								 stmt_face,
+								 out_type,
+								 tolerance);
 				  gaiaFreeGeomColl (geom);
 				  if (result != NULL)
 				    {
@@ -6966,7 +8035,8 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     if (ret != SQLITE_OK)
       {
 	  char *msg =
-	      sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"", errMsg);
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       errMsg);
 	  sqlite3_free (errMsg);
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
@@ -7039,7 +8109,8 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     if (ret != SQLITE_OK)
       {
 	  char *msg =
-	      sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"", errMsg);
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       errMsg);
 	  sqlite3_free (errMsg);
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
@@ -7058,8 +8129,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
 	  if (ret != SQLITE_OK)
 	    {
 		char *msg =
-		    sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				     errMsg);
+		    sqlite3_mprintf
+		    ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+		     errMsg);
 		sqlite3_free (errMsg);
 		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
 					     msg);
@@ -7076,9 +8148,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     select = NULL;
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7092,9 +8164,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     insert = NULL;
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7115,9 +8187,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7138,9 +8210,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7161,9 +8233,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7188,9 +8260,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7217,9 +8289,9 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
-	  char *msg = sqlite3_mprintf ("TopoGeo_ToGeoTable() error: \"%s\"",
-				       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_ToGeoTableGeneralize() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
 	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -7264,6 +8336,290 @@ gaiaTopoGeo_ToGeoTableGeneralize (GaiaTopologyAccessorPtr accessor,
     return 0;
 }
 
+static int
+do_remove_small_faces2 (struct gaia_topology *topo, sqlite3_int64 edge_id,
+			sqlite3_stmt * stmt_rem)
+{
+/* removing an Edge from a Face (step 2) */
+    int ret;
+    sqlite3_reset (stmt_rem);
+    sqlite3_clear_bindings (stmt_rem);
+    sqlite3_bind_int64 (stmt_rem, 1, edge_id);
+
+    ret = sqlite3_step (stmt_rem);
+    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+	return 1;
+    else
+      {
+	  char *msg = sqlite3_mprintf ("TopoGeo_RemoveSmallFaces error: \"%s\"",
+				       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+      }
+    return 0;
+}
+
+static int
+do_remove_small_faces1 (struct gaia_topology *topo, sqlite3_int64 face_id,
+			sqlite3_stmt * stmt_edge, sqlite3_stmt * stmt_rem)
+{
+/* removing the longer Edge from a Face (step 1) */
+    int ret;
+    int first = 1;
+    sqlite3_reset (stmt_edge);
+    sqlite3_clear_bindings (stmt_edge);
+    sqlite3_bind_int64 (stmt_edge, 1, face_id);
+    sqlite3_bind_int64 (stmt_edge, 2, face_id);
+
+    while (1)
+      {
+	  /* scrolling the result set rows */
+	  ret = sqlite3_step (stmt_edge);
+	  if (ret == SQLITE_DONE)
+	      break;		/* end of result set */
+	  if (ret == SQLITE_ROW)
+	    {
+		sqlite3_int64 edge_id = sqlite3_column_int64 (stmt_edge, 0);
+		if (first)
+		  {
+		      first = 0;
+		      if (do_remove_small_faces2 (topo, edge_id, stmt_rem))
+			  goto error;
+		  }
+	    }
+	  else
+	    {
+		char *msg =
+		    sqlite3_mprintf ("TopoGeo_RemoveSmallFaces error: \"%s\"",
+				     sqlite3_errmsg (topo->db_handle));
+		gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo,
+					     msg);
+		sqlite3_free (msg);
+		goto error;
+	    }
+      }
+    return 1;
+
+  error:
+    return 0;
+
+}
+
+GAIATOPO_DECLARE int
+gaiaTopoGeo_RemoveSmallFaces (GaiaTopologyAccessorPtr accessor, double min_area)
+{
+/* 
+/ attempting to remove all small faces from a Topology-Geometry 
+*/
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    sqlite3_stmt *stmt_rem = NULL;
+    sqlite3_stmt *stmt_face = NULL;
+    sqlite3_stmt *stmt_edge = NULL;
+    int ret;
+    char *sql;
+    char *table;
+    char *xtable;
+    int count;
+    if (topo == NULL)
+	return 0;
+
+/* preparing the SELECT Face query */
+    table = sqlite3_mprintf ("%s_face", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sqlite3_free (table);
+    sql = sqlite3_mprintf ("SELECT face_id FROM MAIN.\"%s\" WHERE face_id > 0 "
+			   "AND ST_Area(ST_GetFaceGeometry(%Q, face_id)) < ?",
+			   xtable, topo->topology_name);
+    free (xtable);
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt_face,
+			    NULL);
+    sqlite3_free (sql);
+    sql = NULL;
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_RemoveSmallFaces() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* preparing the SELECT Edge query */
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sqlite3_free (table);
+    sql =
+	sqlite3_mprintf ("SELECT edge_id FROM MAIN.\"%s\" WHERE right_face = ? "
+			 "OR left_face = ? ORDER BY ST_Length(geom) DESC",
+			 xtable);
+    free (xtable);
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt_edge,
+			    NULL);
+    sqlite3_free (sql);
+    sql = NULL;
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_RemoveSmallFaces() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+/* preparing the ST_RemEdgeNewFace() query */
+    sql =
+	sqlite3_mprintf ("SELECT ST_RemEdgeNewFace(%Q, ?)",
+			 topo->topology_name);
+    ret =
+	sqlite3_prepare_v2 (topo->db_handle, sql, strlen (sql), &stmt_rem,
+			    NULL);
+    sqlite3_free (sql);
+    sql = NULL;
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_RemoveSmallFaces() error: \"%s\"",
+			       sqlite3_errmsg (topo->db_handle));
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (msg);
+	  goto error;
+      }
+
+    count = 1;
+    while (count)
+      {
+	  sqlite3_reset (stmt_face);
+	  sqlite3_clear_bindings (stmt_face);
+	  sqlite3_bind_double (stmt_face, 1, min_area);
+	  count = 0;
+	  while (1)
+	    {
+		/* scrolling the result set rows */
+		ret = sqlite3_step (stmt_face);
+		if (ret == SQLITE_DONE)
+		    break;	/* end of result set */
+		if (ret == SQLITE_ROW)
+		  {
+		      sqlite3_int64 face_id =
+			  sqlite3_column_int64 (stmt_face, 0);
+		      if (do_remove_small_faces1
+			  (topo, face_id, stmt_edge, stmt_rem))
+			  goto error;
+		      count++;
+		  }
+		else
+		  {
+		      char *msg =
+			  sqlite3_mprintf
+			  ("TopoGeo_RemoveSmallFaces error: \"%s\"",
+			   sqlite3_errmsg (topo->db_handle));
+		      gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr)
+						   topo, msg);
+		      sqlite3_free (msg);
+		      goto error;
+		  }
+	    }
+      }
+
+    sqlite3_finalize (stmt_face);
+    sqlite3_finalize (stmt_edge);
+    sqlite3_finalize (stmt_rem);
+    return 1;
+
+  error:
+    if (sql != NULL)
+	sqlite3_free (sql);
+    if (stmt_face != NULL)
+	sqlite3_finalize (stmt_face);
+    if (stmt_edge != NULL)
+	sqlite3_finalize (stmt_edge);
+    if (stmt_rem != NULL)
+	sqlite3_finalize (stmt_rem);
+    return 0;
+}
+
+GAIATOPO_DECLARE int
+gaiaTopoGeo_RemoveDanglingEdges (GaiaTopologyAccessorPtr accessor)
+{
+/* 
+/ attempting to remove all dangling edges from a Topology-Geometry 
+*/
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    int ret;
+    char *sql;
+    char *table;
+    char *xtable;
+    char *err_msg = NULL;
+    if (topo == NULL)
+	return 0;
+
+/* preparing the ST_RemEdgeNewFace() query */
+    table = sqlite3_mprintf ("%s_edge", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sqlite3_free (table);
+    sql =
+	sqlite3_mprintf
+	("SELECT ST_RemEdgeNewFace(%Q, edge_id) FROM MAIN.\"%s\" "
+	 "WHERE left_face = right_face", topo->topology_name, xtable);
+    free (xtable);
+    ret = sqlite3_exec (topo->db_handle, sql, NULL, NULL, &err_msg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_RemoveDanglingEdges error: \"%s\"",
+			       err_msg);
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (err_msg);
+	  sqlite3_free (msg);
+	  return 0;
+      }
+    return 1;
+}
+
+GAIATOPO_DECLARE int
+gaiaTopoGeo_RemoveDanglingNodes (GaiaTopologyAccessorPtr accessor)
+{
+/* 
+/ attempting to remove all dangling nodes from a Topology-Geometry 
+*/
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    int ret;
+    char *sql;
+    char *table;
+    char *xtable;
+    char *err_msg = NULL;
+    if (topo == NULL)
+	return 0;
+
+/* preparing the ST_RemIsoNode() query */
+    table = sqlite3_mprintf ("%s_node", topo->topology_name);
+    xtable = gaiaDoubleQuotedSql (table);
+    sqlite3_free (table);
+    sql =
+	sqlite3_mprintf ("SELECT ST_RemIsoNode(%Q, node_id) FROM MAIN.\"%s\" "
+			 "WHERE containing_face IS NOT NULL",
+			 topo->topology_name, xtable);
+    free (xtable);
+    ret = sqlite3_exec (topo->db_handle, sql, NULL, NULL, &err_msg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  char *msg =
+	      sqlite3_mprintf ("TopoGeo_RemoveDanglingNodes error: \"%s\"",
+			       err_msg);
+	  gaiatopo_set_last_error_msg ((GaiaTopologyAccessorPtr) topo, msg);
+	  sqlite3_free (err_msg);
+	  sqlite3_free (msg);
+	  return 0;
+      }
+    return 1;
+}
+
 GAIATOPO_DECLARE int
 gaiaTopoGeo_ToGeoTable (GaiaTopologyAccessorPtr accessor,
 			const char *db_prefix, const char *ref_table,
@@ -7423,6 +8779,7 @@ auxtopo_polygonize_face_edges (struct face_edges *list, const void *cache)
 /* attempting to reaggregrate Polygons from valid Edges */
     gaiaGeomCollPtr sparse;
     gaiaGeomCollPtr rearranged;
+    struct face_edge_item *fe;
 
     if (list->has_z)
 	sparse = gaiaAllocGeomCollXYZ ();
@@ -7430,7 +8787,7 @@ auxtopo_polygonize_face_edges (struct face_edges *list, const void *cache)
 	sparse = gaiaAllocGeomColl ();
     sparse->Srid = list->srid;
 
-    struct face_edge_item *fe = list->first_edge;
+    fe = list->first_edge;
     while (fe != NULL)
       {
 	  if (fe->count < 2)
@@ -7461,6 +8818,7 @@ auxtopo_polygonize_face_edges_generalize (struct face_edges * list,
     gaiaGeomCollPtr sparse;
     gaiaGeomCollPtr renoded;
     gaiaGeomCollPtr rearranged;
+    struct face_edge_item *fe;
 
     if (list->has_z)
 	sparse = gaiaAllocGeomCollXYZ ();
@@ -7468,7 +8826,7 @@ auxtopo_polygonize_face_edges_generalize (struct face_edges * list,
 	sparse = gaiaAllocGeomColl ();
     sparse->Srid = list->srid;
 
-    struct face_edge_item *fe = list->first_edge;
+    fe = list->first_edge;
     while (fe != NULL)
       {
 	  if (fe->count < 2)
@@ -7486,7 +8844,7 @@ auxtopo_polygonize_face_edges_generalize (struct face_edges * list,
 	    }
 	  fe = fe->next;
       }
-    renoded = gaiaNodeLines (sparse);
+    renoded = gaiaNodeLines (cache, sparse);
     gaiaFreeGeomColl (sparse);
     if (renoded == NULL)
 	return NULL;
@@ -7957,8 +9315,8 @@ auxtopo_create_features_sql (sqlite3 * db_handle, const char *db_prefix,
 		name = results[(i * columns) + 1];
 		type = results[(i * columns) + 2];
 		notnull = atoi (results[(i * columns) + 3]);
-		if (strcasecmp(name, "fid") == 0)
-		continue;
+		if (strcasecmp (name, "fid") == 0)
+		    continue;
 		if (is_geometry_column (db_handle, db_prefix, ref_table, name))
 		    continue;
 		if (ref_column != NULL)
@@ -8588,7 +9946,6 @@ gaiaTopoGeo_CreateTopoLayer (GaiaTopologyAccessorPtr accessor,
 	  char *msg =
 	      sqlite3_mprintf ("TopoGeo_CreateTopoLayer() error: \"%s\"",
 			       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -8612,7 +9969,6 @@ gaiaTopoGeo_CreateTopoLayer (GaiaTopologyAccessorPtr accessor,
 	  char *msg =
 	      sqlite3_mprintf ("TopoGeo_CreateTopoLayer() error: \"%s\"",
 			       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -8636,7 +9992,6 @@ gaiaTopoGeo_CreateTopoLayer (GaiaTopologyAccessorPtr accessor,
 	  char *msg =
 	      sqlite3_mprintf ("TopoGeo_CreateTopoLayer() error: \"%s\"",
 			       sqlite3_errmsg (topo->db_handle));
-	  sqlite3_free (errMsg);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_free (msg);
 	  goto error;
@@ -9534,9 +10889,9 @@ do_eval_topo_geometry (struct gaia_topology *topo, sqlite3_stmt * stmt_rels,
     if (list->first_edge != NULL)
       {
 	  /* attempting to rearrange sparse lines into Polygons */
+	  gaiaGeomCollPtr rearranged;
 	  auxtopo_select_valid_face_edges (list);
-	  gaiaGeomCollPtr rearranged =
-	      auxtopo_polygonize_face_edges (list, topo->cache);
+	  rearranged = auxtopo_polygonize_face_edges (list, topo->cache);
 	  auxtopo_free_face_edges (list);
 	  if (rearranged != NULL)
 	    {
@@ -10504,4 +11859,4 @@ gaiaTopoGeo_InsertFeatureFromTopoLayer (GaiaTopologyAccessorPtr accessor,
     return 0;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end ENABLE_RTTOPO conditionals */
diff --git a/src/topology/gaia_netstmts.c b/src/topology/gaia_netstmts.c
index 6488230..88d6de2 100644
--- a/src/topology/gaia_netstmts.c
+++ b/src/topology/gaia_netstmts.c
@@ -53,7 +53,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -63,6 +63,8 @@ the terms of any one of the MPL, the GPL or the LGPL.
 
 #include <spatialite_private.h>
 
+#include <librttopo.h>
+
 #include <lwn_network.h>
 
 #include "network_private.h"
@@ -375,4 +377,4 @@ do_create_stmt_deleteLinksById (GaiaNetworkAccessorPtr accessor)
     return stmt;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/gaia_network.c b/src/topology/gaia_network.c
index a6781fc..8472b26 100644
--- a/src/topology/gaia_network.c
+++ b/src/topology/gaia_network.c
@@ -53,7 +53,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -65,16 +65,44 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include <spatialite.h>
 #include <spatialite_private.h>
 
+#include <librttopo.h>
 #include <lwn_network.h>
 
 #include "network_private.h"
-
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
 #include "topology_private.h"
 
 #define GAIA_UNUSED() if (argc || argv) argc = argc;
 
+static struct splite_savepoint *
+push_net_savepoint (struct splite_internal_cache *cache)
+{
+/* adding a new SavePoint to the Network stack */
+    struct splite_savepoint *p_svpt = malloc (sizeof (struct splite_savepoint));
+    p_svpt->savepoint_name = NULL;
+    p_svpt->prev = cache->last_net_svpt;
+    p_svpt->next = NULL;
+    if (cache->first_net_svpt == NULL)
+	cache->first_net_svpt = p_svpt;
+    if (cache->last_net_svpt != NULL)
+	cache->last_net_svpt->next = p_svpt;
+    cache->last_net_svpt = p_svpt;
+    return p_svpt;
+}
+
+static void
+pop_net_savepoint (struct splite_internal_cache *cache)
+{
+/* removing a SavePoint from the Network stack */
+    struct splite_savepoint *p_svpt = cache->last_net_svpt;
+    if (p_svpt->prev != NULL)
+	p_svpt->prev->next = NULL;
+    cache->last_net_svpt = p_svpt->prev;
+    if (cache->first_net_svpt == p_svpt)
+	cache->first_net_svpt = NULL;
+    if (p_svpt->savepoint_name != NULL)
+	sqlite3_free (p_svpt->savepoint_name);
+    free (p_svpt);
+}
 
 SPATIALITE_PRIVATE void
 start_net_savepoint (const void *handle, const void *data)
@@ -83,16 +111,15 @@ start_net_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
 
 /* creating an unique SavePoint name */
-    if (cache->network_savepoint_name != NULL)
-	sqlite3_free (cache->network_savepoint_name);
-    cache->network_savepoint_name = NULL;
-    cache->network_savepoint_name =
+    p_svpt = push_net_savepoint (cache);
+    p_svpt->savepoint_name =
 	sqlite3_mprintf ("netsvpt%04x", cache->next_network_savepoint);
     if (cache->next_network_savepoint >= 0xffffffffu)
 	cache->next_network_savepoint = 0;
@@ -100,7 +127,7 @@ start_net_savepoint (const void *handle, const void *data)
 	cache->next_network_savepoint += 1;
 
 /* starting a SavePoint */
-    sql = sqlite3_mprintf ("SAVEPOINT %s", cache->network_savepoint_name);
+    sql = sqlite3_mprintf ("SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -117,16 +144,19 @@ release_net_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
-    if (cache->network_savepoint_name == NULL)
+    p_svpt = cache->last_net_svpt;
+    if (p_svpt == NULL)
+	return;
+    if (p_svpt->savepoint_name == NULL)
 	return;
 
 /* releasing the current SavePoint */
-    sql =
-	sqlite3_mprintf ("RELEASE SAVEPOINT %s", cache->network_savepoint_name);
+    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -134,8 +164,7 @@ release_net_savepoint (const void *handle, const void *data)
 	  sqlite3_free (err_msg);
       }
     sqlite3_free (sql);
-    sqlite3_free (cache->network_savepoint_name);
-    cache->network_savepoint_name = NULL;
+    pop_net_savepoint (cache);
 }
 
 SPATIALITE_PRIVATE void
@@ -145,17 +174,19 @@ rollback_net_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
-    if (cache->network_savepoint_name == NULL)
+    p_svpt = cache->last_net_svpt;
+    if (p_svpt == NULL)
+	return;
+    if (p_svpt->savepoint_name == NULL)
 	return;
 
 /* rolling back the current SavePoint */
-    sql =
-	sqlite3_mprintf ("ROLLBACK TO SAVEPOINT %s",
-			 cache->network_savepoint_name);
+    sql = sqlite3_mprintf ("ROLLBACK TO SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -164,8 +195,7 @@ rollback_net_savepoint (const void *handle, const void *data)
       }
     sqlite3_free (sql);
 /* releasing the current SavePoint */
-    sql =
-	sqlite3_mprintf ("RELEASE SAVEPOINT %s", cache->network_savepoint_name);
+    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -173,8 +203,7 @@ rollback_net_savepoint (const void *handle, const void *data)
 	  sqlite3_free (err_msg);
       }
     sqlite3_free (sql);
-    sqlite3_free (cache->network_savepoint_name);
-    cache->network_savepoint_name = NULL;
+    pop_net_savepoint (cache);
 }
 
 SPATIALITE_PRIVATE void
@@ -4186,4 +4215,4 @@ fnctaux_TopoNet_UpdateSeeds (const void *xcontext, int argc, const void *xargv)
     return;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/gaia_topology.c b/src/topology/gaia_topology.c
index 7174db4..ea264d0 100644
--- a/src/topology/gaia_topology.c
+++ b/src/topology/gaia_topology.c
@@ -65,7 +65,7 @@ CIG: 6038019AE5
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -76,13 +76,123 @@ CIG: 6038019AE5
 #include <spatialite.h>
 #include <spatialite_private.h>
 
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
+#include <librttopo.h>
 
 #include "topology_private.h"
 
 #define GAIA_UNUSED() if (argc || argv) argc = argc;
 
+struct pk_item
+{
+/* an helper struct for a primary key column */
+    char *name;
+    char *type;
+    int notnull;
+    int pk;
+    struct pk_item *next;
+};
+
+struct pk_struct
+{
+/* an helper struct for cloning dustbin primary keys */
+    struct pk_item *first;
+    struct pk_item *last;
+    int count;
+};
+
+static struct pk_struct *
+create_pk_dictionary (void)
+{
+/* creating an empty PK dictionary */
+    struct pk_struct *pk = malloc (sizeof (struct pk_struct));
+    pk->first = NULL;
+    pk->last = NULL;
+    pk->count = 0;
+    return pk;
+}
+
+static void
+free_pk_dictionary (struct pk_struct *pk)
+{
+/* memory cleanup - freeing a PK dictionary */
+    struct pk_item *pI;
+    struct pk_item *pIn;
+    if (pk == NULL)
+	return;
+    pI = pk->first;
+    while (pI != NULL)
+      {
+	  pIn = pI->next;
+	  if (pI->name != NULL)
+	      free (pI->name);
+	  if (pI->type != NULL)
+	      free (pI->type);
+	  free (pI);
+	  pI = pIn;
+      }
+    free (pk);
+}
+
+static void
+add_pk_column (struct pk_struct *pk, const char *name, const char *type,
+	       int notnull, int pk_pos)
+{
+/* adding a PK column into a dictionary */
+    int len;
+    struct pk_item *pI;
+    if (pk == NULL)
+	return;
+    if (name == NULL || type == NULL)
+	return;
+    pI = malloc (sizeof (struct pk_item));
+    len = strlen (name);
+    pI->name = malloc (len + 1);
+    strcpy (pI->name, name);
+    len = strlen (type);
+    pI->type = malloc (len + 1);
+    strcpy (pI->type, type);
+    pI->notnull = notnull;
+    pI->pk = pk_pos;
+    pI->next = NULL;
+/* inserting into the PK dictionary linked list */
+    if (pk->first == NULL)
+	pk->first = pI;
+    if (pk->last != NULL)
+	pk->last->next = pI;
+    pk->last = pI;
+    pk->count += 1;
+}
+
+static struct splite_savepoint *
+push_topo_savepoint (struct splite_internal_cache *cache)
+{
+/* adding a new SavePoint to the Topology stack */
+    struct splite_savepoint *p_svpt = malloc (sizeof (struct splite_savepoint));
+    p_svpt->savepoint_name = NULL;
+    p_svpt->prev = cache->last_topo_svpt;
+    p_svpt->next = NULL;
+    if (cache->first_topo_svpt == NULL)
+	cache->first_topo_svpt = p_svpt;
+    if (cache->last_topo_svpt != NULL)
+	cache->last_topo_svpt->next = p_svpt;
+    cache->last_topo_svpt = p_svpt;
+    return p_svpt;
+}
+
+static void
+pop_topo_savepoint (struct splite_internal_cache *cache)
+{
+/* removing a SavePoint from the Topology stack */
+    struct splite_savepoint *p_svpt = cache->last_topo_svpt;
+    if (p_svpt->prev != NULL)
+	p_svpt->prev->next = NULL;
+    cache->last_topo_svpt = p_svpt->prev;
+    if (cache->first_topo_svpt == p_svpt)
+	cache->first_topo_svpt = NULL;
+    if (p_svpt->savepoint_name != NULL)
+	sqlite3_free (p_svpt->savepoint_name);
+    free (p_svpt);
+}
 
 SPATIALITE_PRIVATE void
 start_topo_savepoint (const void *handle, const void *data)
@@ -91,16 +201,15 @@ start_topo_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
 
 /* creating an unique SavePoint name */
-    if (cache->topo_savepoint_name != NULL)
-	sqlite3_free (cache->topo_savepoint_name);
-    cache->topo_savepoint_name = NULL;
-    cache->topo_savepoint_name =
+    p_svpt = push_topo_savepoint (cache);
+    p_svpt->savepoint_name =
 	sqlite3_mprintf ("toposvpt%04x", cache->next_topo_savepoint);
     if (cache->next_topo_savepoint >= 0xffffffffu)
 	cache->next_topo_savepoint = 0;
@@ -108,7 +217,7 @@ start_topo_savepoint (const void *handle, const void *data)
 	cache->next_topo_savepoint += 1;
 
 /* starting a SavePoint */
-    sql = sqlite3_mprintf ("SAVEPOINT %s", cache->topo_savepoint_name);
+    sql = sqlite3_mprintf ("SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -125,15 +234,19 @@ release_topo_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
-    if (cache->topo_savepoint_name == NULL)
+    p_svpt = cache->last_topo_svpt;
+    if (p_svpt == NULL)
+	return;
+    if (p_svpt->savepoint_name == NULL)
 	return;
 
 /* releasing the current SavePoint */
-    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", cache->topo_savepoint_name);
+    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -141,8 +254,7 @@ release_topo_savepoint (const void *handle, const void *data)
 	  sqlite3_free (err_msg);
       }
     sqlite3_free (sql);
-    sqlite3_free (cache->topo_savepoint_name);
-    cache->topo_savepoint_name = NULL;
+    pop_topo_savepoint (cache);
 }
 
 SPATIALITE_PRIVATE void
@@ -152,17 +264,19 @@ rollback_topo_savepoint (const void *handle, const void *data)
     char *sql;
     int ret;
     char *err_msg;
+    struct splite_savepoint *p_svpt;
     sqlite3 *sqlite = (sqlite3 *) handle;
     struct splite_internal_cache *cache = (struct splite_internal_cache *) data;
     if (sqlite == NULL || cache == NULL)
 	return;
-    if (cache->topo_savepoint_name == NULL)
+    p_svpt = cache->last_topo_svpt;
+    if (p_svpt == NULL)
+	return;
+    if (p_svpt->savepoint_name == NULL)
 	return;
 
 /* rolling back the current SavePoint */
-    sql =
-	sqlite3_mprintf ("ROLLBACK TO SAVEPOINT %s",
-			 cache->topo_savepoint_name);
+    sql = sqlite3_mprintf ("ROLLBACK TO SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -171,7 +285,7 @@ rollback_topo_savepoint (const void *handle, const void *data)
       }
     sqlite3_free (sql);
 /* releasing the current SavePoint */
-    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", cache->topo_savepoint_name);
+    sql = sqlite3_mprintf ("RELEASE SAVEPOINT %s", p_svpt->savepoint_name);
     ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
@@ -179,8 +293,7 @@ rollback_topo_savepoint (const void *handle, const void *data)
 	  sqlite3_free (err_msg);
       }
     sqlite3_free (sql);
-    sqlite3_free (cache->topo_savepoint_name);
-    cache->topo_savepoint_name = NULL;
+    pop_topo_savepoint (cache);
 }
 
 SPATIALITE_PRIVATE void
@@ -371,6 +484,7 @@ fnctaux_AddIsoNode (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Node on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 face_id;
@@ -379,7 +493,7 @@ fnctaux_AddIsoNode (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr point = NULL;
     gaiaPointPtr pt;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -437,12 +551,12 @@ fnctaux_AddIsoNode (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, point->Srid, point->DimensionModel))
 	goto invalid_geom;
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaAddIsoNode (accessor, face_id, pt, 0);
     if (ret <= 0)
@@ -453,7 +567,7 @@ fnctaux_AddIsoNode (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -464,31 +578,34 @@ fnctaux_AddIsoNode (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -501,6 +618,7 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 / returns: TEXT (description of new location)
 / raises an exception on failure
 */
+    const char *msg;
     char xid[80];
     char *newpos = NULL;
     int ret;
@@ -511,7 +629,7 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr point = NULL;
     gaiaPointPtr pt;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -565,6 +683,7 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, point->Srid, point->DimensionModel))
 	goto invalid_geom;
@@ -574,7 +693,6 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 	sqlite3_mprintf ("Isolated Node %s moved to location %f,%f", xid, pt->X,
 			 pt->Y);
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaMoveIsoNode (accessor, node_id, pt);
     if (!ret)
@@ -585,7 +703,7 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  if (newpos != NULL)
 	      sqlite3_free (newpos);
@@ -600,9 +718,9 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
@@ -610,8 +728,9 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
@@ -619,8 +738,9 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
@@ -628,9 +748,10 @@ fnctaux_MoveIsoNode (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -643,12 +764,13 @@ fnctaux_RemIsoNode (const void *xcontext, int argc, const void *xargv)
 / returns: TEXT (description of operation)
 / raises an exception on failure
 */
+    const char *msg;
     char xid[80];
     char *newpos = NULL;
     int ret;
     const char *topo_name;
     sqlite3_int64 node_id;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -671,10 +793,10 @@ fnctaux_RemIsoNode (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     sprintf (xid, "%lld", node_id);
     newpos = sqlite3_mprintf ("Isolated Node %s removed", xid);
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaRemIsoNode (accessor, node_id);
     if (!ret)
@@ -683,7 +805,7 @@ fnctaux_RemIsoNode (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  if (newpos != NULL)
 	      sqlite3_free (newpos);
@@ -696,23 +818,25 @@ fnctaux_RemIsoNode (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -725,6 +849,7 @@ fnctaux_AddIsoEdge (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Edge on success, 0 on failure
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     sqlite3_int64 start_node_id;
@@ -734,7 +859,7 @@ fnctaux_AddIsoEdge (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr line = NULL;
     gaiaLinestringPtr ln;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -795,11 +920,11 @@ fnctaux_AddIsoEdge (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims (accessor, line->Srid, line->DimensionModel))
 	goto invalid_geom;
     ln = line->FirstLinestring;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaAddIsoEdge (accessor, start_node_id, end_node_id, ln);
     if (ret <= 0)
@@ -810,7 +935,7 @@ fnctaux_AddIsoEdge (const void *xcontext, int argc, const void *xargv)
     line = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -829,23 +954,26 @@ fnctaux_AddIsoEdge (const void *xcontext, int argc, const void *xargv)
   null_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -858,12 +986,13 @@ fnctaux_RemIsoEdge (const void *xcontext, int argc, const void *xargv)
 / returns: TEXT (description of operation)
 / raises an exception on failure
 */
+    const char *msg;
     char xid[80];
     char *newpos = NULL;
     int ret;
     const char *topo_name;
     sqlite3_int64 edge_id;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -886,10 +1015,10 @@ fnctaux_RemIsoEdge (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     sprintf (xid, "%lld", edge_id);
     newpos = sqlite3_mprintf ("Isolated Edge %s removed", xid);
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaRemIsoEdge (accessor, edge_id);
     if (!ret)
@@ -898,7 +1027,7 @@ fnctaux_RemIsoEdge (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  if (newpos != NULL)
 	      sqlite3_free (newpos);
@@ -911,23 +1040,25 @@ fnctaux_RemIsoEdge (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (newpos != NULL)
 	sqlite3_free (newpos);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -940,10 +1071,11 @@ fnctaux_RemEdgeModFace (const void *xcontext, int argc, const void *xargv)
 / returns: ID of the Face that takes up the space previously occupied by the removed edge
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -966,8 +1098,8 @@ fnctaux_RemEdgeModFace (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     start_topo_savepoint (sqlite, cache);
     ret = gaiaRemEdgeModFace (accessor, edge_id);
     if (ret < 0)
@@ -976,7 +1108,7 @@ fnctaux_RemEdgeModFace (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -985,19 +1117,21 @@ fnctaux_RemEdgeModFace (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1010,10 +1144,11 @@ fnctaux_RemEdgeNewFace (const void *xcontext, int argc, const void *xargv)
 / returns: ID of the created Face 
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -1036,8 +1171,8 @@ fnctaux_RemEdgeNewFace (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     start_topo_savepoint (sqlite, cache);
     ret = gaiaRemEdgeNewFace (accessor, edge_id);
     if (ret < 0)
@@ -1046,7 +1181,7 @@ fnctaux_RemEdgeNewFace (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1055,19 +1190,21 @@ fnctaux_RemEdgeNewFace (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1080,6 +1217,7 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
 / returns: TEXT (description of operation)
 / raises an exception on failure
 */
+    const char *msg;
     char xid[80];
     char *newpos = NULL;
     int ret;
@@ -1090,7 +1228,7 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr line = NULL;
     gaiaLinestringPtr ln;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -1145,13 +1283,13 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims (accessor, line->Srid, line->DimensionModel))
 	goto invalid_geom;
     ln = line->FirstLinestring;
     sprintf (xid, "%lld", edge_id);
     newpos = sqlite3_mprintf ("Edge %s changed", xid);
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaChangeEdgeGeom (accessor, edge_id, ln);
     if (!ret)
@@ -1162,7 +1300,7 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
     line = NULL;
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  if (newpos != NULL)
 	      sqlite3_free (newpos);
@@ -1177,9 +1315,9 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
@@ -1187,8 +1325,9 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
@@ -1196,8 +1335,9 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
@@ -1205,9 +1345,10 @@ fnctaux_ChangeEdgeGeom (const void *xcontext, int argc, const void *xargv)
 	sqlite3_free (newpos);
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1220,6 +1361,7 @@ fnctaux_ModEdgeSplit (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Node on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id;
@@ -1228,7 +1370,7 @@ fnctaux_ModEdgeSplit (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr point = NULL;
     gaiaPointPtr pt;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -1282,12 +1424,12 @@ fnctaux_ModEdgeSplit (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, point->Srid, point->DimensionModel))
 	goto invalid_geom;
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaModEdgeSplit (accessor, edge_id, pt, 0);
     if (ret <= 0)
@@ -1298,7 +1440,7 @@ fnctaux_ModEdgeSplit (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1309,31 +1451,34 @@ fnctaux_ModEdgeSplit (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1346,6 +1491,7 @@ fnctaux_NewEdgesSplit (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Node on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id;
@@ -1354,7 +1500,7 @@ fnctaux_NewEdgesSplit (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr point = NULL;
     gaiaPointPtr pt;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -1411,12 +1557,12 @@ fnctaux_NewEdgesSplit (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, point->Srid, point->DimensionModel))
 	goto invalid_geom;
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaNewEdgesSplit (accessor, edge_id, pt, 0);
     if (ret <= 0)
@@ -1427,7 +1573,7 @@ fnctaux_NewEdgesSplit (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1438,31 +1584,34 @@ fnctaux_NewEdgesSplit (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1475,6 +1624,7 @@ fnctaux_AddEdgeModFace (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Edge on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 start_node_id;
@@ -1484,7 +1634,7 @@ fnctaux_AddEdgeModFace (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr line = NULL;
     gaiaLinestringPtr ln;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -1545,11 +1695,11 @@ fnctaux_AddEdgeModFace (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims (accessor, line->Srid, line->DimensionModel))
 	goto invalid_geom;
     ln = line->FirstLinestring;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaAddEdgeModFace (accessor, start_node_id, end_node_id, ln, 0);
     if (ret <= 0)
@@ -1560,7 +1710,7 @@ fnctaux_AddEdgeModFace (const void *xcontext, int argc, const void *xargv)
     line = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1571,31 +1721,34 @@ fnctaux_AddEdgeModFace (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1608,6 +1761,7 @@ fnctaux_AddEdgeNewFaces (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of the inserted Edge on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 start_node_id;
@@ -1617,7 +1771,7 @@ fnctaux_AddEdgeNewFaces (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr line = NULL;
     gaiaLinestringPtr ln;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -1678,11 +1832,11 @@ fnctaux_AddEdgeNewFaces (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims (accessor, line->Srid, line->DimensionModel))
 	goto invalid_geom;
     ln = line->FirstLinestring;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaAddEdgeNewFaces (accessor, start_node_id, end_node_id, ln, 0);
     if (ret <= 0)
@@ -1693,7 +1847,7 @@ fnctaux_AddEdgeNewFaces (const void *xcontext, int argc, const void *xargv)
     line = NULL;
     if (ret <= 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1704,31 +1858,34 @@ fnctaux_AddEdgeNewFaces (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (line != NULL)
 	gaiaFreeGeomColl (line);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1741,11 +1898,12 @@ fnctaux_ModEdgeHeal (const void *xcontext, int argc, const void *xargv)
 / returns: ID of the removed Node
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id1;
     sqlite3_int64 edge_id2;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -1774,8 +1932,8 @@ fnctaux_ModEdgeHeal (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     start_topo_savepoint (sqlite, cache);
     ret = gaiaModEdgeHeal (accessor, edge_id1, edge_id2);
     if (ret < 0)
@@ -1784,7 +1942,7 @@ fnctaux_ModEdgeHeal (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1793,19 +1951,21 @@ fnctaux_ModEdgeHeal (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1818,11 +1978,12 @@ fnctaux_NewEdgeHeal (const void *xcontext, int argc, const void *xargv)
 / returns: ID of the removed Node
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     sqlite3_int64 edge_id1;
     sqlite3_int64 edge_id2;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -1851,8 +2012,8 @@ fnctaux_NewEdgeHeal (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     start_topo_savepoint (sqlite, cache);
     ret = gaiaNewEdgeHeal (accessor, edge_id1, edge_id2);
     if (ret < 0)
@@ -1861,7 +2022,7 @@ fnctaux_NewEdgeHeal (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -1870,19 +2031,21 @@ fnctaux_NewEdgeHeal (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1895,12 +2058,13 @@ fnctaux_GetFaceGeometry (const void *xcontext, int argc, const void *xargv)
 / returns: the Face's geometry (Polygon)
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
     sqlite3_int64 face_id;
     unsigned char *p_blob;
     int n_bytes;
     gaiaGeomCollPtr geom;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
@@ -1926,12 +2090,12 @@ fnctaux_GetFaceGeometry (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     geom = gaiaGetFaceGeometry (accessor, face_id);
     if (geom == NULL)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  if (msg != NULL)
 	    {
 		gaiatopo_set_last_error_msg (accessor, msg);
@@ -1950,19 +2114,21 @@ fnctaux_GetFaceGeometry (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -1977,10 +2143,11 @@ fnctaux_GetFaceEdges (const void *xcontext, int argc, const void *xargv)
 / returns NULL on success
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
     sqlite3_int64 face_id;
     int ret;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -2003,8 +2170,8 @@ fnctaux_GetFaceEdges (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
+
     start_topo_savepoint (sqlite, cache);
     ret = gaiaGetFaceEdges (accessor, face_id);
     if (!ret)
@@ -2013,7 +2180,7 @@ fnctaux_GetFaceEdges (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2022,19 +2189,21 @@ fnctaux_GetFaceEdges (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2141,9 +2310,10 @@ fnctaux_ValidateTopoGeo (const void *xcontext, int argc, const void *xargv)
 / returns NULL on success
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
     int ret;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     struct gaia_topology *topo;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
@@ -2161,11 +2331,11 @@ fnctaux_ValidateTopoGeo (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     topo = (struct gaia_topology *) accessor;
     if (check_empty_topology (topo))
 	goto empty;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaValidateTopoGeo (accessor);
     if (!ret)
@@ -2174,7 +2344,7 @@ fnctaux_ValidateTopoGeo (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2183,24 +2353,27 @@ fnctaux_ValidateTopoGeo (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   empty:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - empty topology.", -1);
+    msg = "SQL/MM Spatial exception - empty topology.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2215,6 +2388,7 @@ fnctaux_CreateTopoGeo (const void *xcontext, int argc, const void *xargv)
 / returns NULL on success
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
     int ret;
     const unsigned char *blob;
@@ -2222,7 +2396,7 @@ fnctaux_CreateTopoGeo (const void *xcontext, int argc, const void *xargv)
     gaiaGeomCollPtr geom = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     struct gaia_topology *topo;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
@@ -2259,13 +2433,13 @@ fnctaux_CreateTopoGeo (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     topo = (struct gaia_topology *) accessor;
     if (!check_empty_topology (topo))
 	goto not_empty;
     if (!check_matching_srid_dims (accessor, geom->Srid, geom->DimensionModel))
 	goto invalid_geom;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = auxtopo_insert_into_topology (accessor, geom, 0.0, -1, -1);
     if (!ret)
@@ -2274,7 +2448,7 @@ fnctaux_CreateTopoGeo (const void *xcontext, int argc, const void *xargv)
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2286,45 +2460,50 @@ fnctaux_CreateTopoGeo (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   not_empty:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - non-empty topology.", -1);
+    msg = "SQL/MM Spatial exception - non-empty topology.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   not_geom:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - not a Geometry.", -1);
+    msg = "SQL/MM Spatial exception - not a Geometry.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (geom != NULL)
 	gaiaFreeGeomColl (geom);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid Geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid Geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2337,6 +2516,7 @@ fnctaux_GetNodeByPoint (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of some Node on success, 0 if no Node was found
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     unsigned char *p_blob;
@@ -2345,7 +2525,7 @@ fnctaux_GetNodeByPoint (const void *xcontext, int argc, const void *xargv)
     gaiaPointPtr pt;
     double tolerance;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -2404,9 +2584,9 @@ fnctaux_GetNodeByPoint (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaGetNodeByPoint (accessor, pt, tolerance);
     if (ret < 0)
@@ -2417,7 +2597,7 @@ fnctaux_GetNodeByPoint (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2428,23 +2608,25 @@ fnctaux_GetNodeByPoint (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2457,6 +2639,7 @@ fnctaux_GetEdgeByPoint (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of some Edge on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     unsigned char *p_blob;
@@ -2465,7 +2648,7 @@ fnctaux_GetEdgeByPoint (const void *xcontext, int argc, const void *xargv)
     gaiaPointPtr pt;
     double tolerance;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -2524,9 +2707,9 @@ fnctaux_GetEdgeByPoint (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaGetEdgeByPoint (accessor, pt, tolerance);
     if (ret < 0)
@@ -2537,7 +2720,7 @@ fnctaux_GetEdgeByPoint (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2548,23 +2731,25 @@ fnctaux_GetEdgeByPoint (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2577,6 +2762,7 @@ fnctaux_GetFaceByPoint (const void *xcontext, int argc, const void *xargv)
 / returns: the ID of some Face on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 ret;
     const char *topo_name;
     unsigned char *p_blob;
@@ -2585,7 +2771,7 @@ fnctaux_GetFaceByPoint (const void *xcontext, int argc, const void *xargv)
     gaiaPointPtr pt;
     double tolerance;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -2644,9 +2830,9 @@ fnctaux_GetFaceByPoint (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     pt = point->FirstPoint;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaGetFaceByPoint (accessor, pt, tolerance);
     if (ret < 0)
@@ -2657,7 +2843,7 @@ fnctaux_GetFaceByPoint (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (ret < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -2668,23 +2854,25 @@ fnctaux_GetFaceByPoint (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2697,6 +2885,7 @@ fnctaux_TopoGeo_AddPoint (const void *xcontext, int argc, const void *xargv)
 / returns: a comma separated list of all IDs of corresponding Nodes on success
 / raises an exception on failure
 */
+    const char *msg;
     sqlite3_int64 node_id;
     char xnode_id[64];
     char *retlist = NULL;
@@ -2708,7 +2897,7 @@ fnctaux_TopoGeo_AddPoint (const void *xcontext, int argc, const void *xargv)
     gaiaPointPtr pt;
     double tolerance;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -2767,11 +2956,11 @@ fnctaux_TopoGeo_AddPoint (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, point->Srid, point->DimensionModel))
 	goto invalid_geom;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     pt = point->FirstPoint;
     while (pt != NULL)
@@ -2800,7 +2989,7 @@ fnctaux_TopoGeo_AddPoint (const void *xcontext, int argc, const void *xargv)
     point = NULL;
     if (node_id < 0)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  if (retlist != NULL)
@@ -2813,31 +3002,34 @@ fnctaux_TopoGeo_AddPoint (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (point != NULL)
 	gaiaFreeGeomColl (point);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -2851,6 +3043,7 @@ fnctaux_TopoGeo_AddLineString (const void *xcontext, int argc,
 / returns: a comma separated list of all IDs of corresponding Edges on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     char xedge_id[64];
     sqlite3_int64 *edge_ids = NULL;
@@ -2865,7 +3058,7 @@ fnctaux_TopoGeo_AddLineString (const void *xcontext, int argc,
     gaiaLinestringPtr ln;
     double tolerance;
     int invalid = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
@@ -2924,11 +3117,11 @@ fnctaux_TopoGeo_AddLineString (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
     if (!check_matching_srid_dims
 	(accessor, linestring->Srid, linestring->DimensionModel))
 	goto invalid_geom;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ln = linestring->FirstLinestring;
     while (ln != NULL)
@@ -2963,7 +3156,7 @@ fnctaux_TopoGeo_AddLineString (const void *xcontext, int argc,
     linestring = NULL;
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  sqlite3_free (retlist);
@@ -2975,31 +3168,34 @@ fnctaux_TopoGeo_AddLineString (const void *xcontext, int argc,
   no_topo:
     if (linestring != NULL)
 	gaiaFreeGeomColl (linestring);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (linestring != NULL)
 	gaiaFreeGeomColl (linestring);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (linestring != NULL)
 	gaiaFreeGeomColl (linestring);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
     if (linestring != NULL)
 	gaiaFreeGeomColl (linestring);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid geometry (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -3252,6 +3448,7 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *db_prefix;
@@ -3264,7 +3461,7 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
     double tolerance;
     int line_max_points = -1;
     double max_length = -1.0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -3282,7 +3479,9 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	db_prefix = (const char *) sqlite3_value_text (argv[1]);
     else
 	goto invalid_arg;
-    if (sqlite3_value_type (argv[2]) == SQLITE_TEXT)
+    if (sqlite3_value_type (argv[2]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[2]) == SQLITE_TEXT)
 	table = (const char *) sqlite3_value_text (argv[2]);
     else
 	goto invalid_arg;
@@ -3327,6 +3526,7 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the input GeoTable */
     if (!check_input_geo_table
@@ -3335,7 +3535,6 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
     if (!check_matching_srid_dims (accessor, srid, dims))
 	goto invalid_geom;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_FromGeoTable (accessor, db_prefix, xtable, xcolumn,
@@ -3348,7 +3547,7 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
     free (xcolumn);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -3361,9 +3560,9 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xtable);
     if (xcolumn != NULL)
 	free (xcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   no_input:
@@ -3371,9 +3570,9 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xtable);
     if (xcolumn != NULL)
 	free (xcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid input GeoTable.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid input GeoTable.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
@@ -3381,8 +3580,9 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xtable);
     if (xcolumn != NULL)
 	free (xcolumn);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
@@ -3390,8 +3590,9 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xtable);
     if (xcolumn != NULL)
 	free (xcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
@@ -3399,25 +3600,705 @@ fnctaux_TopoGeo_FromGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xtable);
     if (xcolumn != NULL)
 	free (xcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid GeoTable (mismatching SRID or dimensions).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid GeoTable (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
 static int
-check_matching_srid (GaiaTopologyAccessorPtr accessor, int srid)
+create_dustbin_table (sqlite3 * sqlite, const char *db_prefix,
+		      const char *table, const char *dustbin_table)
 {
-/* checking for matching SRID */
-    struct gaia_topology *topo = (struct gaia_topology *) accessor;
-    if (topo->srid != srid)
-	return 0;
-    return 1;
-}
-
-static int
-check_reference_geo_table (sqlite3 * sqlite, const char *db_prefix,
-			   const char *table, const char *column, char **xtable,
+/* attempting to create a dustbin table */
+    char *xprefix;
+    char *xtable;
+    char *sql;
+    char *prev_sql;
+    int ret;
+    char *err_msg = NULL;
+    int i;
+    char **results;
+    int rows;
+    int columns;
+    const char *value;
+    int error = 0;
+    struct pk_struct *pk_dictionary = NULL;
+    struct pk_item *pI;
+
+/* checking if the target table already exists */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    sql =
+	sqlite3_mprintf
+	("SELECT Count(*) FROM \"%s\".sqlite_master WHERE Lower(name) = Lower(%Q)",
+	 xprefix, dustbin_table);
+    free (xprefix);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return 0;
+    if (rows < 1)
+	;
+    else
+      {
+	  for (i = 1; i <= rows; i++)
+	    {
+		value = results[(i * columns) + 0];
+		if (atoi (value) != 0)
+		    error = 1;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (error)
+      {
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: dustbin-table \"%s\" already exists\n",
+	       dustbin_table);
+	  return 0;
+      }
+
+/* identifying all Primary Key columns */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql = sqlite3_mprintf ("PRAGMA \"%s\".table_info(\"%s\")", xprefix, xtable);
+    free (xprefix);
+    free (xtable);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return 0;
+    pk_dictionary = create_pk_dictionary ();
+    if (rows < 1)
+	;
+    else
+      {
+	  for (i = 1; i <= rows; i++)
+	    {
+		const char *name = results[(i * columns) + 1];
+		const char *type = results[(i * columns) + 2];
+		int notnull = atoi (results[(i * columns) + 3]);
+		int pk = atoi (results[(i * columns) + 5]);
+		if (pk > 0)
+		    add_pk_column (pk_dictionary, name, type, notnull, pk);
+	    }
+      }
+    sqlite3_free_table (results);
+    if (pk_dictionary->count <= 0)
+      {
+	  free_pk_dictionary (pk_dictionary);
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: the input table \"%s\" has no Primary Key\n",
+	       table);
+	  return 0;
+      }
+
+/* going to create the dustbin table */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (dustbin_table);
+    sql = sqlite3_mprintf ("CREATE TABLE \"%s\".\"%s\" (\n", xprefix, xtable);
+    free (xprefix);
+    free (xtable);
+    prev_sql = sql;
+    pI = pk_dictionary->first;
+    while (pI != NULL)
+      {
+	  char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+	  if (pI->notnull)
+	      sql =
+		  sqlite3_mprintf ("%s\t\"%s\" %s NOT NULL,\n", prev_sql,
+				   xcolumn, pI->type);
+	  else
+	      sql =
+		  sqlite3_mprintf ("%s\t\"%s\" %s,\n", prev_sql, xcolumn,
+				   pI->type);
+	  free (xcolumn);
+	  sqlite3_free (prev_sql);
+	  prev_sql = sql;
+	  pI = pI->next;
+      }
+    xprefix = sqlite3_mprintf ("pk_%s", dustbin_table);
+    xtable = gaiaDoubleQuotedSql (xprefix);
+    sqlite3_free (xprefix);
+    sql =
+	sqlite3_mprintf ("%s\tmessage TEXT,\n\ttolerance DOUBLE NOT NULL,\n"
+			 "\tCONSTRAINT \"%s\" PRIMARY KEY (", prev_sql, xtable);
+    sqlite3_free (prev_sql);
+    free (xtable);
+    prev_sql = sql;
+    for (i = 1; i <= pk_dictionary->count; i++)
+      {
+	  pI = pk_dictionary->first;
+	  while (pI != NULL)
+	    {
+		if (pI->pk == i)
+		  {
+		      char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+		      if (i == 1)
+			  sql = sqlite3_mprintf ("%s\"%s\"", prev_sql, xcolumn);
+		      else
+			  sql =
+			      sqlite3_mprintf ("%s, \"%s\"", prev_sql, xcolumn);
+		      sqlite3_free (prev_sql);
+		      free (xcolumn);
+		      prev_sql = sql;
+		  }
+		pI = pI->next;
+	    }
+      }
+    sql = sqlite3_mprintf ("%s))", prev_sql);
+    sqlite3_free (prev_sql);
+    free_pk_dictionary (pk_dictionary);
+
+    ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: unable to create dustbin-table \"%s\": %s\n",
+	       dustbin_table, err_msg);
+	  sqlite3_free (err_msg);
+	  return 0;
+      }
+
+    return 1;
+}
+
+static int
+create_dustbin_view (sqlite3 * sqlite, const char *db_prefix, const char *table,
+		     const char *column, const char *dustbin_table,
+		     const char *dustbin_view, char **sql_in, char **sql_out,
+		     char **sql_in2)
+{
+/* attempting to create a dustbin view */
+    char *xprefix;
+    char *xtable;
+    char *xcolumn;
+    char *sql;
+    char *prev_sql;
+    char *sql2;
+    int ret;
+    char *err_msg = NULL;
+    int i;
+    char **results;
+    int rows;
+    int columns;
+    const char *value;
+    int error = 0;
+    struct pk_struct *pk_dictionary = NULL;
+    struct pk_item *pI;
+    int first;
+
+    *sql_in = NULL;
+    *sql_out = NULL;
+    *sql_in2 = NULL;
+/* checking if the target view already exists */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    sql =
+	sqlite3_mprintf
+	("SELECT Count(*) FROM \"%s\".sqlite_master WHERE Lower(name) = Lower(%Q)",
+	 xprefix, dustbin_view);
+    free (xprefix);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return 0;
+    if (rows < 1)
+	;
+    else
+      {
+	  for (i = 1; i <= rows; i++)
+	    {
+		value = results[(i * columns) + 0];
+		if (atoi (value) != 0)
+		    error = 1;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (error)
+	return 0;
+
+/* identifying all main table's columns */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql = sqlite3_mprintf ("PRAGMA \"%s\".table_info(\"%s\")", xprefix, xtable);
+    free (xprefix);
+    free (xtable);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+	return 0;
+    pk_dictionary = create_pk_dictionary ();
+    if (rows < 1)
+	;
+    else
+      {
+	  for (i = 1; i <= rows; i++)
+	    {
+		const char *name = results[(i * columns) + 1];
+		const char *type = results[(i * columns) + 2];
+		int notnull = atoi (results[(i * columns) + 3]);
+		int pk = atoi (results[(i * columns) + 5]);
+		add_pk_column (pk_dictionary, name, type, notnull, pk);
+	    }
+      }
+    sqlite3_free_table (results);
+    if (pk_dictionary->count <= 0)
+      {
+	  free_pk_dictionary (pk_dictionary);
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: unable to retrieve \"%s\" columns\n",
+	       table);
+	  return 0;
+      }
+
+/* going to create the dustbin view */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (dustbin_view);
+    sql = sqlite3_mprintf ("CREATE VIEW \"%s\".\"%s\" AS\n"
+			   "SELECT a.ROWID AS rowid", xprefix, xtable);
+    free (xprefix);
+    free (xtable);
+    prev_sql = sql;
+    pI = pk_dictionary->first;
+    while (pI != NULL)
+      {
+	  char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+	  sql =
+	      sqlite3_mprintf ("%s, a.\"%s\" AS \"%s\"", prev_sql, xcolumn,
+			       xcolumn);
+	  free (xcolumn);
+	  sqlite3_free (prev_sql);
+	  prev_sql = sql;
+	  pI = pI->next;
+      }
+    xtable = gaiaDoubleQuotedSql (table);
+    xprefix = gaiaDoubleQuotedSql (dustbin_table);
+    sql =
+	sqlite3_mprintf
+	("%s, b.message AS message, b.tolerance AS tolerance "
+	 "FROM \"%s\" AS a, \"%s\" AS b\nWHERE ", prev_sql, xtable, xprefix);
+    sqlite3_free (prev_sql);
+    free (xtable);
+    free (xprefix);
+    prev_sql = sql;
+    pI = pk_dictionary->first;
+    first = 1;
+    while (pI != NULL)
+      {
+	  if (pI->pk > 0)
+	    {
+		char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+		if (first)
+		    sql =
+			sqlite3_mprintf ("%sa.\"%s\" = b.\"%s\"", prev_sql,
+					 xcolumn, xcolumn);
+		else
+		    sql =
+			sqlite3_mprintf ("%s AND a.\"%s\" = b.\"%s\"", prev_sql,
+					 xcolumn, xcolumn);
+		first = 0;
+		sqlite3_free (prev_sql);
+		free (xcolumn);
+		prev_sql = sql;
+	    }
+	  pI = pI->next;
+      }
+    ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: unable to create dustbin-view \"%s\": %s\n",
+	       dustbin_table, err_msg);
+	  sqlite3_free (err_msg);
+	  free_pk_dictionary (pk_dictionary);
+	  return 0;
+      }
+
+/* registering the Spatial View */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    sql =
+	sqlite3_mprintf
+	("INSERT INTO \"%s\".views_geometry_columns (view_name, "
+	 "view_geometry, view_rowid, f_table_name, f_geometry_column, read_only) "
+	 "VALUES (%Q, %Q, 'rowid',  %Q, %Q, 1)", xprefix, dustbin_view, column,
+	 table, column);
+    free (xprefix);
+    ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  spatialite_e
+	      ("TopoGeo_FromGeoTableExt: unable to register the dustbin-view \"%s\": %s\n",
+	       dustbin_table, err_msg);
+	  sqlite3_free (err_msg);
+	  free_pk_dictionary (pk_dictionary);
+	  return 0;
+      }
+
+/* constructing the input SQL statement */
+    sql = sqlite3_mprintf ("SELECT ROWID");
+    prev_sql = sql;
+    pI = pk_dictionary->first;
+    while (pI != NULL)
+      {
+	  if (pI->pk > 0)
+	    {
+		char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+		sql = sqlite3_mprintf ("%s, \"%s\"", prev_sql, xcolumn);
+		sqlite3_free (prev_sql);
+		free (xcolumn);
+		prev_sql = sql;
+	    }
+	  pI = pI->next;
+      }
+    xcolumn = gaiaDoubleQuotedSql (column);
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (table);
+    sql =
+	sqlite3_mprintf ("%s, \"%s\" FROM \"%s\".\"%s\" "
+			 "WHERE ROWID > ? ORDER BY ROWID", prev_sql, xcolumn,
+			 xprefix, xtable);
+    sql2 =
+	sqlite3_mprintf ("%s, \"%s\" FROM \"%s\".\"%s\" WHERE ROWID = ?",
+			 prev_sql, xcolumn, xprefix, xtable);
+    free (xcolumn);
+    free (xprefix);
+    free (xtable);
+    sqlite3_free (prev_sql);
+    *sql_in = sql;
+    *sql_in2 = sql2;
+
+/* constructing the output SQL statement */
+    xprefix = gaiaDoubleQuotedSql (db_prefix);
+    xtable = gaiaDoubleQuotedSql (dustbin_table);
+    sql = sqlite3_mprintf ("INSERT INTO \"%s\".\"%s\" (", xprefix, xtable);
+    prev_sql = sql;
+    free (xprefix);
+    free (xtable);
+    pI = pk_dictionary->first;
+    first = 1;
+    while (pI != NULL)
+      {
+	  if (pI->pk > 0)
+	    {
+		char *xcolumn = gaiaDoubleQuotedSql (pI->name);
+		if (first)
+		    sql = sqlite3_mprintf ("%s\"%s\"", prev_sql, xcolumn);
+		else
+		    sql = sqlite3_mprintf ("%s, \"%s\"", prev_sql, xcolumn);
+		first = 0;
+		sqlite3_free (prev_sql);
+		free (xcolumn);
+		prev_sql = sql;
+	    }
+	  pI = pI->next;
+      }
+    sql = sqlite3_mprintf ("%s, message, tolerance) VALUES (", prev_sql);
+    sqlite3_free (prev_sql);
+    prev_sql = sql;
+    pI = pk_dictionary->first;
+    first = 1;
+    while (pI != NULL)
+      {
+	  if (pI->pk > 0)
+	    {
+		if (first)
+		    sql = sqlite3_mprintf ("%s?", prev_sql);
+		else
+		    sql = sqlite3_mprintf ("%s, ?", prev_sql);
+		first = 0;
+		sqlite3_free (prev_sql);
+		prev_sql = sql;
+	    }
+	  pI = pI->next;
+      }
+    sql = sqlite3_mprintf ("%s, ?, ?)", prev_sql);
+    sqlite3_free (prev_sql);
+    *sql_out = sql;
+
+    free_pk_dictionary (pk_dictionary);
+    return 1;
+}
+
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_FromGeoTableExt (const void *xcontext, int argc,
+				 const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_FromGeoTableExt ( text topology-name, text db-prefix, text table,
+/                           text column, double tolerance, 
+/                           text dustbin-table, text dustbin-view )
+/ TopoGeo_FromGeoTableExt ( text topology-name, text db-prefix, text table,
+/                           text column, double tolerance, 
+/                           text dustbin-table, text dustbin-view,
+/                           int line_max_points, double max_length )
+/
+/ returns: 1 on success
+/ raises an exception on failure
+*/
+    const char *msg;
+    int ret;
+    const char *topo_name;
+    const char *db_prefix;
+    const char *table;
+    const char *column;
+    char *xtable = NULL;
+    char *xcolumn = NULL;
+    int srid;
+    int dims;
+    double tolerance;
+    const char *dustbin_table;
+    const char *dustbin_view;
+    int line_max_points = -1;
+    double max_length = -1.0;
+    char *sql_in = NULL;
+    char *sql_out = NULL;
+    char *sql_in2 = NULL;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
+	db_prefix = "main";
+    else if (sqlite3_value_type (argv[1]) == SQLITE_TEXT)
+	db_prefix = (const char *) sqlite3_value_text (argv[1]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[2]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[2]) == SQLITE_TEXT)
+	table = (const char *) sqlite3_value_text (argv[2]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[3]) == SQLITE_NULL)
+	column = NULL;
+    else if (sqlite3_value_type (argv[3]) == SQLITE_TEXT)
+	column = (const char *) sqlite3_value_text (argv[3]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[4]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[4]) == SQLITE_INTEGER)
+      {
+	  int t = sqlite3_value_int (argv[4]);
+	  tolerance = t;
+      }
+    else if (sqlite3_value_type (argv[4]) == SQLITE_FLOAT)
+	tolerance = sqlite3_value_int (argv[4]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[5]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[5]) == SQLITE_TEXT)
+	dustbin_table = (const char *) sqlite3_value_text (argv[5]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[6]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[6]) == SQLITE_TEXT)
+	dustbin_view = (const char *) sqlite3_value_text (argv[6]);
+    else
+	goto invalid_arg;
+    if (argc >= 8)
+      {
+	  if (sqlite3_value_type (argv[7]) == SQLITE_NULL)
+	      goto null_arg;
+	  else if (sqlite3_value_type (argv[7]) == SQLITE_INTEGER)
+	      line_max_points = sqlite3_value_int (argv[8]);
+	  else
+	      goto invalid_arg;
+      }
+    if (argc >= 9)
+      {
+	  if (sqlite3_value_type (argv[8]) == SQLITE_NULL)
+	      goto null_arg;
+	  else if (sqlite3_value_type (argv[8]) == SQLITE_INTEGER)
+	    {
+		int max = sqlite3_value_int (argv[8]);
+		max_length = max;
+	    }
+	  else if (sqlite3_value_type (argv[8]) == SQLITE_FLOAT)
+	      max_length = sqlite3_value_double (argv[8]);
+	  else
+	      goto invalid_arg;
+      }
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
+
+/* checking the input GeoTable */
+    if (!check_input_geo_table
+	(sqlite, db_prefix, table, column, &xtable, &xcolumn, &srid, &dims))
+	goto no_input;
+    if (!check_matching_srid_dims (accessor, srid, dims))
+	goto invalid_geom;
+
+/* attempting to create the dustbin table and view */
+    start_topo_savepoint (sqlite, cache);
+    if (!create_dustbin_table (sqlite, db_prefix, xtable, dustbin_table))
+      {
+	  rollback_topo_savepoint (sqlite, cache);
+	  goto no_dustbin_table;
+      }
+    if (!create_dustbin_view
+	(sqlite, db_prefix, xtable, xcolumn, dustbin_table, dustbin_view,
+	 &sql_in, &sql_out, &sql_in2))
+      {
+	  rollback_topo_savepoint (sqlite, cache);
+	  goto no_dustbin_view;
+      }
+    release_topo_savepoint (sqlite, cache);
+
+    ret =
+	gaiaTopoGeo_FromGeoTableExtended (accessor, sql_in, sql_out, sql_in2,
+					  tolerance, line_max_points,
+					  max_length);
+    free (xtable);
+    free (xcolumn);
+    sqlite3_free (sql_in);
+    sqlite3_free (sql_out);
+    sqlite3_free (sql_in2);
+    sqlite3_result_int (context, ret);
+    return;
+
+  no_topo:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  no_input:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg = "SQL/MM Spatial exception - invalid input GeoTable.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  null_arg:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_arg:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_geom:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg =
+	"SQL/MM Spatial exception - invalid GeoTable (mismatching SRID or dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  no_dustbin_table:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    msg = "SQL/MM Spatial exception - unable to create the dustbin table.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  no_dustbin_view:
+    if (xtable != NULL)
+	free (xtable);
+    if (xcolumn != NULL)
+	free (xcolumn);
+    if (sql_in != NULL)
+	sqlite3_free (sql_in);
+    if (sql_out != NULL)
+	sqlite3_free (sql_out);
+    if (sql_in2 != NULL)
+	sqlite3_free (sql_in2);
+    msg = "SQL/MM Spatial exception - unable to create the dustbin view.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+}
+
+static int
+check_matching_srid (GaiaTopologyAccessorPtr accessor, int srid)
+{
+/* checking for matching SRID */
+    struct gaia_topology *topo = (struct gaia_topology *) accessor;
+    if (topo->srid != srid)
+	return 0;
+    return 1;
+}
+
+static int
+check_reference_geo_table (sqlite3 * sqlite, const char *db_prefix,
+			   const char *table, const char *column, char **xtable,
 			   char **xcolumn, int *srid)
 {
     int dims;
@@ -3530,6 +4411,7 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *db_prefix;
@@ -3540,7 +4422,7 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
     char *xreftable = NULL;
     char *xrefcolumn = NULL;
     int srid;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -3588,6 +4470,7 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the reference GeoTable */
     if (!check_reference_geo_table
@@ -3601,7 +4484,6 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
     if (!check_output_geo_table (sqlite, out_table))
 	goto err_output;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_ToGeoTable (accessor, db_prefix, xreftable, xrefcolumn,
@@ -3614,7 +4496,7 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
     free (xrefcolumn);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -3627,9 +4509,9 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   no_reference:
@@ -3637,9 +4519,9 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_ToGeoTable: invalid reference GeoTable.",
-			  -1);
+    msg = "TopoGeo_ToGeoTable: invalid reference GeoTable.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_output:
@@ -3647,9 +4529,9 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_ToGeoTable: output GeoTable already exists.",
-			  -1);
+    msg = "TopoGeo_ToGeoTable: output GeoTable already exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
@@ -3657,8 +4539,9 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
@@ -3666,8 +4549,9 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
@@ -3675,9 +4559,10 @@ fnctaux_TopoGeo_ToGeoTable (const void *xcontext, int argc, const void *xargv)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -3697,6 +4582,7 @@ fnctaux_TopoGeo_ToGeoTableGeneralize (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *db_prefix;
@@ -3708,7 +4594,7 @@ fnctaux_TopoGeo_ToGeoTableGeneralize (const void *xcontext, int argc,
     char *xreftable = NULL;
     char *xrefcolumn = NULL;
     int srid;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -3744,48 +4630,257 @@ fnctaux_TopoGeo_ToGeoTableGeneralize (const void *xcontext, int argc,
 	goto invalid_arg;
     if (sqlite3_value_type (argv[5]) == SQLITE_NULL)
 	goto null_arg;
-    else if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
-      {
-	  int val = sqlite3_value_int (argv[5]);
-	  tolerance = val;
-      }
-    else if (sqlite3_value_type (argv[5]) == SQLITE_FLOAT)
-	tolerance = sqlite3_value_double (argv[5]);
+    else if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
+      {
+	  int val = sqlite3_value_int (argv[5]);
+	  tolerance = val;
+      }
+    else if (sqlite3_value_type (argv[5]) == SQLITE_FLOAT)
+	tolerance = sqlite3_value_double (argv[5]);
+    else
+	goto invalid_arg;
+    if (argc >= 7)
+      {
+	  if (sqlite3_value_type (argv[6]) == SQLITE_NULL)
+	      goto null_arg;
+	  else if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+	      with_spatial_index = sqlite3_value_int (argv[6]);
+	  else
+	      goto invalid_arg;
+      }
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
+
+/* checking the reference GeoTable */
+    if (!check_reference_geo_table
+	(sqlite, db_prefix, ref_table, ref_column, &xreftable, &xrefcolumn,
+	 &srid))
+	goto no_reference;
+    if (!check_matching_srid (accessor, srid))
+	goto invalid_geom;
+
+/* checking the output GeoTable */
+    if (!check_output_geo_table (sqlite, out_table))
+	goto err_output;
+
+    start_topo_savepoint (sqlite, cache);
+    ret =
+	gaiaTopoGeo_ToGeoTableGeneralize (accessor, db_prefix, xreftable,
+					  xrefcolumn, out_table, tolerance,
+					  with_spatial_index);
+    if (!ret)
+	rollback_topo_savepoint (sqlite, cache);
+    else
+	release_topo_savepoint (sqlite, cache);
+    free (xreftable);
+    free (xrefcolumn);
+    if (!ret)
+      {
+	  msg = gaiaGetRtTopoErrorMsg (cache);
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_result_error (context, msg, -1);
+	  return;
+      }
+    sqlite3_result_int (context, 1);
+    return;
+
+  no_topo:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  no_reference:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "TopoGeo_ToGeoTableGeneralize: invalid reference GeoTable.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  err_output:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "TopoGeo_ToGeoTableGeneralize: output GeoTable already exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  null_arg:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_arg:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_geom:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg =
+	"SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+}
+
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_RemoveSmallFaces (const void *xcontext, int argc,
+				  const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_RemoveSmallFaces ( text topology-name, double min-area )
+/
+/ returns: 1 on success
+/ raises an exception on failure
+*/
+    const char *msg;
+    int ret;
+    const char *topo_name;
+    double min_area = 0.0;
+    char *xreftable = NULL;
+    char *xrefcolumn = NULL;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER)
+      {
+	  int val = sqlite3_value_int (argv[1]);
+	  min_area = val;
+      }
+    else if (sqlite3_value_type (argv[1]) == SQLITE_FLOAT)
+	min_area = sqlite3_value_double (argv[1]);
+    else
+	goto invalid_arg;
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+
+    gaiatopo_reset_last_error_msg (accessor);
+    start_topo_savepoint (sqlite, cache);
+    ret = gaiaTopoGeo_RemoveSmallFaces (accessor, min_area);
+    if (!ret)
+	rollback_topo_savepoint (sqlite, cache);
+    else
+	release_topo_savepoint (sqlite, cache);
+    free (xreftable);
+    free (xrefcolumn);
+    if (!ret)
+      {
+	  msg = gaiaGetRtTopoErrorMsg (cache);
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_result_error (context, msg, -1);
+	  return;
+      }
+    sqlite3_result_int (context, 1);
+    return;
+
+  no_topo:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  null_arg:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_arg:
+    if (xreftable != NULL)
+	free (xreftable);
+    if (xrefcolumn != NULL)
+	free (xrefcolumn);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+}
+
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_RemoveDanglingEdges (const void *xcontext, int argc,
+				     const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_RemoveDanglingEdges ( text topology-name )
+/
+/ returns: 1 on success
+/ raises an exception on failure
+*/
+    const char *msg;
+    int ret;
+    const char *topo_name;
+    char *xreftable = NULL;
+    char *xrefcolumn = NULL;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
     else
 	goto invalid_arg;
-    if (argc >= 7)
-      {
-	  if (sqlite3_value_type (argv[6]) == SQLITE_NULL)
-	      goto null_arg;
-	  else if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
-	      with_spatial_index = sqlite3_value_int (argv[6]);
-	  else
-	      goto invalid_arg;
-      }
 
 /* attempting to get a Topology Accessor */
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
 
-/* checking the reference GeoTable */
-    if (!check_reference_geo_table
-	(sqlite, db_prefix, ref_table, ref_column, &xreftable, &xrefcolumn,
-	 &srid))
-	goto no_reference;
-    if (!check_matching_srid (accessor, srid))
-	goto invalid_geom;
-
-/* checking the output GeoTable */
-    if (!check_output_geo_table (sqlite, out_table))
-	goto err_output;
-
     gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
-    ret =
-	gaiaTopoGeo_ToGeoTableGeneralize (accessor, db_prefix, xreftable,
-					  xrefcolumn, out_table, tolerance,
-					  with_spatial_index);
+    ret = gaiaTopoGeo_RemoveDanglingEdges (accessor);
     if (!ret)
 	rollback_topo_savepoint (sqlite, cache);
     else
@@ -3794,7 +4889,7 @@ fnctaux_TopoGeo_ToGeoTableGeneralize (const void *xcontext, int argc,
     free (xrefcolumn);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -3807,57 +4902,112 @@ fnctaux_TopoGeo_ToGeoTableGeneralize (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
-  no_reference:
+  null_arg:
     if (xreftable != NULL)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_ToGeoTableGeneralize: invalid reference GeoTable.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
-  err_output:
+  invalid_arg:
     if (xreftable != NULL)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_ToGeoTableGeneralize: output GeoTable already exists.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
+}
 
-  null_arg:
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_RemoveDanglingNodes (const void *xcontext, int argc,
+				     const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_RemoveDanglingNodes ( text topology-name )
+/
+/ returns: 1 on success
+/ raises an exception on failure
+*/
+    const char *msg;
+    int ret;
+    const char *topo_name;
+    char *xreftable = NULL;
+    char *xrefcolumn = NULL;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    else
+	goto invalid_arg;
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+
+    gaiatopo_reset_last_error_msg (accessor);
+    start_topo_savepoint (sqlite, cache);
+    ret = gaiaTopoGeo_RemoveDanglingNodes (accessor);
+    if (!ret)
+	rollback_topo_savepoint (sqlite, cache);
+    else
+	release_topo_savepoint (sqlite, cache);
+    free (xreftable);
+    free (xrefcolumn);
+    if (!ret)
+      {
+	  msg = gaiaGetRtTopoErrorMsg (cache);
+	  gaiatopo_set_last_error_msg (accessor, msg);
+	  sqlite3_result_error (context, msg, -1);
+	  return;
+      }
+    sqlite3_result_int (context, 1);
+    return;
+
+  no_topo:
     if (xreftable != NULL)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
-  invalid_arg:
+  null_arg:
     if (xreftable != NULL)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
-  invalid_geom:
+  invalid_arg:
     if (xreftable != NULL)
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -4370,6 +5520,7 @@ fnctaux_TopoGeo_Clone (const void *xcontext, int argc, const void *xargv)
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *db_prefix = "MAIN";
     const char *in_topo_name;
@@ -4378,7 +5529,7 @@ fnctaux_TopoGeo_Clone (const void *xcontext, int argc, const void *xargv)
     int srid;
     double tolerance;
     int has_z;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -4423,6 +5574,7 @@ fnctaux_TopoGeo_Clone (const void *xcontext, int argc, const void *xargv)
     accessor = gaiaGetTopology (sqlite, cache, out_topo_name);
     if (accessor == NULL)
 	goto no_topo2;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* cloning Topology */
     ret = do_clone_topology (db_prefix, input_topo_name, accessor);
@@ -4443,31 +5595,33 @@ fnctaux_TopoGeo_Clone (const void *xcontext, int argc, const void *xargv)
   no_topo:
     if (input_topo_name != NULL)
 	free (input_topo_name);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name (origin).",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name (origin).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   no_topo2:
     if (input_topo_name != NULL)
 	free (input_topo_name);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name (destination).",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name (destination).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
     if (input_topo_name != NULL)
 	free (input_topo_name);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
     if (input_topo_name != NULL)
 	free (input_topo_name);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -4480,12 +5634,13 @@ fnctaux_TopoGeo_GetEdgeSeed (const void *xcontext, int argc, const void *xargv)
 / returns: a Point (seed) identifying the Edge
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
     sqlite3_int64 edge_id;
     unsigned char *p_blob;
     int n_bytes;
     gaiaGeomCollPtr geom;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
@@ -4516,7 +5671,177 @@ fnctaux_TopoGeo_GetEdgeSeed (const void *xcontext, int argc, const void *xargv)
     geom = gaiaGetEdgeSeed (accessor, edge_id);
     if (geom == NULL)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
+	  if (msg != NULL)
+	    {
+		gaiatopo_set_last_error_msg (accessor, msg);
+		sqlite3_result_error (context, msg, -1);
+		return;
+	    }
+	  sqlite3_result_null (context);
+	  return;
+      }
+    gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
+    gaiaFreeGeomColl (geom);
+    if (p_blob == NULL)
+	sqlite3_result_null (context);
+    else
+	sqlite3_result_blob (context, p_blob, n_bytes, free);
+    return;
+
+  no_topo:
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  null_arg:
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_arg:
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+}
+
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_GetFaceSeed (const void *xcontext, int argc, const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_GetFaceSeed ( text topology-name, int face_id )
+/
+/ returns: a Point (seed) identifying the Edge
+/ raises an exception on failure
+*/
+    const char *msg;
+    const char *topo_name;
+    sqlite3_int64 face_id;
+    unsigned char *p_blob;
+    int n_bytes;
+    gaiaGeomCollPtr geom;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    int gpkg_mode = 0;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (cache != NULL)
+	gpkg_mode = cache->gpkg_mode;
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER)
+	face_id = sqlite3_value_int64 (argv[1]);
+    else
+	goto invalid_arg;
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+
+    gaiatopo_reset_last_error_msg (accessor);
+    geom = gaiaGetFaceSeed (accessor, face_id);
+    if (geom == NULL)
+      {
+	  msg = gaiaGetRtTopoErrorMsg (cache);
+	  if (msg != NULL)
+	    {
+		gaiatopo_set_last_error_msg (accessor, msg);
+		sqlite3_result_error (context, msg, -1);
+		return;
+	    }
+	  sqlite3_result_null (context);
+	  return;
+      }
+    gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
+    gaiaFreeGeomColl (geom);
+    if (p_blob == NULL)
+	sqlite3_result_null (context);
+    else
+	sqlite3_result_blob (context, p_blob, n_bytes, free);
+    return;
+
+  no_topo:
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  null_arg:
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_arg:
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+}
+
+SPATIALITE_PRIVATE void
+fnctaux_TopoGeo_UpdateSeeds (const void *xcontext, int argc, const void *xargv)
+{
+/* SQL function:
+/ TopoGeo_UpdateSeeds ( text topology-name )
+/ TopoGeo_UpdateSeeds ( text topology-name, int incremental_mode )
+/
+/ returns: 1 on success
+/ raises an exception on failure
+*/
+    const char *msg;
+    const char *topo_name;
+    int incremental_mode = 1;
+    int ret;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    sqlite3_context *context = (sqlite3_context *) xcontext;
+    sqlite3_value **argv = (sqlite3_value **) xargv;
+    sqlite3 *sqlite = sqlite3_context_db_handle (context);
+    struct splite_internal_cache *cache = sqlite3_user_data (context);
+    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+    if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    else
+	goto invalid_arg;
+    if (argc >= 2)
+      {
+	  if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
+	      goto null_arg;
+	  else if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER)
+	      incremental_mode = sqlite3_value_int (argv[1]);
+	  else
+	      goto invalid_arg;
+      }
+
+/* attempting to get a Topology Accessor */
+    accessor = gaiaGetTopology (sqlite, cache, topo_name);
+    if (accessor == NULL)
+	goto no_topo;
+
+    gaiatopo_reset_last_error_msg (accessor);
+    start_topo_savepoint (sqlite, cache);
+    ret = gaiaTopoGeoUpdateSeeds (accessor, incremental_mode);
+    if (!ret)
+	rollback_topo_savepoint (sqlite, cache);
+    else
+	release_topo_savepoint (sqlite, cache);
+    if (!ret)
+      {
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  if (msg != NULL)
 	    {
 		gaiatopo_set_last_error_msg (accessor, msg);
@@ -4526,88 +5851,121 @@ fnctaux_TopoGeo_GetEdgeSeed (const void *xcontext, int argc, const void *xargv)
 	  sqlite3_result_null (context);
 	  return;
       }
-    gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
-    gaiaFreeGeomColl (geom);
-    if (p_blob == NULL)
-	sqlite3_result_null (context);
-    else
-	sqlite3_result_blob (context, p_blob, n_bytes, free);
+    sqlite3_result_int (context, 1);
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
 SPATIALITE_PRIVATE void
-fnctaux_TopoGeo_GetFaceSeed (const void *xcontext, int argc, const void *xargv)
+fnctaux_TopoGeo_SnapPointToSeed (const void *xcontext, int argc,
+				 const void *xargv)
 {
 /* SQL function:
-/ TopoGeo_GetFaceSeed ( text topology-name, int face_id )
+/ TopoGeo_SnapPointToSeed ( geometry point, text topology-name, double distance )
 /
-/ returns: a Point (seed) identifying the Edge
+/ returns: a snapped point geometry
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
-    sqlite3_int64 face_id;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    gaiaGeomCollPtr geom = NULL;
+    gaiaGeomCollPtr result = NULL;
+    double dist;
     unsigned char *p_blob;
     int n_bytes;
-    gaiaGeomCollPtr geom;
-    GaiaTopologyAccessorPtr accessor;
+    int invalid = 0;
+    int gpkg_amphibious = 0;
     int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
     struct splite_internal_cache *cache = sqlite3_user_data (context);
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+
     if (cache != NULL)
-	gpkg_mode = cache->gpkg_mode;
+      {
+	  gpkg_amphibious = cache->gpkg_amphibious_mode;
+	  gpkg_mode = cache->gpkg_mode;
+      }
+
     if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
 	goto null_arg;
-    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
-	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    if (sqlite3_value_type (argv[0]) == SQLITE_BLOB)
+      {
+	  p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
+	  n_bytes = sqlite3_value_bytes (argv[0]);
+      }
     else
 	goto invalid_arg;
     if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
 	goto null_arg;
-    else if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER)
-	face_id = sqlite3_value_int64 (argv[1]);
+    else if (sqlite3_value_type (argv[1]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[1]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[2]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[2]) == SQLITE_INTEGER)
+      {
+	  int intval = sqlite3_value_int (argv[2]);
+	  dist = intval;
+      }
+    else if (sqlite3_value_type (argv[2]) == SQLITE_FLOAT)
+	dist = sqlite3_value_double (argv[2]);
     else
 	goto invalid_arg;
 
+/* attempting to get a Point Geometry */
+    geom =
+	gaiaFromSpatiaLiteBlobWkbEx (p_blob, n_bytes, gpkg_mode,
+				     gpkg_amphibious);
+    if (!geom)
+	goto invalid_arg;
+    if (geom->FirstLinestring != NULL)
+	invalid = 1;
+    if (geom->FirstPolygon != NULL)
+	invalid = 1;
+    if (geom->FirstPoint != geom->LastPoint || geom->FirstPoint == NULL)
+	invalid = 1;
+    if (invalid)
+	goto invalid_arg;
+
 /* attempting to get a Topology Accessor */
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
-    geom = gaiaGetFaceSeed (accessor, face_id);
-    if (geom == NULL)
+    if (!check_matching_srid_dims (accessor, geom->Srid, geom->DimensionModel))
+	goto invalid_geom;
+
+    result = gaiaTopoGeoSnapPointToSeed (accessor, geom, dist);
+    if (result == NULL)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
-	  if (msg != NULL)
-	    {
-		gaiatopo_set_last_error_msg (accessor, msg);
-		sqlite3_result_error (context, msg, -1);
-		return;
-	    }
+	  gaiaFreeGeomColl (geom);
 	  sqlite3_result_null (context);
 	  return;
       }
-    gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
+    gaiaToSpatiaLiteBlobWkbEx (result, &p_blob, &n_bytes, gpkg_mode);
     gaiaFreeGeomColl (geom);
+    gaiaFreeGeomColl (result);
     if (p_blob == NULL)
 	sqlite3_result_null (context);
     else
@@ -4615,98 +5973,186 @@ fnctaux_TopoGeo_GetFaceSeed (const void *xcontext, int argc, const void *xargv)
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_geom:
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg =
+	"SQL/MM Spatial exception - invalid Point (mismatching SRID od dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
 SPATIALITE_PRIVATE void
-fnctaux_TopoGeo_UpdateSeeds (const void *xcontext, int argc, const void *xargv)
+fnctaux_TopoGeo_SnapLineToSeed (const void *xcontext, int argc,
+				const void *xargv)
 {
 /* SQL function:
-/ TopoGeo_UpdateSeeds ( text topology-name )
-/ TopoGeo_UpdateSeeds ( text topology-name, int incremental_mode )
+/ TopoGeo_SnapLineToSeed ( geometry line, text topology-name, double distance )
 /
-/ returns: 1 on success
+/ returns: a snapped linestring geometry
 / raises an exception on failure
 */
+    const char *msg;
     const char *topo_name;
-    int incremental_mode = 1;
-    int ret;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
+    gaiaGeomCollPtr geom = NULL;
+    gaiaGeomCollPtr result = NULL;
+    double dist;
+    unsigned char *p_blob;
+    int n_bytes;
+    int invalid = 0;
+    int gpkg_amphibious = 0;
+    int gpkg_mode = 0;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
     struct splite_internal_cache *cache = sqlite3_user_data (context);
     GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
+
+    if (cache != NULL)
+      {
+	  gpkg_amphibious = cache->gpkg_amphibious_mode;
+	  gpkg_mode = cache->gpkg_mode;
+      }
+
     if (sqlite3_value_type (argv[0]) == SQLITE_NULL)
 	goto null_arg;
-    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
-	topo_name = (const char *) sqlite3_value_text (argv[0]);
+    if (sqlite3_value_type (argv[0]) == SQLITE_BLOB)
+      {
+	  p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
+	  n_bytes = sqlite3_value_bytes (argv[0]);
+      }
     else
 	goto invalid_arg;
-    if (argc >= 2)
+    if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[1]) == SQLITE_TEXT)
+	topo_name = (const char *) sqlite3_value_text (argv[1]);
+    else
+	goto invalid_arg;
+    if (sqlite3_value_type (argv[2]) == SQLITE_NULL)
+	goto null_arg;
+    else if (sqlite3_value_type (argv[2]) == SQLITE_INTEGER)
       {
-	  if (sqlite3_value_type (argv[1]) == SQLITE_NULL)
-	      goto null_arg;
-	  else if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER)
-	      incremental_mode = sqlite3_value_int (argv[1]);
-	  else
-	      goto invalid_arg;
+	  int intval = sqlite3_value_int (argv[2]);
+	  dist = intval;
       }
+    else if (sqlite3_value_type (argv[2]) == SQLITE_FLOAT)
+	dist = sqlite3_value_double (argv[2]);
+    else
+	goto invalid_arg;
+
+/* attempting to get a Linestring Geometry */
+    geom =
+	gaiaFromSpatiaLiteBlobWkbEx (p_blob, n_bytes, gpkg_mode,
+				     gpkg_amphibious);
+    if (!geom)
+	goto invalid_arg;
+    if (geom->FirstPoint != NULL)
+	invalid = 1;
+    if (geom->FirstPolygon != NULL)
+	invalid = 1;
+    if (geom->FirstLinestring != geom->LastLinestring
+	|| geom->FirstLinestring == NULL)
+	invalid = 1;
+    if (invalid)
+	goto invalid_arg;
 
 /* attempting to get a Topology Accessor */
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
-
     gaiatopo_reset_last_error_msg (accessor);
-    start_topo_savepoint (sqlite, cache);
-    ret = gaiaTopoGeoUpdateSeeds (accessor, incremental_mode);
-    if (!ret)
-	rollback_topo_savepoint (sqlite, cache);
-    else
-	release_topo_savepoint (sqlite, cache);
-    if (!ret)
+    if (!check_matching_srid_dims (accessor, geom->Srid, geom->DimensionModel))
+	goto invalid_geom;
+
+    result = gaiaTopoGeoSnapLinestringToSeed (accessor, geom, dist);
+    if (result == NULL)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
-	  if (msg != NULL)
-	    {
-		gaiatopo_set_last_error_msg (accessor, msg);
-		sqlite3_result_error (context, msg, -1);
-		return;
-	    }
+	  gaiaFreeGeomColl (geom);
 	  sqlite3_result_null (context);
 	  return;
       }
-    sqlite3_result_int (context, 1);
+    gaiaToSpatiaLiteBlobWkbEx (result, &p_blob, &n_bytes, gpkg_mode);
+    gaiaFreeGeomColl (geom);
+    gaiaFreeGeomColl (result);
+    if (p_blob == NULL)
+	sqlite3_result_null (context);
+    else
+	sqlite3_result_blob (context, p_blob, n_bytes, free);
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
+    return;
+
+  invalid_geom:
+    if (geom != NULL)
+	gaiaFreeGeomColl (geom);
+    if (result != NULL)
+	gaiaFreeGeomColl (result);
+    msg =
+	"SQL/MM Spatial exception - invalid Line (mismatching SRID od dimensions).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -4867,6 +6313,7 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *db_prefix;
@@ -4877,7 +6324,7 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
     char *xreftable = NULL;
     char *xrefcolumn = NULL;
     int srid;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -4925,6 +6372,7 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
     if (is_view)
       {
@@ -4954,7 +6402,6 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
     if (topolayer_exists (accessor, topolayer_name))
 	goto err_output;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_CreateTopoLayer (accessor, db_prefix, xreftable, xrefcolumn,
@@ -4967,7 +6414,7 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
     free (xrefcolumn);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -4980,9 +6427,9 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   no_reference:
@@ -4990,9 +6437,9 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_CreateTopoLayer: invalid reference GeoTable.",
-			  -1);
+    msg = "TopoGeo_CreateTopoLayer: invalid reference GeoTable.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_view_geom:
@@ -5000,9 +6447,10 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_CreateTopoLayer: IsView requires an explicit Geometry column-name.",
-			  -1);
+    msg =
+	"TopoGeo_CreateTopoLayer: IsView requires an explicit Geometry column-name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_view:
@@ -5010,9 +6458,9 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_CreateTopoLayer: invalid reference View (invalid Geometry).",
-			  -1);
+    msg = "TopoGeo_CreateTopoLayer: invalid reference View (invalid Geometry).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_output:
@@ -5020,9 +6468,10 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "TopoGeo_CreateTopoLayer: a TopoLayer of the same name already exists.",
-			  -1);
+    msg =
+	"TopoGeo_CreateTopoLayer: a TopoLayer of the same name already exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
@@ -5030,8 +6479,9 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
@@ -5039,8 +6489,9 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_geom:
@@ -5048,9 +6499,10 @@ fnctaux_TopoGeo_CreateTopoLayer (const void *xcontext, int argc,
 	free (xreftable);
     if (xrefcolumn != NULL)
 	free (xrefcolumn);
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).",
-			  -1);
+    msg =
+	"SQL/MM Spatial exception - invalid reference GeoTable (mismatching SRID).";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -5065,12 +6517,13 @@ fnctaux_TopoGeo_InitTopoLayer (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *db_prefix;
     const char *ref_table;
     const char *topolayer_name;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -5103,6 +6556,7 @@ fnctaux_TopoGeo_InitTopoLayer (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the reference Table */
     if (!check_reference_table (sqlite, db_prefix, ref_table))
@@ -5112,7 +6566,6 @@ fnctaux_TopoGeo_InitTopoLayer (const void *xcontext, int argc,
     if (topolayer_exists (accessor, topolayer_name))
 	goto err_output;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_InitTopoLayer (accessor, db_prefix, ref_table,
@@ -5123,7 +6576,7 @@ fnctaux_TopoGeo_InitTopoLayer (const void *xcontext, int argc,
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -5132,31 +6585,33 @@ fnctaux_TopoGeo_InitTopoLayer (const void *xcontext, int argc,
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   no_reference:
-    sqlite3_result_error (context,
-			  "TopoGeo_InitTopoLayer: invalid reference Table.",
-			  -1);
+    msg = "TopoGeo_InitTopoLayer: invalid reference Table.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_output:
-    sqlite3_result_error (context,
-			  "TopoGeo_InitTopoLayer: a TopoLayer of the same name already exists.",
-			  -1);
+    msg = "TopoGeo_InitTopoLayer: a TopoLayer of the same name already exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -5170,10 +6625,11 @@ fnctaux_TopoGeo_RemoveTopoLayer (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *topolayer_name;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -5196,12 +6652,12 @@ fnctaux_TopoGeo_RemoveTopoLayer (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the TopoLayer */
     if (!topolayer_exists (accessor, topolayer_name))
 	goto err_topolayer;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret = gaiaTopoGeo_RemoveTopoLayer (accessor, topolayer_name);
     if (!ret)
@@ -5210,7 +6666,7 @@ fnctaux_TopoGeo_RemoveTopoLayer (const void *xcontext, int argc,
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  const char *msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -5219,25 +6675,27 @@ fnctaux_TopoGeo_RemoveTopoLayer (const void *xcontext, int argc,
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_topolayer:
-    sqlite3_result_error (context,
-			  "TopoGeo_RemoveTopoLayer: not existing TopoLayer.",
-			  -1);
+    msg = "TopoGeo_RemoveTopoLayer: not existing TopoLayer.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -5257,13 +6715,14 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *topolayer_name;
     const char *out_table;
     int with_spatial_index = 0;
     int create_only = 0;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -5310,6 +6769,7 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the input TopoLayer */
     if (!topolayer_exists (accessor, topolayer_name))
@@ -5319,7 +6779,6 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
     if (!check_output_geo_table (sqlite, out_table))
 	goto invalid_output;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_ExportTopoLayer (accessor, topolayer_name, out_table,
@@ -5330,7 +6789,7 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -5339,15 +6798,15 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_output:
-    sqlite3_result_error (context,
-			  "TopoGeo_ExportTopoLayer: the output GeoTable already exists.",
-			  -1);
+    msg = "TopoGeo_ExportTopoLayer: the output GeoTable already exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_topolayer:
@@ -5357,13 +6816,15 @@ fnctaux_TopoGeo_ExportTopoLayer (const void *xcontext, int argc,
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
@@ -5379,12 +6840,13 @@ fnctaux_TopoGeo_InsertFeatureFromTopoLayer (const void *xcontext, int argc,
 / returns: 1 on success
 / raises an exception on failure
 */
+    const char *msg;
     int ret;
     const char *topo_name;
     const char *topolayer_name;
     const char *out_table;
     sqlite3_int64 fid;
-    GaiaTopologyAccessorPtr accessor;
+    GaiaTopologyAccessorPtr accessor = NULL;
     sqlite3_context *context = (sqlite3_context *) xcontext;
     sqlite3_value **argv = (sqlite3_value **) xargv;
     sqlite3 *sqlite = sqlite3_context_db_handle (context);
@@ -5419,6 +6881,7 @@ fnctaux_TopoGeo_InsertFeatureFromTopoLayer (const void *xcontext, int argc,
     accessor = gaiaGetTopology (sqlite, cache, topo_name);
     if (accessor == NULL)
 	goto no_topo;
+    gaiatopo_reset_last_error_msg (accessor);
 
 /* checking the input TopoLayer */
     if (!topolayer_exists (accessor, topolayer_name))
@@ -5428,7 +6891,6 @@ fnctaux_TopoGeo_InsertFeatureFromTopoLayer (const void *xcontext, int argc,
     if (check_output_geo_table (sqlite, out_table))
 	goto invalid_output;
 
-    gaiatopo_reset_last_error_msg (accessor);
     start_topo_savepoint (sqlite, cache);
     ret =
 	gaiaTopoGeo_InsertFeatureFromTopoLayer (accessor, topolayer_name,
@@ -5439,7 +6901,7 @@ fnctaux_TopoGeo_InsertFeatureFromTopoLayer (const void *xcontext, int argc,
 	release_topo_savepoint (sqlite, cache);
     if (!ret)
       {
-	  const char *msg = gaiaGetLwGeomErrorMsg ();
+	  msg = gaiaGetRtTopoErrorMsg (cache);
 	  gaiatopo_set_last_error_msg (accessor, msg);
 	  sqlite3_result_error (context, msg, -1);
 	  return;
@@ -5448,32 +6910,35 @@ fnctaux_TopoGeo_InsertFeatureFromTopoLayer (const void *xcontext, int argc,
     return;
 
   no_topo:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid topology name.",
-			  -1);
+    msg = "SQL/MM Spatial exception - invalid topology name.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_output:
-    sqlite3_result_error (context,
-			  "TopoGeo_InsertFeatureFromTopoLayer: the output GeoTable does not exists.",
-			  -1);
+    msg =
+	"TopoGeo_InsertFeatureFromTopoLayer: the output GeoTable does not exists.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   err_topolayer:
-    sqlite3_result_error (context,
-			  "TopoGeo_InsertFeatureFromTopoLayer: non-existing TopoLayer.",
-			  -1);
+    msg = "TopoGeo_InsertFeatureFromTopoLayer: non-existing TopoLayer.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   null_arg:
-    sqlite3_result_error (context, "SQL/MM Spatial exception - null argument.",
-			  -1);
+    msg = "SQL/MM Spatial exception - null argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 
   invalid_arg:
-    sqlite3_result_error (context,
-			  "SQL/MM Spatial exception - invalid argument.", -1);
+    msg = "SQL/MM Spatial exception - invalid argument.";
+    gaiatopo_set_last_error_msg (accessor, msg);
+    sqlite3_result_error (context, msg, -1);
     return;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/gaia_topostmts.c b/src/topology/gaia_topostmts.c
index 41eb7db..94d03f9 100644
--- a/src/topology/gaia_topostmts.c
+++ b/src/topology/gaia_topostmts.c
@@ -65,7 +65,7 @@ CIG: 6038019AE5
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -75,8 +75,7 @@ CIG: 6038019AE5
 
 #include <spatialite_private.h>
 
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
+#include <librttopo.h>
 
 #include "topology_private.h"
 
@@ -639,4 +638,4 @@ do_create_stmt_getFaceWithinBox2D (GaiaTopologyAccessorPtr accessor)
     return stmt;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/lwn_network.c b/src/topology/lwn_network.c
index 947127a..bb499cd 100644
--- a/src/topology/lwn_network.c
+++ b/src/topology/lwn_network.c
@@ -54,7 +54,9 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
+
+#include <librttopo_geom.h>
 
 #include "lwn_network.h"
 #include "lwn_network_private.h"
@@ -66,7 +68,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #endif
 #include <geos_c.h>
 
-#include <liblwgeom.h>
+#include <librttopo_geom.h>
 
 #include <spatialite_private.h>
 
@@ -77,9 +79,10 @@ the terms of any one of the MPL, the GPL or the LGPL.
  ********************************************************************/
 
 LWN_BE_IFACE *
-lwn_CreateBackendIface (const LWN_BE_DATA * data)
+lwn_CreateBackendIface (const RTCTX * ctx, const LWN_BE_DATA * data)
 {
     LWN_BE_IFACE *iface = malloc (sizeof (LWN_BE_IFACE));
+    iface->ctx = ctx;
     iface->data = data;
     iface->cb = NULL;
     iface->errorMsg = NULL;
@@ -1138,20 +1141,29 @@ static int
 geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 		const LWN_POINT * pt, LWN_LINE * newline1, LWN_LINE * newline2)
 {
-    POINTARRAY *pa;
-    POINT4D point;
+    const RTCTX *ctx = NULL;
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     int iv;
-    LWGEOM *lwg_ln;
-    LWGEOM *lwg_pt;
-    LWGEOM *split;
-    LWCOLLECTION *split_col;
-    LWGEOM *lwg = NULL;
-    LWLINE *lwl = NULL;
-    POINT4D pt4d;
+    RTGEOM *rtg_ln;
+    RTGEOM *rtg_pt;
+    RTGEOM *split;
+    RTCOLLECTION *split_col;
+    RTGEOM *rtg = NULL;
+    RTLINE *rtl = NULL;
+    RTPOINT4D pt4d;
     int ret = 0;
 
-/* creating an LWGEOM Linestring from oldline */
-    pa = ptarray_construct (oldline->has_z, 0, oldline->points);
+    if (net == NULL)
+	return 0;
+    if (net->be_iface == NULL)
+	return 0;
+    ctx = net->be_iface->ctx;
+    if (ctx == NULL)
+	return 0;
+
+/* creating an RTGEOM Linestring from oldline */
+    pa = ptarray_construct (ctx, oldline->has_z, 0, oldline->points);
     for (iv = 0; iv < oldline->points; iv++)
       {
 	  /* copying vertices */
@@ -1159,32 +1171,29 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 	  point.y = oldline->y[iv];
 	  if (oldline->has_z)
 	      point.z = oldline->z[iv];
-	  ptarray_set_point4d (pa, iv, &point);
+	  ptarray_set_point4d (ctx, pa, iv, &point);
       }
-    lwg_ln = (LWGEOM *) lwline_construct (oldline->srid, NULL, pa);
+    rtg_ln = (RTGEOM *) rtline_construct (ctx, oldline->srid, NULL, pa);
 
-/* creating an LWGEOM Point from pt */
-    pa = ptarray_construct (pt->has_z, 0, 1);
+/* creating an RTGEOM Point from pt */
+    pa = ptarray_construct (ctx, pt->has_z, 0, 1);
     point.x = pt->x;
     point.y = pt->y;
     if (pt->has_z)
 	point.z = pt->z;
-    ptarray_set_point4d (pa, 0, &point);
-    lwg_pt = (LWGEOM *) lwpoint_construct (oldline->srid, NULL, pa);
-
-/* locking the semaphore */
-    splite_lwgeom_semaphore_lock ();
+    ptarray_set_point4d (ctx, pa, 0, &point);
+    rtg_pt = (RTGEOM *) rtpoint_construct (ctx, oldline->srid, NULL, pa);
 
 /* Split link */
-    split = lwgeom_split (lwg_ln, lwg_pt);
-    lwgeom_free (lwg_ln);
-    lwgeom_free (lwg_pt);
+    split = rtgeom_split (ctx, rtg_ln, rtg_pt);
+    rtgeom_free (ctx, rtg_ln);
+    rtgeom_free (ctx, rtg_pt);
     if (!split)
       {
 	  lwn_SetErrorMsg (net->be_iface, "could not split link by point ?");
 	  goto end;
       }
-    split_col = lwgeom_as_lwcollection (split);
+    split_col = rtgeom_as_rtcollection (ctx, split);
     if (!split_col)
       {
 	  lwn_SetErrorMsg (net->be_iface,
@@ -1199,11 +1208,11 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
       }
 
 /* retrieving the first half of the split link */
-    lwg = split_col->geoms[0];
-    if (lwg->type == LINETYPE)
+    rtg = split_col->geoms[0];
+    if (rtg->type == RTLINETYPE)
       {
-	  lwl = (LWLINE *) lwg;
-	  pa = lwl->points;
+	  rtl = (RTLINE *) rtg;
+	  pa = rtl->points;
 	  newline1->points = pa->npoints;
 	  newline1->x = malloc (sizeof (double) * newline1->points);
 	  newline1->y = malloc (sizeof (double) * newline1->points);
@@ -1212,7 +1221,7 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 	  for (iv = 0; iv < newline1->points; iv++)
 	    {
 		/* copying LINESTRING vertices */
-		getPoint4d_p (pa, iv, &pt4d);
+		rt_getPoint4d_p (ctx, pa, iv, &pt4d);
 		newline1->x[iv] = pt4d.x;
 		newline1->y[iv] = pt4d.y;
 		if (newline1->has_z)
@@ -1223,11 +1232,11 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 	goto end;
 
 /* retrieving the second half of the split link */
-    lwg = split_col->geoms[1];
-    if (lwg->type == LINETYPE)
+    rtg = split_col->geoms[1];
+    if (rtg->type == RTLINETYPE)
       {
-	  lwl = (LWLINE *) lwg;
-	  pa = lwl->points;
+	  rtl = (RTLINE *) rtg;
+	  pa = rtl->points;
 	  newline2->points = pa->npoints;
 	  newline2->x = malloc (sizeof (double) * newline2->points);
 	  newline2->y = malloc (sizeof (double) * newline2->points);
@@ -1236,7 +1245,7 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 	  for (iv = 0; iv < newline2->points; iv++)
 	    {
 		/* copying LINESTRING vertices */
-		getPoint4d_p (pa, iv, &pt4d);
+		rt_getPoint4d_p (ctx, pa, iv, &pt4d);
 		newline2->x[iv] = pt4d.x;
 		newline2->y[iv] = pt4d.y;
 		if (newline2->has_z)
@@ -1250,9 +1259,7 @@ geo_link_split (LWN_NETWORK * net, const LWN_LINE * oldline,
 
   end:
     if (split != NULL)
-	lwgeom_free (split);
-/* unlocking the semaphore */
-    splite_lwgeom_semaphore_unlock ();
+	rtgeom_free (ctx, split);
     return ret;
 }
 
@@ -1897,4 +1904,4 @@ lwn_be_existsLinkIntersectingPoint (const LWN_NETWORK * net,
     return exists;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/lwn_network.h b/src/topology/lwn_network.h
index 50e5f8a..458b4f9 100644
--- a/src/topology/lwn_network.h
+++ b/src/topology/lwn_network.h
@@ -487,9 +487,10 @@ typedef struct LWN_BE_CALLBACKS_T
  *
  * Ownership to caller delete with lwn_FreeBackendIface
  *
+ * @param ctx librtgeom context, create with rtgeom_init
  * @param data Backend data, passed as first parameter to all callback functions
  */
-LWN_BE_IFACE *lwn_CreateBackendIface (const LWN_BE_DATA * data);
+LWN_BE_IFACE *lwn_CreateBackendIface (const RTCTX* ctx, const LWN_BE_DATA * data);
 
 /**
  * Register backend callbacks into the opaque iface handler
diff --git a/src/topology/lwn_network_private.h b/src/topology/lwn_network_private.h
index 069b3cf..0ce14ea 100644
--- a/src/topology/lwn_network_private.h
+++ b/src/topology/lwn_network_private.h
@@ -55,6 +55,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 
 struct LWN_BE_IFACE_T
 {
+	const RTCTX* ctx;
     const LWN_BE_DATA *data;
     const LWN_BE_CALLBACKS *cb;
     char *errorMsg;
diff --git a/src/topology/net_callbacks.c b/src/topology/net_callbacks.c
index 3dac4d8..21da1c6 100644
--- a/src/topology/net_callbacks.c
+++ b/src/topology/net_callbacks.c
@@ -53,7 +53,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -64,6 +64,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include <spatialite.h>
 #include <spatialite_private.h>
 
+#include <librttopo.h>
 #include <lwn_network.h>
 
 #include "network_private.h"
@@ -2330,4 +2331,4 @@ netcallback_netGetGEOS (const LWN_BE_NETWORK * lwn_net)
     return cache->GEOS_handle;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end RTTOPO conditionals */
diff --git a/src/topology/topo_callbacks.c b/src/topology/topo_callbacks.c
index 459930b..e639699 100644
--- a/src/topology/topo_callbacks.c
+++ b/src/topology/topo_callbacks.c
@@ -58,6 +58,7 @@ CIG: 6038019AE5
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 
 #if defined(_WIN32) && !defined(__MINGW32__)
 #include "config-msvc.h"
@@ -65,7 +66,7 @@ CIG: 6038019AE5
 #include "config.h"
 #endif
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
 
 #include <spatialite/sqlite.h>
 #include <spatialite/debug.h>
@@ -76,8 +77,7 @@ CIG: 6038019AE5
 #include <spatialite.h>
 #include <spatialite_private.h>
 
-#include <liblwgeom.h>
-#include <liblwgeom_topo.h>
+#include <librttopo.h>
 
 #include "topology_private.h"
 
@@ -400,19 +400,20 @@ add_face (struct topo_faces_list *list, sqlite3_int64 id, sqlite3_int64 face_id,
     list->count++;
 }
 
-TOPOLOGY_PRIVATE LWLINE *
-gaia_convert_linestring_to_lwline (gaiaLinestringPtr ln, int srid, int has_z)
+TOPOLOGY_PRIVATE RTLINE *
+gaia_convert_linestring_to_rtline (const RTCTX * ctx, gaiaLinestringPtr ln,
+				   int srid, int has_z)
 {
-/* converting a Linestring into an LWLINE */
-    POINTARRAY *pa;
-    POINT4D point;
+/* converting a Linestring into an RTLINE */
+    RTPOINTARRAY *pa;
+    RTPOINT4D point;
     int iv;
     double x;
     double y;
     double z;
     double m;
 
-    pa = ptarray_construct (has_z, 0, ln->Points);
+    pa = ptarray_construct (ctx, has_z, 0, ln->Points);
     for (iv = 0; iv < ln->Points; iv++)
       {
 	  /* copying vertices */
@@ -436,9 +437,9 @@ gaia_convert_linestring_to_lwline (gaiaLinestringPtr ln, int srid, int has_z)
 	  point.y = y;
 	  if (has_z)
 	      point.z = z;
-	  ptarray_set_point4d (pa, iv, &point);
+	  ptarray_set_point4d (ctx, pa, iv, &point);
       }
-    return lwline_construct (srid, NULL, pa);
+    return rtline_construct (ctx, srid, NULL, pa);
 }
 
 static int
@@ -491,13 +492,14 @@ check_unclosed_ring (gaiaRingPtr rng)
     return 1;
 }
 
-TOPOLOGY_PRIVATE LWPOLY *
-gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
+TOPOLOGY_PRIVATE RTPOLY *
+gaia_convert_polygon_to_rtpoly (const RTCTX * ctx, gaiaPolygonPtr pg, int srid,
+				int has_z)
 {
-/* converting a Polygon into an LWPOLY */
+/* converting a Polygon into an RTPOLY */
     int ngeoms;
-    POINTARRAY **ppaa;
-    POINT4D point;
+    RTPOINTARRAY **ppaa;
+    RTPOINT4D point;
     gaiaRingPtr rng;
     int close_ring;
     int ib;
@@ -508,13 +510,13 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
     double m;
 
     ngeoms = pg->NumInteriors;
-    ppaa = lwalloc (sizeof (POINTARRAY *) * (ngeoms + 1));
+    ppaa = rtalloc (ctx, sizeof (RTPOINTARRAY *) * (ngeoms + 1));
     rng = pg->Exterior;
     close_ring = check_unclosed_ring (rng);
     if (close_ring)
-	ppaa[0] = ptarray_construct (has_z, 0, rng->Points + 1);
+	ppaa[0] = ptarray_construct (ctx, has_z, 0, rng->Points + 1);
     else
-	ppaa[0] = ptarray_construct (has_z, 0, rng->Points);
+	ppaa[0] = ptarray_construct (ctx, has_z, 0, rng->Points);
     for (iv = 0; iv < rng->Points; iv++)
       {
 	  /* copying vertices */
@@ -538,7 +540,7 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
 	  point.y = y;
 	  if (has_z)
 	      point.z = z;
-	  ptarray_set_point4d (ppaa[0], iv, &point);
+	  ptarray_set_point4d (ctx, ppaa[0], iv, &point);
       }
     if (close_ring)
       {
@@ -563,7 +565,7 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
 	  point.y = y;
 	  if (has_z)
 	      point.z = z;
-	  ptarray_set_point4d (ppaa[0], rng->Points, &point);
+	  ptarray_set_point4d (ctx, ppaa[0], rng->Points, &point);
       }
     for (ib = 0; ib < pg->NumInteriors; ib++)
       {
@@ -571,9 +573,9 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
 	  rng = pg->Interiors + ib;
 	  close_ring = check_unclosed_ring (rng);
 	  if (close_ring)
-	      ppaa[1 + ib] = ptarray_construct (has_z, 0, rng->Points + 1);
+	      ppaa[1 + ib] = ptarray_construct (ctx, has_z, 0, rng->Points + 1);
 	  else
-	      ppaa[1 + ib] = ptarray_construct (has_z, 0, rng->Points);
+	      ppaa[1 + ib] = ptarray_construct (ctx, has_z, 0, rng->Points);
 	  for (iv = 0; iv < rng->Points; iv++)
 	    {
 		/* copying vertices */
@@ -597,7 +599,7 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
 		point.y = y;
 		if (has_z)
 		    point.z = z;
-		ptarray_set_point4d (ppaa[1 + ib], iv, &point);
+		ptarray_set_point4d (ctx, ppaa[1 + ib], iv, &point);
 	    }
 	  if (close_ring)
 	    {
@@ -622,18 +624,18 @@ gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg, int srid, int has_z)
 		point.y = y;
 		if (has_z)
 		    point.z = z;
-		ptarray_set_point4d (ppaa[1 + ib], rng->Points, &point);
+		ptarray_set_point4d (ctx, ppaa[1 + ib], rng->Points, &point);
 	    }
       }
-    return lwpoly_construct (srid, NULL, ngeoms + 1, ppaa);
+    return rtpoly_construct (ctx, srid, NULL, ngeoms + 1, ppaa);
 }
 
 static gaiaGeomCollPtr
-do_lwline_to_geom (LWLINE * lwline, int srid)
+do_rtline_to_geom (const RTCTX * ctx, RTLINE * rtline, int srid)
 {
-/* converting a LWLINE into a Geometry (Linestring) */
-    POINTARRAY *pa;
-    POINT4D pt4d;
+/* converting a RTLINE into a Geometry (Linestring) */
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int has_z = 0;
     double x;
     double y;
@@ -642,8 +644,8 @@ do_lwline_to_geom (LWLINE * lwline, int srid)
     gaiaGeomCollPtr geom;
     gaiaLinestringPtr ln;
 
-    pa = lwline->points;
-    if (FLAGS_GET_Z (pa->flags))
+    pa = rtline->points;
+    if (RTFLAGS_GET_Z (pa->flags))
 	has_z = 1;
     if (has_z)
 	geom = gaiaAllocGeomCollXYZ ();
@@ -653,7 +655,7 @@ do_lwline_to_geom (LWLINE * lwline, int srid)
     for (iv = 0; iv < pa->npoints; iv++)
       {
 	  /* copying LINESTRING vertices */
-	  getPoint4d_p (pa, iv, &pt4d);
+	  rt_getPoint4d_p (ctx, pa, iv, &pt4d);
 	  x = pt4d.x;
 	  y = pt4d.y;
 	  if (has_z)
@@ -685,7 +687,7 @@ do_prepare_read_node (const char *topology_name, int fields, int has_z)
 
     sql = sqlite3_mprintf ("SELECT ");
     prev = sql;
-    if (fields & LWT_COL_NODE_NODE_ID)
+    if (fields & RTT_COL_NODE_NODE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, node_id", prev);
@@ -695,7 +697,7 @@ do_prepare_read_node (const char *topology_name, int fields, int has_z)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_NODE_CONTAINING_FACE)
+    if (fields & RTT_COL_NODE_CONTAINING_FACE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, containing_face", prev);
@@ -705,7 +707,7 @@ do_prepare_read_node (const char *topology_name, int fields, int has_z)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_NODE_GEOM)
+    if (fields & RTT_COL_NODE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, ST_X(geom), ST_Y(geom)", prev);
@@ -763,7 +765,7 @@ do_read_node (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		double x = 0.0;
 		double y = 0.0;
 		double z = 0.0;
-		if (fields & LWT_COL_NODE_NODE_ID)
+		if (fields & RTT_COL_NODE_NODE_ID)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 			{
@@ -774,7 +776,7 @@ do_read_node (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		  }
 		else
 		    ok_id = 1;
-		if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (fields & RTT_COL_NODE_CONTAINING_FACE)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_NULL)
 			{
@@ -790,7 +792,7 @@ do_read_node (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		  }
 		else
 		    ok_face = 1;
-		if (fields & LWT_COL_NODE_GEOM)
+		if (fields & RTT_COL_NODE_GEOM)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_FLOAT)
 			{
@@ -856,8 +858,8 @@ do_read_node (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 
 static int
 do_read_node_by_face (sqlite3_stmt * stmt, struct topo_nodes_list *list,
-		      sqlite3_int64 id, int fields, const GBOX * box, int has_z,
-		      const char *callback_name, char **errmsg)
+		      sqlite3_int64 id, int fields, const RTGBOX * box,
+		      int has_z, const char *callback_name, char **errmsg)
 {
 /* reading Nodes out from the DBMS */
     int icol = 0;
@@ -893,7 +895,7 @@ do_read_node_by_face (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		double x = 0.0;
 		double y = 0.0;
 		double z = 0.0;
-		if (fields & LWT_COL_NODE_NODE_ID)
+		if (fields & RTT_COL_NODE_NODE_ID)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 			{
@@ -904,7 +906,7 @@ do_read_node_by_face (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		  }
 		else
 		    ok_id = 1;
-		if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (fields & RTT_COL_NODE_CONTAINING_FACE)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_NULL)
 			{
@@ -920,7 +922,7 @@ do_read_node_by_face (sqlite3_stmt * stmt, struct topo_nodes_list *list,
 		  }
 		else
 		    ok_face = 1;
-		if (fields & LWT_COL_NODE_GEOM)
+		if (fields & RTT_COL_NODE_GEOM)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_FLOAT)
 			{
@@ -1004,7 +1006,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
     comma = 1;
     sqlite3_free (prev);
     prev = sql;
-    if (fields & LWT_COL_EDGE_START_NODE)
+    if (fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, start_node", prev);
@@ -1014,7 +1016,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_END_NODE)
+    if (fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, end_node", prev);
@@ -1024,7 +1026,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_LEFT)
+    if (fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, left_face", prev);
@@ -1034,7 +1036,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, right_face", prev);
@@ -1044,7 +1046,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_left_edge", prev);
@@ -1054,7 +1056,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_right_edge", prev);
@@ -1064,7 +1066,7 @@ do_prepare_read_edge (const char *topology_name, int fields)
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_GEOM)
+    if (fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, geom", prev);
@@ -1115,7 +1117,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
 	  ok_id = 1;
       }
     icol++;
-    if (fields & LWT_COL_EDGE_START_NODE)
+    if (fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1126,7 +1128,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_start = 1;
-    if (fields & LWT_COL_EDGE_END_NODE)
+    if (fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1137,7 +1139,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_end = 1;
-    if (fields & LWT_COL_EDGE_FACE_LEFT)
+    if (fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1148,7 +1150,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_left = 1;
-    if (fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1159,7 +1161,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_right = 1;
-    if (fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1170,7 +1172,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_next_left = 1;
-    if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 	    {
@@ -1181,7 +1183,7 @@ do_read_edge_row (sqlite3_stmt * stmt, struct topo_edges_list *list, int fields,
       }
     else
 	ok_next_right = 1;
-    if (fields & LWT_COL_EDGE_GEOM)
+    if (fields & RTT_COL_EDGE_GEOM)
       {
 	  if (sqlite3_column_type (stmt, icol) == SQLITE_BLOB)
 	    {
@@ -1297,7 +1299,7 @@ do_read_edge_by_node (sqlite3_stmt * stmt, struct topo_edges_list *list,
 
 static int
 do_read_edge_by_face (sqlite3_stmt * stmt, struct topo_edges_list *list,
-		      sqlite3_int64 face_id, int fields, const GBOX * box,
+		      sqlite3_int64 face_id, int fields, const RTGBOX * box,
 		      const char *callback_name, char **errmsg)
 {
 /* reading a single Edge out from the DBMS */
@@ -1371,7 +1373,7 @@ do_read_face (sqlite3_stmt * stmt, struct topo_faces_list *list,
 		double miny = 0.0;
 		double maxx = 0.0;
 		double maxy = 0.0;
-		if (fields & LWT_COL_FACE_FACE_ID)
+		if (fields & RTT_COL_FACE_FACE_ID)
 		  {
 		      if (sqlite3_column_type (stmt, icol) == SQLITE_INTEGER)
 			{
@@ -1382,7 +1384,7 @@ do_read_face (sqlite3_stmt * stmt, struct topo_faces_list *list,
 		  }
 		else
 		    ok_id = 1;
-		if (fields & LWT_COL_FACE_MBR)
+		if (fields & RTT_COL_FACE_MBR)
 		  {
 		      if (id <= 0)
 			{
@@ -1452,13 +1454,13 @@ do_read_face (sqlite3_stmt * stmt, struct topo_faces_list *list,
 }
 
 const char *
-callback_lastErrorMessage (const LWT_BE_DATA * be)
+callback_lastErrorMessage (const RTT_BE_DATA * be)
 {
     return gaiatopo_get_last_exception ((GaiaTopologyAccessorPtr) be);
 }
 
-LWT_BE_TOPOLOGY *
-callback_loadTopologyByName (const LWT_BE_DATA * be, const char *name)
+RTT_BE_TOPOLOGY *
+callback_loadTopologyByName (const RTT_BE_DATA * be, const char *name)
 {
 /* callback function: loadTopologyByName */
     struct gaia_topology *ptr = (struct gaia_topology *) be;
@@ -1468,7 +1470,6 @@ callback_loadTopologyByName (const LWT_BE_DATA * be, const char *name)
     int has_z;
     struct splite_internal_cache *cache =
 	(struct splite_internal_cache *) ptr->cache;
-
     if (gaiaReadTopologyFromDBMS
 	(ptr->db_handle, name, &topology_name, &srid, &tolerance, &has_z))
       {
@@ -1486,42 +1487,53 @@ callback_loadTopologyByName (const LWT_BE_DATA * be, const char *name)
 		p2->next = ptr;
 	    }
 	  cache->lastTopology = ptr;
-	  return (LWT_BE_TOPOLOGY *) ptr;
+	  return (RTT_BE_TOPOLOGY *) ptr;
       }
     else
 	return NULL;
 }
 
 int
-callback_freeTopology (LWT_BE_TOPOLOGY * lwt_topo)
+callback_freeTopology (RTT_BE_TOPOLOGY * rtt_topo)
 {
 /* callback function: freeTopology - does nothing */
-    if (lwt_topo != NULL)
-	lwt_topo = NULL;	/* silencing stupid compiler warnings on unuse args */
+    if (rtt_topo != NULL)
+	rtt_topo = NULL;	/* silencing stupid compiler warnings on unuse args */
     return 1;
 }
 
-LWT_ISO_NODE *
-callback_getNodeById (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ELEMID * ids, int *numelems, int fields)
+RTT_ISO_NODE *
+callback_getNodeById (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ELEMID * ids, int *numelems, int fields)
 {
 /* callback function: getNodeById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt_aux = NULL;
     int ret;
     int i;
     char *sql;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     struct topo_nodes_list *list = NULL;
-    LWT_ISO_NODE *result = NULL;
+    RTT_ISO_NODE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     /* preparing the SQL statement */
     sql =
@@ -1537,7 +1549,6 @@ callback_getNodeById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -1563,25 +1574,26 @@ callback_getNodeById (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_node *p_nd;
-	  result = lwalloc (sizeof (LWT_ISO_NODE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_NODE) * list->count);
 	  p_nd = list->first;
 	  i = 0;
 	  while (p_nd != NULL)
 	    {
-		LWT_ISO_NODE *nd = result + i;
-		if (fields & LWT_COL_NODE_NODE_ID)
+		RTT_ISO_NODE *nd = result + i;
+		if (fields & RTT_COL_NODE_NODE_ID)
 		    nd->node_id = p_nd->node_id;
-		if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (fields & RTT_COL_NODE_CONTAINING_FACE)
 		    nd->containing_face = p_nd->containing_face;
-		if (fields & LWT_COL_NODE_GEOM)
+		if (fields & RTT_COL_NODE_GEOM)
 		  {
-		      pa = ptarray_construct (accessor->has_z, 0, 1);
+		      pa = ptarray_construct (ctx, accessor->has_z, 0, 1);
 		      pt4d.x = p_nd->x;
 		      pt4d.y = p_nd->y;
 		      if (accessor->has_z)
 			  pt4d.z = p_nd->z;
-		      ptarray_set_point4d (pa, 0, &pt4d);
-		      nd->geom = lwpoint_construct (accessor->srid, NULL, pa);
+		      ptarray_set_point4d (ctx, pa, 0, &pt4d);
+		      nd->geom =
+			  rtpoint_construct (ctx, accessor->srid, NULL, pa);
 		  }
 		i++;
 		p_nd = p_nd->next;
@@ -1590,7 +1602,6 @@ callback_getNodeById (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_nodes_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -1599,29 +1610,30 @@ callback_getNodeById (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_nodes_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ISO_NODE *
-callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
-				  const LWPOINT * pt, double dist,
+RTT_ISO_NODE *
+callback_getNodeWithinDistance2D (const RTT_BE_TOPOLOGY * rtt_topo,
+				  const RTPOINT * pt, double dist,
 				  int *numelems, int fields, int limit)
 {
 /* callback function: getNodeWithinDistance2D */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
     double cx;
     double cy;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int count = 0;
     sqlite3_stmt *stmt_aux = NULL;
     char *sql;
     struct topo_nodes_list *list = NULL;
-    LWT_ISO_NODE *result = NULL;
+    RTT_ISO_NODE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
@@ -1634,7 +1646,16 @@ callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     if (limit >= 0)
       {
@@ -1655,14 +1676,13 @@ callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 		gaiatopo_set_last_error_msg (topo, msg);
 		sqlite3_free (msg);
 		*numelems = -1;
-		accessor->inside_lwt_callback = 0;
 		return NULL;
 	    }
       }
 
-/* extracting X and Y from LWPOINT */
+/* extracting X and Y from RTPOINT */
     pa = pt->point;
-    getPoint4d_p (pa, 0, &pt4d);
+    rt_getPoint4d_p (ctx, pa, 0, &pt4d);
     cx = pt4d.x;
     cy = pt4d.y;
 
@@ -1734,25 +1754,26 @@ callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	    {
 		int i = 0;
 		struct topo_node *p_nd;
-		result = lwalloc (sizeof (LWT_ISO_NODE) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ISO_NODE) * list->count);
 		p_nd = list->first;
 		while (p_nd != NULL)
 		  {
-		      LWT_ISO_NODE *nd = result + i;
-		      if (fields & LWT_COL_NODE_NODE_ID)
+		      RTT_ISO_NODE *nd = result + i;
+		      if (fields & RTT_COL_NODE_NODE_ID)
 			  nd->node_id = p_nd->node_id;
-		      if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		      if (fields & RTT_COL_NODE_CONTAINING_FACE)
 			  nd->containing_face = p_nd->containing_face;
-		      if (fields & LWT_COL_NODE_GEOM)
+		      if (fields & RTT_COL_NODE_GEOM)
 			{
-			    pa = ptarray_construct (accessor->has_z, 0, 1);
+			    pa = ptarray_construct (ctx, accessor->has_z, 0, 1);
 			    pt4d.x = p_nd->x;
 			    pt4d.y = p_nd->y;
 			    if (accessor->has_z)
 				pt4d.z = p_nd->z;
-			    ptarray_set_point4d (pa, 0, &pt4d);
+			    ptarray_set_point4d (ctx, pa, 0, &pt4d);
 			    nd->geom =
-				lwpoint_construct (accessor->srid, NULL, pa);
+				rtpoint_construct (ctx, accessor->srid, NULL,
+						   pa);
 			}
 		      i++;
 		      p_nd = p_nd->next;
@@ -1764,7 +1785,6 @@ callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (stmt_aux != NULL)
 	sqlite3_finalize (stmt_aux);
     destroy_nodes_list (list);
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return result;
 
@@ -1775,16 +1795,17 @@ callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_nodes_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
 int
-callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
+callback_insertNodes (const RTT_BE_TOPOLOGY * rtt_topo, RTT_ISO_NODE * nodes,
 		      int numelems)
 {
 /* callback function: insertNodes */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
@@ -1792,8 +1813,8 @@ callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
     double x;
     double y;
     double z;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     gaiaGeomCollPtr geom;
     unsigned char *p_blob;
     int n_bytes;
@@ -1804,7 +1825,16 @@ callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
     stmt = accessor->stmt_insertNodes;
     if (stmt == NULL)
 	return 0;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
     if (accessor->cache != NULL)
       {
@@ -1815,7 +1845,7 @@ callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
 
     for (i = 0; i < numelems; i++)
       {
-	  LWT_ISO_NODE *nd = nodes + i;
+	  RTT_ISO_NODE *nd = nodes + i;
 	  /* setting up the prepared statement */
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
@@ -1831,9 +1861,9 @@ callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
 	      geom = gaiaAllocGeomCollXYZ ();
 	  else
 	      geom = gaiaAllocGeomColl ();
-	  /* extracting X and Y from LWPOINT */
+	  /* extracting X and Y from RTPOINT */
 	  pa = nd->geom->point;
-	  getPoint4d_p (pa, 0, &pt4d);
+	  rt_getPoint4d_p (ctx, pa, 0, &pt4d);
 	  x = pt4d.x;
 	  y = pt4d.y;
 	  if (accessor->has_z)
@@ -1864,35 +1894,44 @@ callback_insertNodes (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_NODE * nodes,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return 1;
 
   error:
     sqlite3_reset (stmt);
-    accessor->inside_lwt_callback = 0;
     return 0;
 }
 
-LWT_ISO_EDGE *
-callback_getEdgeById (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ELEMID * ids, int *numelems, int fields)
+RTT_ISO_EDGE *
+callback_getEdgeById (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ELEMID * ids, int *numelems, int fields)
 {
 /* callback function: getEdgeById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     int ret;
     int i;
     sqlite3_stmt *stmt_aux = NULL;
     char *sql;
     struct topo_edges_list *list = NULL;
-    LWT_ISO_EDGE *result = NULL;
+    RTT_ISO_EDGE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     /* preparing the SQL statement */
     sql = do_prepare_read_edge (accessor->topology_name, fields);
@@ -1907,7 +1946,6 @@ callback_getEdgeById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -1933,29 +1971,29 @@ callback_getEdgeById (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_edge *p_ed;
-	  result = lwalloc (sizeof (LWT_ISO_EDGE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_EDGE) * list->count);
 	  p_ed = list->first;
 	  i = 0;
 	  while (p_ed != NULL)
 	    {
-		LWT_ISO_EDGE *ed = result + i;
-		if (fields & LWT_COL_EDGE_EDGE_ID)
+		RTT_ISO_EDGE *ed = result + i;
+		if (fields & RTT_COL_EDGE_EDGE_ID)
 		    ed->edge_id = p_ed->edge_id;
-		if (fields & LWT_COL_EDGE_START_NODE)
+		if (fields & RTT_COL_EDGE_START_NODE)
 		    ed->start_node = p_ed->start_node;
-		if (fields & LWT_COL_EDGE_END_NODE)
+		if (fields & RTT_COL_EDGE_END_NODE)
 		    ed->end_node = p_ed->end_node;
-		if (fields & LWT_COL_EDGE_FACE_LEFT)
+		if (fields & RTT_COL_EDGE_FACE_LEFT)
 		    ed->face_left = p_ed->face_left;
-		if (fields & LWT_COL_EDGE_FACE_RIGHT)
+		if (fields & RTT_COL_EDGE_FACE_RIGHT)
 		    ed->face_right = p_ed->face_right;
-		if (fields & LWT_COL_EDGE_NEXT_LEFT)
+		if (fields & RTT_COL_EDGE_NEXT_LEFT)
 		    ed->next_left = p_ed->next_left;
-		if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+		if (fields & RTT_COL_EDGE_NEXT_RIGHT)
 		    ed->next_right = p_ed->next_right;
-		if (fields & LWT_COL_EDGE_GEOM)
+		if (fields & RTT_COL_EDGE_GEOM)
 		    ed->geom =
-			gaia_convert_linestring_to_lwline (p_ed->geom,
+			gaia_convert_linestring_to_rtline (ctx, p_ed->geom,
 							   accessor->srid,
 							   accessor->has_z);
 		i++;
@@ -1965,7 +2003,6 @@ callback_getEdgeById (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -1974,29 +2011,30 @@ callback_getEdgeById (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ISO_EDGE *
-callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
-				  const LWPOINT * pt, double dist,
+RTT_ISO_EDGE *
+callback_getEdgeWithinDistance2D (const RTT_BE_TOPOLOGY * rtt_topo,
+				  const RTPOINT * pt, double dist,
 				  int *numelems, int fields, int limit)
 {
 /* callback function: getEdgeWithinDistance2D */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
     double cx;
     double cy;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int count = 0;
     sqlite3_stmt *stmt_aux = NULL;
     char *sql;
     struct topo_edges_list *list = NULL;
-    LWT_ISO_EDGE *result = NULL;
+    RTT_ISO_EDGE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
@@ -2009,7 +2047,26 @@ callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     if (limit >= 0)
       {
@@ -2027,14 +2084,13 @@ callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 		gaiatopo_set_last_error_msg (topo, msg);
 		sqlite3_free (msg);
 		*numelems = -1;
-		accessor->inside_lwt_callback = 0;
 		return NULL;
 	    }
       }
 
-/* extracting X and Y from LWPOINT */
+/* extracting X and Y from RTPOINT */
     pa = pt->point;
-    getPoint4d_p (pa, 0, &pt4d);
+    rt_getPoint4d_p (ctx, pa, 0, &pt4d);
     cx = pt4d.x;
     cy = pt4d.y;
 
@@ -2106,28 +2162,29 @@ callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	    {
 		int i = 0;
 		struct topo_edge *p_ed;
-		result = lwalloc (sizeof (LWT_ISO_EDGE) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ISO_EDGE) * list->count);
 		p_ed = list->first;
 		while (p_ed != NULL)
 		  {
-		      LWT_ISO_EDGE *ed = result + i;
-		      if (fields & LWT_COL_EDGE_EDGE_ID)
+		      RTT_ISO_EDGE *ed = result + i;
+		      if (fields & RTT_COL_EDGE_EDGE_ID)
 			  ed->edge_id = p_ed->edge_id;
-		      if (fields & LWT_COL_EDGE_START_NODE)
+		      if (fields & RTT_COL_EDGE_START_NODE)
 			  ed->start_node = p_ed->start_node;
-		      if (fields & LWT_COL_EDGE_END_NODE)
+		      if (fields & RTT_COL_EDGE_END_NODE)
 			  ed->end_node = p_ed->end_node;
-		      if (fields & LWT_COL_EDGE_FACE_LEFT)
+		      if (fields & RTT_COL_EDGE_FACE_LEFT)
 			  ed->face_left = p_ed->face_left;
-		      if (fields & LWT_COL_EDGE_FACE_RIGHT)
+		      if (fields & RTT_COL_EDGE_FACE_RIGHT)
 			  ed->face_right = p_ed->face_right;
-		      if (fields & LWT_COL_EDGE_NEXT_LEFT)
+		      if (fields & RTT_COL_EDGE_NEXT_LEFT)
 			  ed->next_left = p_ed->next_left;
-		      if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+		      if (fields & RTT_COL_EDGE_NEXT_RIGHT)
 			  ed->next_right = p_ed->next_right;
-		      if (fields & LWT_COL_EDGE_GEOM)
+		      if (fields & RTT_COL_EDGE_GEOM)
 			  ed->geom =
-			      gaia_convert_linestring_to_lwline (p_ed->geom,
+			      gaia_convert_linestring_to_rtline (ctx,
+								 p_ed->geom,
 								 accessor->srid,
 								 accessor->
 								 has_z);
@@ -2141,7 +2198,6 @@ callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (stmt_aux != NULL)
 	sqlite3_finalize (stmt_aux);
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -2151,15 +2207,16 @@ callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ELEMID
-callback_getNextEdgeId (const LWT_BE_TOPOLOGY * lwt_topo)
+RTT_ELEMID
+callback_getNextEdgeId (const RTT_BE_TOPOLOGY * rtt_topo)
 {
 /* callback function: getNextEdgeId */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt_in;
     sqlite3_stmt *stmt_out;
@@ -2174,7 +2231,16 @@ callback_getNextEdgeId (const LWT_BE_TOPOLOGY * lwt_topo)
     stmt_out = accessor->stmt_setNextEdgeId;
     if (stmt_out == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return -1;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return -1;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return -1;
 
 /* setting up the prepared statement */
     sqlite3_reset (stmt_in);
@@ -2207,7 +2273,6 @@ callback_getNextEdgeId (const LWT_BE_TOPOLOGY * lwt_topo)
     ret = sqlite3_step (stmt_out);
     if (ret == SQLITE_DONE || ret == SQLITE_ROW)
       {
-	  accessor->inside_lwt_callback = 0;
 	  sqlite3_reset (stmt_in);
 	  sqlite3_reset (stmt_out);
 	  return edge_id;
@@ -2223,18 +2288,19 @@ callback_getNextEdgeId (const LWT_BE_TOPOLOGY * lwt_topo)
   stop:
     if (edge_id >= 0)
 	edge_id++;
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt_in);
     sqlite3_reset (stmt_out);
     return edge_id;
 }
 
 int
-callback_insertEdges (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_EDGE * edges,
+callback_insertEdges (const RTT_BE_TOPOLOGY * rtt_topo, RTT_ISO_EDGE * edges,
 		      int numelems)
 {
 /* callback function: insertEdges */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
@@ -2249,7 +2315,16 @@ callback_insertEdges (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_EDGE * edges,
     stmt = accessor->stmt_insertEdges;
     if (stmt == NULL)
 	return 0;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
     if (accessor->cache != NULL)
       {
@@ -2260,7 +2335,7 @@ callback_insertEdges (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_EDGE * edges,
 
     for (i = 0; i < numelems; i++)
       {
-	  LWT_ISO_EDGE *eg = edges + i;
+	  RTT_ISO_EDGE *eg = edges + i;
 	  /* setting up the prepared statement */
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
@@ -2280,8 +2355,8 @@ callback_insertEdges (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_EDGE * edges,
 	      sqlite3_bind_int64 (stmt, 5, eg->face_right);
 	  sqlite3_bind_int64 (stmt, 6, eg->next_left);
 	  sqlite3_bind_int64 (stmt, 7, eg->next_right);
-	  /* transforming the LWLINE into a Geometry-Linestring */
-	  geom = do_lwline_to_geom (eg->geom, accessor->srid);
+	  /* transforming the RTLINE into a Geometry-Linestring */
+	  geom = do_rtline_to_geom (ctx, eg->geom, accessor->srid);
 	  gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
 	  gaiaFreeGeomColl (geom);
 	  sqlite3_bind_blob (stmt, 8, p_blob, n_bytes, free);
@@ -2301,24 +2376,24 @@ callback_insertEdges (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_EDGE * edges,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return 1;
 
   error:
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return 0;
 }
 
 int
-callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ISO_EDGE * sel_edge, int sel_fields,
-		      const LWT_ISO_EDGE * upd_edge, int upd_fields,
-		      const LWT_ISO_EDGE * exc_edge, int exc_fields)
+callback_updateEdges (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ISO_EDGE * sel_edge, int sel_fields,
+		      const RTT_ISO_EDGE * upd_edge, int upd_fields,
+		      const RTT_ISO_EDGE * exc_edge, int exc_fields)
 {
 /* callback function: updateEdges */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -2334,7 +2409,16 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     int changed = 0;
     if (accessor == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
     if (accessor->cache != NULL)
       {
@@ -2350,7 +2434,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     sql = sqlite3_mprintf ("UPDATE MAIN.\"%s\" SET ", xtable);
     free (xtable);
     prev = sql;
-    if (upd_fields & LWT_COL_EDGE_EDGE_ID)
+    if (upd_fields & RTT_COL_EDGE_EDGE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, edge_id = ?", prev);
@@ -2360,7 +2444,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_START_NODE)
+    if (upd_fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, start_node = ?", prev);
@@ -2370,7 +2454,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_END_NODE)
+    if (upd_fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, end_node = ?", prev);
@@ -2380,7 +2464,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_LEFT)
+    if (upd_fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, left_face = ?", prev);
@@ -2390,7 +2474,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, right_face = ?", prev);
@@ -2400,7 +2484,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_left_edge = ?", prev);
@@ -2410,7 +2494,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_right_edge = ?", prev);
@@ -2420,7 +2504,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_GEOM)
+    if (upd_fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, geom = ?", prev);
@@ -2438,7 +2522,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  if (sel_edge)
 	    {
 		comma = 0;
-		if (sel_fields & LWT_COL_EDGE_EDGE_ID)
+		if (sel_fields & RTT_COL_EDGE_EDGE_ID)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND edge_id = ?", prev);
@@ -2448,7 +2532,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_START_NODE)
+		if (sel_fields & RTT_COL_EDGE_START_NODE)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND start_node = ?", prev);
@@ -2458,7 +2542,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_END_NODE)
+		if (sel_fields & RTT_COL_EDGE_END_NODE)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND end_node = ?", prev);
@@ -2468,7 +2552,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_FACE_LEFT)
+		if (sel_fields & RTT_COL_EDGE_FACE_LEFT)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND left_face = ?", prev);
@@ -2478,7 +2562,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_FACE_RIGHT)
+		if (sel_fields & RTT_COL_EDGE_FACE_RIGHT)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND right_face = ?", prev);
@@ -2488,7 +2572,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_NEXT_LEFT)
+		if (sel_fields & RTT_COL_EDGE_NEXT_LEFT)
 		  {
 		      if (comma)
 			  sql =
@@ -2500,7 +2584,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_EDGE_NEXT_RIGHT)
+		if (sel_fields & RTT_COL_EDGE_NEXT_RIGHT)
 		  {
 		      if (comma)
 			  sql =
@@ -2523,7 +2607,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      prev = sql;
 		  }
 		comma = 0;
-		if (exc_fields & LWT_COL_EDGE_EDGE_ID)
+		if (exc_fields & RTT_COL_EDGE_EDGE_ID)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND edge_id <> ?", prev);
@@ -2533,7 +2617,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_START_NODE)
+		if (exc_fields & RTT_COL_EDGE_START_NODE)
 		  {
 		      if (comma)
 			  sql =
@@ -2544,7 +2628,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_END_NODE)
+		if (exc_fields & RTT_COL_EDGE_END_NODE)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND end_node <> ?", prev);
@@ -2554,7 +2638,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_FACE_LEFT)
+		if (exc_fields & RTT_COL_EDGE_FACE_LEFT)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND left_face <> ?", prev);
@@ -2564,7 +2648,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_FACE_RIGHT)
+		if (exc_fields & RTT_COL_EDGE_FACE_RIGHT)
 		  {
 		      if (comma)
 			  sql =
@@ -2575,7 +2659,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_NEXT_LEFT)
+		if (exc_fields & RTT_COL_EDGE_NEXT_LEFT)
 		  {
 		      if (comma)
 			  sql =
@@ -2588,7 +2672,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_EDGE_NEXT_RIGHT)
+		if (exc_fields & RTT_COL_EDGE_NEXT_RIGHT)
 		  {
 		      if (comma)
 			  sql =
@@ -2613,29 +2697,28 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 				       sqlite3_errmsg (accessor->db_handle));
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
-	  accessor->inside_lwt_callback = 0;
 	  return -1;
       }
 
 /* parameter binding */
     sqlite3_reset (stmt);
     sqlite3_clear_bindings (stmt);
-    if (upd_fields & LWT_COL_EDGE_EDGE_ID)
+    if (upd_fields & RTT_COL_EDGE_EDGE_ID)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_edge->edge_id);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_START_NODE)
+    if (upd_fields & RTT_COL_EDGE_START_NODE)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_edge->start_node);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_END_NODE)
+    if (upd_fields & RTT_COL_EDGE_END_NODE)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_edge->end_node);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_LEFT)
+    if (upd_fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (upd_edge->face_left <= 0)
 	      sqlite3_bind_int64 (stmt, icol, 0);
@@ -2643,7 +2726,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	      sqlite3_bind_int64 (stmt, icol, upd_edge->face_left);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (upd_edge->face_right <= 0)
 	      sqlite3_bind_int64 (stmt, icol, 0);
@@ -2651,21 +2734,21 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	      sqlite3_bind_int64 (stmt, icol, upd_edge->face_right);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_edge->next_left);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_edge->next_right);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_EDGE_GEOM)
+    if (upd_fields & RTT_COL_EDGE_GEOM)
       {
-	  /* transforming the LWLINE into a Geometry-Linestring */
+	  /* transforming the RTLINE into a Geometry-Linestring */
 	  gaiaGeomCollPtr geom =
-	      do_lwline_to_geom (upd_edge->geom, accessor->srid);
+	      do_rtline_to_geom (ctx, upd_edge->geom, accessor->srid);
 	  gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
 	  gaiaFreeGeomColl (geom);
 	  sqlite3_bind_blob (stmt, icol, p_blob, n_bytes, free);
@@ -2673,22 +2756,22 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     if (sel_edge)
       {
-	  if (sel_fields & LWT_COL_EDGE_EDGE_ID)
+	  if (sel_fields & RTT_COL_EDGE_EDGE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_edge->edge_id);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_START_NODE)
+	  if (sel_fields & RTT_COL_EDGE_START_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_edge->start_node);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_END_NODE)
+	  if (sel_fields & RTT_COL_EDGE_END_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_edge->end_node);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_FACE_LEFT)
+	  if (sel_fields & RTT_COL_EDGE_FACE_LEFT)
 	    {
 		if (sel_edge->face_left <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -2696,7 +2779,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, sel_edge->face_left);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_FACE_RIGHT)
+	  if (sel_fields & RTT_COL_EDGE_FACE_RIGHT)
 	    {
 		if (sel_edge->face_right <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -2704,12 +2787,12 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, sel_edge->face_right);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_NEXT_LEFT)
+	  if (sel_fields & RTT_COL_EDGE_NEXT_LEFT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_edge->next_left);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_EDGE_NEXT_RIGHT)
+	  if (sel_fields & RTT_COL_EDGE_NEXT_RIGHT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_edge->next_right);
 		icol++;
@@ -2717,22 +2800,22 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     if (exc_edge)
       {
-	  if (exc_fields & LWT_COL_EDGE_EDGE_ID)
+	  if (exc_fields & RTT_COL_EDGE_EDGE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_edge->edge_id);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_START_NODE)
+	  if (exc_fields & RTT_COL_EDGE_START_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_edge->start_node);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_END_NODE)
+	  if (exc_fields & RTT_COL_EDGE_END_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_edge->end_node);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_FACE_LEFT)
+	  if (exc_fields & RTT_COL_EDGE_FACE_LEFT)
 	    {
 		if (exc_edge->face_left <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -2740,7 +2823,7 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, exc_edge->face_left);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_FACE_RIGHT)
+	  if (exc_fields & RTT_COL_EDGE_FACE_RIGHT)
 	    {
 		if (exc_edge->face_right <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -2748,12 +2831,12 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, exc_edge->face_right);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_NEXT_LEFT)
+	  if (exc_fields & RTT_COL_EDGE_NEXT_LEFT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_edge->next_left);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_EDGE_NEXT_RIGHT)
+	  if (exc_fields & RTT_COL_EDGE_NEXT_RIGHT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_edge->next_right);
 		icol++;
@@ -2771,21 +2854,21 @@ callback_updateEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  goto error;
       }
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
-LWT_ISO_FACE *
-callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ELEMID * ids, int *numelems, int fields)
+RTT_ISO_FACE *
+callback_getFaceById (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ELEMID * ids, int *numelems, int fields)
 {
 /* callback function: getFeceById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt_aux = NULL;
     int ret;
@@ -2796,18 +2879,27 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
     char *xtable;
     int comma = 0;
     struct topo_faces_list *list = NULL;
-    LWT_ISO_FACE *result = NULL;
+    RTT_ISO_FACE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
     /* preparing the SQL statement */
     sql = sqlite3_mprintf ("SELECT ");
     prev = sql;
-    if (fields & LWT_COL_FACE_FACE_ID)
+    if (fields & RTT_COL_FACE_FACE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, face_id", prev);
@@ -2817,7 +2909,7 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_FACE_MBR)
+    if (fields & RTT_COL_FACE_MBR)
       {
 	  if (comma)
 	      sql =
@@ -2851,7 +2943,6 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -2877,21 +2968,21 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_face *p_fc;
-	  result = lwalloc (sizeof (LWT_ISO_FACE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_FACE) * list->count);
 	  p_fc = list->first;
 	  i = 0;
 	  while (p_fc != NULL)
 	    {
-		LWT_ISO_FACE *fc = result + i;
-		if (fields & LWT_COL_FACE_FACE_ID)
+		RTT_ISO_FACE *fc = result + i;
+		if (fields & RTT_COL_FACE_FACE_ID)
 		    fc->face_id = p_fc->face_id;
-		if (fields & LWT_COL_FACE_MBR)
+		if (fields & RTT_COL_FACE_MBR)
 		  {
 		      if (p_fc->id == 0)
 			  fc->mbr = NULL;
 		      else
 			{
-			    fc->mbr = gbox_new (0);
+			    fc->mbr = gbox_new (ctx, 0);
 			    fc->mbr->xmin = p_fc->minx;
 			    fc->mbr->ymin = p_fc->miny;
 			    fc->mbr->xmax = p_fc->maxx;
@@ -2905,7 +2996,6 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_faces_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -2914,16 +3004,17 @@ callback_getFaceById (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_faces_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ELEMID
-callback_getFaceContainingPoint (const LWT_BE_TOPOLOGY * lwt_topo,
-				 const LWPOINT * pt)
+RTT_ELEMID
+callback_getFaceContainingPoint (const RTT_BE_TOPOLOGY * rtt_topo,
+				 const RTPOINT * pt)
 {
 /* callback function: getFaceContainingPoint */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     sqlite3_stmt *stmt_aux;
@@ -2934,8 +3025,8 @@ callback_getFaceContainingPoint (const LWT_BE_TOPOLOGY * lwt_topo,
     float fy;
     double tic;
     double tic2;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int count = 0;
     sqlite3_int64 face_id;
     if (accessor == NULL)
@@ -2947,11 +3038,20 @@ callback_getFaceContainingPoint (const LWT_BE_TOPOLOGY * lwt_topo,
     stmt_aux = accessor->stmt_getFaceContainingPoint_2;
     if (stmt_aux == NULL)
 	return -2;
-    accessor->inside_lwt_callback = 1;
 
-/* extracting X and Y from LWPOINT */
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return -1;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return -1;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return -1;
+
+/* extracting X and Y from RTPOINT */
     pa = pt->point;
-    getPoint4d_p (pa, 0, &pt4d);
+    rt_getPoint4d_p (ctx, pa, 0, &pt4d);
     cx = pt4d.x;
     cy = pt4d.y;
 
@@ -3037,23 +3137,21 @@ callback_getFaceContainingPoint (const LWT_BE_TOPOLOGY * lwt_topo,
       }
 
     sqlite3_reset (stmt);
-    accessor->inside_lwt_callback = 0;
     if (count == 0)
 	return -1;		/* none found */
     return face_id;
 
   error:
     sqlite3_reset (stmt);
-    accessor->inside_lwt_callback = 0;
     return -2;
 }
 
 int
-callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ISO_EDGE * sel_edge, int sel_fields)
+callback_deleteEdges (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ISO_EDGE * sel_edge, int sel_fields)
 {
 /* callback function: deleteEdgest */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -3066,7 +3164,6 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     int changed = 0;
     if (accessor == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
 
 /* composing the SQL prepared statement */
     table = sqlite3_mprintf ("%s_edge", accessor->topology_name);
@@ -3075,7 +3172,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     sql = sqlite3_mprintf ("DELETE FROM MAIN.\"%s\" WHERE", xtable);
     free (xtable);
     prev = sql;
-    if (sel_fields & LWT_COL_EDGE_EDGE_ID)
+    if (sel_fields & RTT_COL_EDGE_EDGE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND edge_id = ?", prev);
@@ -3085,7 +3182,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_START_NODE)
+    if (sel_fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND start_node = ?", prev);
@@ -3095,7 +3192,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_END_NODE)
+    if (sel_fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND end_node = ?", prev);
@@ -3105,7 +3202,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_FACE_LEFT)
+    if (sel_fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND left_face = ?", prev);
@@ -3115,7 +3212,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (sel_fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND right_face = ?", prev);
@@ -3125,7 +3222,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (sel_fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND next_left_edge = ?", prev);
@@ -3135,7 +3232,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (sel_fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND next_right_edge = ?", prev);
@@ -3145,7 +3242,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (sel_fields & LWT_COL_EDGE_GEOM)
+    if (sel_fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s AND geom = ?", prev);
@@ -3165,29 +3262,28 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 				       sqlite3_errmsg (accessor->db_handle));
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
-	  accessor->inside_lwt_callback = 0;
 	  return -1;
       }
 
 /* parameter binding */
     sqlite3_reset (stmt);
     sqlite3_clear_bindings (stmt);
-    if (sel_fields & LWT_COL_EDGE_EDGE_ID)
+    if (sel_fields & RTT_COL_EDGE_EDGE_ID)
       {
 	  sqlite3_bind_int64 (stmt, icol, sel_edge->edge_id);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_START_NODE)
+    if (sel_fields & RTT_COL_EDGE_START_NODE)
       {
 	  sqlite3_bind_int64 (stmt, icol, sel_edge->start_node);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_END_NODE)
+    if (sel_fields & RTT_COL_EDGE_END_NODE)
       {
 	  sqlite3_bind_int64 (stmt, icol, sel_edge->end_node);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_FACE_LEFT)
+    if (sel_fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (sel_edge->face_left <= 0)
 	      sqlite3_bind_int64 (stmt, icol, 0);
@@ -3195,7 +3291,7 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	      sqlite3_bind_int64 (stmt, icol, sel_edge->face_left);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (sel_fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (sel_edge->face_right <= 0)
 	      sqlite3_bind_int64 (stmt, icol, 0);
@@ -3203,12 +3299,12 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	      sqlite3_bind_int64 (stmt, icol, sel_edge->face_right);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (sel_fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  sqlite3_bind_int64 (stmt, icol, sel_edge->next_left);
 	  icol++;
       }
-    if (sel_fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (sel_fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  sqlite3_bind_int64 (stmt, icol, sel_edge->next_right);
 	  icol++;
@@ -3225,32 +3321,32 @@ callback_deleteEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  goto error;
       }
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
-LWT_ISO_NODE *
-callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
-			     const GBOX * box, int *numelems,
+RTT_ISO_NODE *
+callback_getNodeWithinBox2D (const RTT_BE_TOPOLOGY * rtt_topo,
+			     const RTGBOX * box, int *numelems,
 			     int fields, int limit)
 {
 /* callback function: getNodeWithinBox2D */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     int count = 0;
     sqlite3_stmt *stmt_aux = NULL;
     char *sql;
     struct topo_nodes_list *list = NULL;
-    LWT_ISO_NODE *result = NULL;
+    RTT_ISO_NODE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
@@ -3263,7 +3359,16 @@ callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     if (limit >= 0)
       {
@@ -3284,7 +3389,6 @@ callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 		gaiatopo_set_last_error_msg (topo, msg);
 		sqlite3_free (msg);
 		*numelems = -1;
-		accessor->inside_lwt_callback = 0;
 		return NULL;
 	    }
       }
@@ -3355,25 +3459,26 @@ callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	    {
 		int i = 0;
 		struct topo_node *p_nd;
-		result = lwalloc (sizeof (LWT_ISO_NODE) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ISO_NODE) * list->count);
 		p_nd = list->first;
 		while (p_nd != NULL)
 		  {
-		      LWT_ISO_NODE *nd = result + i;
-		      if (fields & LWT_COL_NODE_NODE_ID)
+		      RTT_ISO_NODE *nd = result + i;
+		      if (fields & RTT_COL_NODE_NODE_ID)
 			  nd->node_id = p_nd->node_id;
-		      if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		      if (fields & RTT_COL_NODE_CONTAINING_FACE)
 			  nd->containing_face = p_nd->containing_face;
-		      if (fields & LWT_COL_NODE_GEOM)
+		      if (fields & RTT_COL_NODE_GEOM)
 			{
-			    pa = ptarray_construct (accessor->has_z, 0, 1);
+			    pa = ptarray_construct (ctx, accessor->has_z, 0, 1);
 			    pt4d.x = p_nd->x;
 			    pt4d.y = p_nd->y;
 			    if (accessor->has_z)
 				pt4d.z = p_nd->z;
-			    ptarray_set_point4d (pa, 0, &pt4d);
+			    ptarray_set_point4d (ctx, pa, 0, &pt4d);
 			    nd->geom =
-				lwpoint_construct (accessor->srid, NULL, pa);
+				rtpoint_construct (ctx, accessor->srid, NULL,
+						   pa);
 			}
 		      i++;
 		      p_nd = p_nd->next;
@@ -3386,7 +3491,6 @@ callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (stmt_aux != NULL)
 	sqlite3_finalize (stmt_aux);
     destroy_nodes_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -3396,17 +3500,18 @@ callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_nodes_list (list);
     *numelems = 1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ISO_EDGE *
-callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
-			     const GBOX * box, int *numelems,
+RTT_ISO_EDGE *
+callback_getEdgeWithinBox2D (const RTT_BE_TOPOLOGY * rtt_topo,
+			     const RTGBOX * box, int *numelems,
 			     int fields, int limit)
 {
 /* callback function: getEdgeWithinBox2D */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
@@ -3414,7 +3519,7 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
     sqlite3_stmt *stmt_aux = NULL;
     char *sql;
     struct topo_edges_list *list = NULL;
-    LWT_ISO_EDGE *result = NULL;
+    RTT_ISO_EDGE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
@@ -3427,7 +3532,16 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     if (limit >= 0)
       {
@@ -3446,7 +3560,6 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 		gaiatopo_set_last_error_msg (topo, msg);
 		sqlite3_free (msg);
 		*numelems = -1;
-		accessor->inside_lwt_callback = 0;
 		return NULL;
 	    }
       }
@@ -3517,28 +3630,29 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
 	    {
 		int i = 0;
 		struct topo_edge *p_ed;
-		result = lwalloc (sizeof (LWT_ISO_EDGE) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ISO_EDGE) * list->count);
 		p_ed = list->first;
 		while (p_ed != NULL)
 		  {
-		      LWT_ISO_EDGE *ed = result + i;
-		      if (fields & LWT_COL_EDGE_EDGE_ID)
+		      RTT_ISO_EDGE *ed = result + i;
+		      if (fields & RTT_COL_EDGE_EDGE_ID)
 			  ed->edge_id = p_ed->edge_id;
-		      if (fields & LWT_COL_EDGE_START_NODE)
+		      if (fields & RTT_COL_EDGE_START_NODE)
 			  ed->start_node = p_ed->start_node;
-		      if (fields & LWT_COL_EDGE_END_NODE)
+		      if (fields & RTT_COL_EDGE_END_NODE)
 			  ed->end_node = p_ed->end_node;
-		      if (fields & LWT_COL_EDGE_FACE_LEFT)
+		      if (fields & RTT_COL_EDGE_FACE_LEFT)
 			  ed->face_left = p_ed->face_left;
-		      if (fields & LWT_COL_EDGE_FACE_RIGHT)
+		      if (fields & RTT_COL_EDGE_FACE_RIGHT)
 			  ed->face_right = p_ed->face_right;
-		      if (fields & LWT_COL_EDGE_NEXT_LEFT)
+		      if (fields & RTT_COL_EDGE_NEXT_LEFT)
 			  ed->next_left = p_ed->next_left;
-		      if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+		      if (fields & RTT_COL_EDGE_NEXT_RIGHT)
 			  ed->next_right = p_ed->next_right;
-		      if (fields & LWT_COL_EDGE_GEOM)
+		      if (fields & RTT_COL_EDGE_GEOM)
 			  ed->geom =
-			      gaia_convert_linestring_to_lwline (p_ed->geom,
+			      gaia_convert_linestring_to_rtline (ctx,
+								 p_ed->geom,
 								 accessor->srid,
 								 accessor->
 								 has_z);
@@ -3552,7 +3666,6 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (stmt_aux != NULL)
 	sqlite3_finalize (stmt_aux);
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -3562,16 +3675,17 @@ callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ISO_EDGE *
-callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
-			const LWT_ELEMID * ids, int *numelems, int fields)
+RTT_ISO_EDGE *
+callback_getEdgeByNode (const RTT_BE_TOPOLOGY * rtt_topo,
+			const RTT_ELEMID * ids, int *numelems, int fields)
 {
 /* callback function: getEdgeByNode */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     int ret;
     char *sql;
@@ -3582,13 +3696,22 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
     int i;
     sqlite3_stmt *stmt_aux = NULL;
     struct topo_edges_list *list = NULL;
-    LWT_ISO_EDGE *result = NULL;
+    RTT_ISO_EDGE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     /* preparing the SQL statement */
     sql = sqlite3_mprintf ("SELECT ");
@@ -3601,7 +3724,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
     comma = 1;
     sqlite3_free (prev);
     prev = sql;
-    if (fields & LWT_COL_EDGE_START_NODE)
+    if (fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, start_node", prev);
@@ -3611,7 +3734,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_END_NODE)
+    if (fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, end_node", prev);
@@ -3621,7 +3744,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_LEFT)
+    if (fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, left_face", prev);
@@ -3631,7 +3754,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, right_face", prev);
@@ -3641,7 +3764,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_left_edge", prev);
@@ -3651,7 +3774,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_right_edge", prev);
@@ -3661,7 +3784,7 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_GEOM)
+    if (fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, geom", prev);
@@ -3692,7 +3815,6 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -3718,29 +3840,29 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_edge *p_ed;
-	  result = lwalloc (sizeof (LWT_ISO_EDGE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_EDGE) * list->count);
 	  p_ed = list->first;
 	  i = 0;
 	  while (p_ed != NULL)
 	    {
-		LWT_ISO_EDGE *ed = result + i;
-		if (fields & LWT_COL_EDGE_EDGE_ID)
+		RTT_ISO_EDGE *ed = result + i;
+		if (fields & RTT_COL_EDGE_EDGE_ID)
 		    ed->edge_id = p_ed->edge_id;
-		if (fields & LWT_COL_EDGE_START_NODE)
+		if (fields & RTT_COL_EDGE_START_NODE)
 		    ed->start_node = p_ed->start_node;
-		if (fields & LWT_COL_EDGE_END_NODE)
+		if (fields & RTT_COL_EDGE_END_NODE)
 		    ed->end_node = p_ed->end_node;
-		if (fields & LWT_COL_EDGE_FACE_LEFT)
+		if (fields & RTT_COL_EDGE_FACE_LEFT)
 		    ed->face_left = p_ed->face_left;
-		if (fields & LWT_COL_EDGE_FACE_RIGHT)
+		if (fields & RTT_COL_EDGE_FACE_RIGHT)
 		    ed->face_right = p_ed->face_right;
-		if (fields & LWT_COL_EDGE_NEXT_LEFT)
+		if (fields & RTT_COL_EDGE_NEXT_LEFT)
 		    ed->next_left = p_ed->next_left;
-		if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+		if (fields & RTT_COL_EDGE_NEXT_RIGHT)
 		    ed->next_right = p_ed->next_right;
-		if (fields & LWT_COL_EDGE_GEOM)
+		if (fields & RTT_COL_EDGE_GEOM)
 		    ed->geom =
-			gaia_convert_linestring_to_lwline (p_ed->geom,
+			gaia_convert_linestring_to_rtline (ctx, p_ed->geom,
 							   accessor->srid,
 							   accessor->has_z);
 		i++;
@@ -3750,7 +3872,6 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -3759,18 +3880,19 @@ callback_getEdgeByNode (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
 int
-callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
-		      const LWT_ISO_NODE * sel_node, int sel_fields,
-		      const LWT_ISO_NODE * upd_node, int upd_fields,
-		      const LWT_ISO_NODE * exc_node, int exc_fields)
+callback_updateNodes (const RTT_BE_TOPOLOGY * rtt_topo,
+		      const RTT_ISO_NODE * sel_node, int sel_fields,
+		      const RTT_ISO_NODE * upd_node, int upd_fields,
+		      const RTT_ISO_NODE * exc_node, int exc_fields)
 {
 /* callback function: updateNodes */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -3781,14 +3903,23 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
     char *xtable;
     int icol = 1;
     int changed = 0;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     double x;
     double y;
     double z;
     if (accessor == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
 /* composing the SQL prepared statement */
     table = sqlite3_mprintf ("%s_node", accessor->topology_name);
@@ -3797,7 +3928,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
     sql = sqlite3_mprintf ("UPDATE MAIN.\"%s\" SET ", xtable);
     free (xtable);
     prev = sql;
-    if (upd_fields & LWT_COL_NODE_NODE_ID)
+    if (upd_fields & RTT_COL_NODE_NODE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, node_id = ?", prev);
@@ -3807,7 +3938,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_NODE_CONTAINING_FACE)
+    if (upd_fields & RTT_COL_NODE_CONTAINING_FACE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, containing_face = ?", prev);
@@ -3817,7 +3948,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_NODE_GEOM)
+    if (upd_fields & RTT_COL_NODE_GEOM)
       {
 	  if (accessor->has_z)
 	    {
@@ -3853,7 +3984,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 	  if (sel_node)
 	    {
 		comma = 0;
-		if (sel_fields & LWT_COL_NODE_NODE_ID)
+		if (sel_fields & RTT_COL_NODE_NODE_ID)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND node_id = ?", prev);
@@ -3863,7 +3994,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (sel_fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (sel_fields & RTT_COL_NODE_CONTAINING_FACE)
 		  {
 		      if (comma)
 			  sql =
@@ -3886,7 +4017,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 		      prev = sql;
 		  }
 		comma = 0;
-		if (exc_fields & LWT_COL_NODE_NODE_ID)
+		if (exc_fields & RTT_COL_NODE_NODE_ID)
 		  {
 		      if (comma)
 			  sql = sqlite3_mprintf ("%s AND node_id <> ?", prev);
@@ -3896,7 +4027,7 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 		      sqlite3_free (prev);
 		      prev = sql;
 		  }
-		if (exc_fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (exc_fields & RTT_COL_NODE_CONTAINING_FACE)
 		  {
 		      if (comma)
 			  sql =
@@ -3921,19 +4052,18 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 				       sqlite3_errmsg (accessor->db_handle));
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
-	  accessor->inside_lwt_callback = 0;
 	  return -1;
       }
 
 /* parameter binding */
     sqlite3_reset (stmt);
     sqlite3_clear_bindings (stmt);
-    if (upd_fields & LWT_COL_NODE_NODE_ID)
+    if (upd_fields & RTT_COL_NODE_NODE_ID)
       {
 	  sqlite3_bind_int64 (stmt, icol, upd_node->node_id);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_NODE_CONTAINING_FACE)
+    if (upd_fields & RTT_COL_NODE_CONTAINING_FACE)
       {
 	  if (upd_node->containing_face < 0)
 	      sqlite3_bind_null (stmt, icol);
@@ -3941,11 +4071,11 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 	      sqlite3_bind_int64 (stmt, icol, upd_node->containing_face);
 	  icol++;
       }
-    if (upd_fields & LWT_COL_NODE_GEOM)
+    if (upd_fields & RTT_COL_NODE_GEOM)
       {
-	  /* extracting X and Y from LWPOINT */
+	  /* extracting X and Y from RTTOPO */
 	  pa = upd_node->geom->point;
-	  getPoint4d_p (pa, 0, &pt4d);
+	  rt_getPoint4d_p (ctx, pa, 0, &pt4d);
 	  x = pt4d.x;
 	  y = pt4d.y;
 	  if (accessor->has_z)
@@ -3962,12 +4092,12 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     if (sel_node)
       {
-	  if (sel_fields & LWT_COL_NODE_NODE_ID)
+	  if (sel_fields & RTT_COL_NODE_NODE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_node->node_id);
 		icol++;
 	    }
-	  if (sel_fields & LWT_COL_NODE_CONTAINING_FACE)
+	  if (sel_fields & RTT_COL_NODE_CONTAINING_FACE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, sel_node->containing_face);
 		icol++;
@@ -3975,12 +4105,12 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     if (exc_node)
       {
-	  if (exc_fields & LWT_COL_NODE_NODE_ID)
+	  if (exc_fields & RTT_COL_NODE_NODE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_node->node_id);
 		icol++;
 	    }
-	  if (exc_fields & LWT_COL_NODE_CONTAINING_FACE)
+	  if (exc_fields & RTT_COL_NODE_CONTAINING_FACE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, exc_node->containing_face);
 		icol++;
@@ -3998,21 +4128,19 @@ callback_updateNodes (const LWT_BE_TOPOLOGY * lwt_topo,
 	  goto error;
       }
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
 int
-callback_insertFaces (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_FACE * faces,
+callback_insertFaces (const RTT_BE_TOPOLOGY * rtt_topo, RTT_ISO_FACE * faces,
 		      int numelems)
 {
 /* callback function: insertFaces */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     int ret;
     int i;
@@ -4024,11 +4152,10 @@ callback_insertFaces (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_FACE * faces,
     stmt = accessor->stmt_insertFaces;
     if (stmt == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
 
     for (i = 0; i < numelems; i++)
       {
-	  LWT_ISO_FACE *fc = faces + i;
+	  RTT_ISO_FACE *fc = faces + i;
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
 	  if (fc->face_id <= 0)
@@ -4057,22 +4184,20 @@ callback_insertFaces (const LWT_BE_TOPOLOGY * lwt_topo, LWT_ISO_FACE * faces,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return count;
 
   error:
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return -1;
 }
 
 int
-callback_updateFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
-			  const LWT_ISO_FACE * faces, int numfaces)
+callback_updateFacesById (const RTT_BE_TOPOLOGY * rtt_topo,
+			  const RTT_ISO_FACE * faces, int numfaces)
 {
 /* callback function: updateFacesById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -4084,13 +4209,11 @@ callback_updateFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
     stmt = accessor->stmt_updateFacesById;
     if (stmt == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
-
 
     for (i = 0; i < numfaces; i++)
       {
 	  /* parameter binding */
-	  const LWT_ISO_FACE *fc = faces + i;
+	  const RTT_ISO_FACE *fc = faces + i;
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
 	  sqlite3_bind_double (stmt, 1, fc->mbr->xmin);
@@ -4111,20 +4234,18 @@ callback_updateFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
 int
-callback_deleteFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
-			  const LWT_ELEMID * ids, int numelems)
+callback_deleteFacesById (const RTT_BE_TOPOLOGY * rtt_topo,
+			  const RTT_ELEMID * ids, int numelems)
 {
 /* callback function: deleteFacesById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -4136,7 +4257,6 @@ callback_deleteFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
     stmt = accessor->stmt_deleteFacesById;
     if (stmt == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
 
     for (i = 0; i < numelems; i++)
       {
@@ -4160,22 +4280,20 @@ callback_deleteFacesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return changed;
 
   error:
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return -1;
 }
 
 int
-callback_deleteNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
-			  const LWT_ELEMID * ids, int numelems)
+callback_deleteNodesById (const RTT_BE_TOPOLOGY * rtt_topo,
+			  const RTT_ELEMID * ids, int numelems)
 {
 /* callback function: deleteNodesById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -4187,7 +4305,6 @@ callback_deleteNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
     stmt = accessor->stmt_deleteNodesById;
     if (stmt == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
 
     for (i = 0; i < numelems; i++)
       {
@@ -4211,22 +4328,22 @@ callback_deleteNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		goto error;
 	    }
       }
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return changed;
 
   error:
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return -1;
 }
 
-LWT_ELEMID *
-callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
-		       LWT_ELEMID edge, int *numedges, int limit)
+RTT_ELEMID *
+callback_getRingEdges (const RTT_BE_TOPOLOGY * rtt_topo,
+		       RTT_ELEMID edge, int *numedges, int limit)
 {
 /* callback function: getRingEdges */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     int ret;
     int i;
@@ -4234,7 +4351,7 @@ callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     sqlite3_stmt *stmt;
 
     struct topo_edges_list *list = NULL;
-    LWT_ELEMID *result = NULL;
+    RTT_ELEMID *result = NULL;
     if (accessor == NULL)
       {
 	  *numedges = -1;
@@ -4247,7 +4364,16 @@ callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  *numedges = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
 /* setting up the prepared statement */
     sqlite3_reset (stmt);
@@ -4299,7 +4425,7 @@ callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	  else
 	    {
 		struct topo_edge *p_ed;
-		result = lwalloc (sizeof (LWT_ELEMID) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ELEMID) * list->count);
 		p_ed = list->first;
 		i = 0;
 		while (p_ed != NULL)
@@ -4312,7 +4438,6 @@ callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
 	    }
       }
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return result;
 
@@ -4320,18 +4445,19 @@ callback_getRingEdges (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numedges = -1;
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return NULL;
 }
 
 int
-callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
-			  const LWT_ISO_EDGE * edges, int numedges,
+callback_updateEdgesById (const RTT_BE_TOPOLOGY * rtt_topo,
+			  const RTT_ISO_EDGE * edges, int numedges,
 			  int upd_fields)
 {
 /* callback function: updateEdgesById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -4347,7 +4473,16 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
     int gpkg_mode = 0;
     if (accessor == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
     if (accessor->cache != NULL)
       {
@@ -4363,7 +4498,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
     sql = sqlite3_mprintf ("UPDATE MAIN.\"%s\" SET", xtable);
     free (xtable);
     prev = sql;
-    if (upd_fields & LWT_COL_EDGE_EDGE_ID)
+    if (upd_fields & RTT_COL_EDGE_EDGE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, edge_id = ?", prev);
@@ -4373,7 +4508,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_START_NODE)
+    if (upd_fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, start_node = ?", prev);
@@ -4383,7 +4518,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_END_NODE)
+    if (upd_fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, end_node = ?", prev);
@@ -4393,7 +4528,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_LEFT)
+    if (upd_fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, left_face = ?", prev);
@@ -4403,7 +4538,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, right_face = ?", prev);
@@ -4413,7 +4548,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_left_edge = ?", prev);
@@ -4423,7 +4558,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (upd_fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_right_edge = ?", prev);
@@ -4433,7 +4568,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_EDGE_GEOM)
+    if (upd_fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, geom = ?", prev);
@@ -4455,7 +4590,6 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 				       sqlite3_errmsg (accessor->db_handle));
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
-	  accessor->inside_lwt_callback = 0;
 	  return -1;
       }
 
@@ -4463,25 +4597,25 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
       {
 	  /* parameter binding */
 	  int icol = 1;
-	  const LWT_ISO_EDGE *upd_edge = edges + i;
+	  const RTT_ISO_EDGE *upd_edge = edges + i;
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
-	  if (upd_fields & LWT_COL_EDGE_EDGE_ID)
+	  if (upd_fields & RTT_COL_EDGE_EDGE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, upd_edge->edge_id);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_START_NODE)
+	  if (upd_fields & RTT_COL_EDGE_START_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, upd_edge->start_node);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_END_NODE)
+	  if (upd_fields & RTT_COL_EDGE_END_NODE)
 	    {
 		sqlite3_bind_int64 (stmt, icol, upd_edge->end_node);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_FACE_LEFT)
+	  if (upd_fields & RTT_COL_EDGE_FACE_LEFT)
 	    {
 		if (upd_edge->face_left <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -4489,7 +4623,7 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, upd_edge->face_left);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_FACE_RIGHT)
+	  if (upd_fields & RTT_COL_EDGE_FACE_RIGHT)
 	    {
 		if (upd_edge->face_right <= 0)
 		    sqlite3_bind_int64 (stmt, icol, 0);
@@ -4497,21 +4631,21 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, upd_edge->face_right);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_NEXT_LEFT)
+	  if (upd_fields & RTT_COL_EDGE_NEXT_LEFT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, upd_edge->next_left);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_NEXT_RIGHT)
+	  if (upd_fields & RTT_COL_EDGE_NEXT_RIGHT)
 	    {
 		sqlite3_bind_int64 (stmt, icol, upd_edge->next_right);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_EDGE_GEOM)
+	  if (upd_fields & RTT_COL_EDGE_GEOM)
 	    {
-		/* transforming the LWLINE into a Geometry-Linestring */
+		/* transforming the RTLINE into a Geometry-Linestring */
 		gaiaGeomCollPtr geom =
-		    do_lwline_to_geom (upd_edge->geom, accessor->srid);
+		    do_rtline_to_geom (ctx, upd_edge->geom, accessor->srid);
 		gaiaToSpatiaLiteBlobWkbEx (geom, &p_blob, &n_bytes, gpkg_mode);
 		gaiaFreeGeomColl (geom);
 		sqlite3_bind_blob (stmt, icol, p_blob, n_bytes, free);
@@ -4532,22 +4666,22 @@ callback_updateEdgesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	    }
       }
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
-LWT_ISO_EDGE *
-callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
-			const LWT_ELEMID * ids, int *numelems, int fields,
-			const GBOX * box)
+RTT_ISO_EDGE *
+callback_getEdgeByFace (const RTT_BE_TOPOLOGY * rtt_topo,
+			const RTT_ELEMID * ids, int *numelems, int fields,
+			const RTGBOX * box)
 {
 /* callback function: getEdgeByFace */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     int ret;
     char *sql;
@@ -4558,13 +4692,22 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     int i;
     sqlite3_stmt *stmt_aux = NULL;
     struct topo_edges_list *list = NULL;
-    LWT_ISO_EDGE *result = NULL;
+    RTT_ISO_EDGE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     /* preparing the SQL statement */
     sql = sqlite3_mprintf ("SELECT ");
@@ -4577,7 +4720,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     comma = 1;
     sqlite3_free (prev);
     prev = sql;
-    if (fields & LWT_COL_EDGE_START_NODE)
+    if (fields & RTT_COL_EDGE_START_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, start_node", prev);
@@ -4587,7 +4730,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_END_NODE)
+    if (fields & RTT_COL_EDGE_END_NODE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, end_node", prev);
@@ -4597,7 +4740,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_LEFT)
+    if (fields & RTT_COL_EDGE_FACE_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, left_face", prev);
@@ -4607,7 +4750,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_FACE_RIGHT)
+    if (fields & RTT_COL_EDGE_FACE_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, right_face", prev);
@@ -4617,7 +4760,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_LEFT)
+    if (fields & RTT_COL_EDGE_NEXT_LEFT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_left_edge", prev);
@@ -4627,7 +4770,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+    if (fields & RTT_COL_EDGE_NEXT_RIGHT)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, next_right_edge", prev);
@@ -4637,7 +4780,7 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_EDGE_GEOM)
+    if (fields & RTT_COL_EDGE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, geom", prev);
@@ -4680,7 +4823,6 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -4706,29 +4848,29 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_edge *p_ed;
-	  result = lwalloc (sizeof (LWT_ISO_EDGE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_EDGE) * list->count);
 	  p_ed = list->first;
 	  i = 0;
 	  while (p_ed != NULL)
 	    {
-		LWT_ISO_EDGE *ed = result + i;
-		if (fields & LWT_COL_EDGE_EDGE_ID)
+		RTT_ISO_EDGE *ed = result + i;
+		if (fields & RTT_COL_EDGE_EDGE_ID)
 		    ed->edge_id = p_ed->edge_id;
-		if (fields & LWT_COL_EDGE_START_NODE)
+		if (fields & RTT_COL_EDGE_START_NODE)
 		    ed->start_node = p_ed->start_node;
-		if (fields & LWT_COL_EDGE_END_NODE)
+		if (fields & RTT_COL_EDGE_END_NODE)
 		    ed->end_node = p_ed->end_node;
-		if (fields & LWT_COL_EDGE_FACE_LEFT)
+		if (fields & RTT_COL_EDGE_FACE_LEFT)
 		    ed->face_left = p_ed->face_left;
-		if (fields & LWT_COL_EDGE_FACE_RIGHT)
+		if (fields & RTT_COL_EDGE_FACE_RIGHT)
 		    ed->face_right = p_ed->face_right;
-		if (fields & LWT_COL_EDGE_NEXT_LEFT)
+		if (fields & RTT_COL_EDGE_NEXT_LEFT)
 		    ed->next_left = p_ed->next_left;
-		if (fields & LWT_COL_EDGE_NEXT_RIGHT)
+		if (fields & RTT_COL_EDGE_NEXT_RIGHT)
 		    ed->next_right = p_ed->next_right;
-		if (fields & LWT_COL_EDGE_GEOM)
+		if (fields & RTT_COL_EDGE_GEOM)
 		    ed->geom =
-			gaia_convert_linestring_to_lwline (p_ed->geom,
+			gaia_convert_linestring_to_rtline (ctx, p_ed->geom,
 							   accessor->srid,
 							   accessor->has_z);
 		i++;
@@ -4738,7 +4880,6 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_edges_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -4747,17 +4888,18 @@ callback_getEdgeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_edges_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
-LWT_ISO_NODE *
-callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
-			const LWT_ELEMID * faces, int *numelems, int fields,
-			const GBOX * box)
+RTT_ISO_NODE *
+callback_getNodeByFace (const RTT_BE_TOPOLOGY * rtt_topo,
+			const RTT_ELEMID * faces, int *numelems, int fields,
+			const RTGBOX * box)
 {
 /* callback function: getNodeByFace */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt_aux = NULL;
     int ret;
@@ -4767,21 +4909,30 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     char *table;
     char *xtable;
     int comma = 0;
-    POINTARRAY *pa;
-    POINT4D pt4d;
+    RTPOINTARRAY *pa;
+    RTPOINT4D pt4d;
     struct topo_nodes_list *list = NULL;
-    LWT_ISO_NODE *result = NULL;
+    RTT_ISO_NODE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
     /* preparing the SQL statement */
     sql = sqlite3_mprintf ("SELECT ");
     prev = sql;
-    if (fields & LWT_COL_NODE_NODE_ID)
+    if (fields & RTT_COL_NODE_NODE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, node_id", prev);
@@ -4791,7 +4942,7 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_NODE_CONTAINING_FACE)
+    if (fields & RTT_COL_NODE_CONTAINING_FACE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, containing_face", prev);
@@ -4801,7 +4952,7 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (fields & LWT_COL_NODE_GEOM)
+    if (fields & RTT_COL_NODE_GEOM)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, ST_X(geom), ST_Y(geom)", prev);
@@ -4849,7 +5000,6 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
 	  *numelems = -1;
-	  accessor->inside_lwt_callback = 0;
 	  return NULL;
       }
 
@@ -4875,25 +5025,26 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     else
       {
 	  struct topo_node *p_nd;
-	  result = lwalloc (sizeof (LWT_ISO_NODE) * list->count);
+	  result = rtalloc (ctx, sizeof (RTT_ISO_NODE) * list->count);
 	  p_nd = list->first;
 	  i = 0;
 	  while (p_nd != NULL)
 	    {
-		LWT_ISO_NODE *nd = result + i;
-		if (fields & LWT_COL_NODE_NODE_ID)
+		RTT_ISO_NODE *nd = result + i;
+		if (fields & RTT_COL_NODE_NODE_ID)
 		    nd->node_id = p_nd->node_id;
-		if (fields & LWT_COL_NODE_CONTAINING_FACE)
+		if (fields & RTT_COL_NODE_CONTAINING_FACE)
 		    nd->containing_face = p_nd->containing_face;
-		if (fields & LWT_COL_NODE_GEOM)
+		if (fields & RTT_COL_NODE_GEOM)
 		  {
-		      pa = ptarray_construct (accessor->has_z, 0, 1);
+		      pa = ptarray_construct (ctx, accessor->has_z, 0, 1);
 		      pt4d.x = p_nd->x;
 		      pt4d.y = p_nd->y;
 		      if (accessor->has_z)
 			  pt4d.z = p_nd->z;
-		      ptarray_set_point4d (pa, 0, &pt4d);
-		      nd->geom = lwpoint_construct (accessor->srid, NULL, pa);
+		      ptarray_set_point4d (ctx, pa, 0, &pt4d);
+		      nd->geom =
+			  rtpoint_construct (ctx, accessor->srid, NULL, pa);
 		  }
 		i++;
 		p_nd = p_nd->next;
@@ -4902,7 +5053,6 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
       }
     sqlite3_finalize (stmt_aux);
     destroy_nodes_list (list);
-    accessor->inside_lwt_callback = 0;
     return result;
 
   error:
@@ -4911,17 +5061,18 @@ callback_getNodeByFace (const LWT_BE_TOPOLOGY * lwt_topo,
     if (list != NULL)
 	destroy_nodes_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     return NULL;
 }
 
 int
-callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
-			  const LWT_ISO_NODE * nodes, int numnodes,
+callback_updateNodesById (const RTT_BE_TOPOLOGY * rtt_topo,
+			  const RTT_ISO_NODE * nodes, int numnodes,
 			  int upd_fields)
 {
 /* callback function: updateNodesById */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt = NULL;
     int ret;
@@ -4935,7 +5086,16 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
     int changed = 0;
     if (accessor == NULL)
 	return -1;
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return 0;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return 0;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return 0;
 
 /* composing the SQL prepared statement */
     table = sqlite3_mprintf ("%s_node", accessor->topology_name);
@@ -4944,7 +5104,7 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
     sql = sqlite3_mprintf ("UPDATE MAIN.\"%s\" SET", xtable);
     free (xtable);
     prev = sql;
-    if (upd_fields & LWT_COL_NODE_NODE_ID)
+    if (upd_fields & RTT_COL_NODE_NODE_ID)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, node_id = ?", prev);
@@ -4954,7 +5114,7 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_NODE_CONTAINING_FACE)
+    if (upd_fields & RTT_COL_NODE_CONTAINING_FACE)
       {
 	  if (comma)
 	      sql = sqlite3_mprintf ("%s, containing_face = ?", prev);
@@ -4964,7 +5124,7 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	  sqlite3_free (prev);
 	  prev = sql;
       }
-    if (upd_fields & LWT_COL_NODE_GEOM)
+    if (upd_fields & RTT_COL_NODE_GEOM)
       {
 	  if (accessor->has_z)
 	    {
@@ -5004,23 +5164,22 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 				       sqlite3_errmsg (accessor->db_handle));
 	  gaiatopo_set_last_error_msg (topo, msg);
 	  sqlite3_free (msg);
-	  accessor->inside_lwt_callback = 0;
 	  return -1;
       }
 
     for (i = 0; i < numnodes; i++)
       {
 	  /* parameter binding */
-	  const LWT_ISO_NODE *nd = nodes + i;
+	  const RTT_ISO_NODE *nd = nodes + i;
 	  icol = 1;
 	  sqlite3_reset (stmt);
 	  sqlite3_clear_bindings (stmt);
-	  if (upd_fields & LWT_COL_NODE_NODE_ID)
+	  if (upd_fields & RTT_COL_NODE_NODE_ID)
 	    {
 		sqlite3_bind_int64 (stmt, icol, nd->node_id);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_NODE_CONTAINING_FACE)
+	  if (upd_fields & RTT_COL_NODE_CONTAINING_FACE)
 	    {
 		if (nd->containing_face < 0)
 		    sqlite3_bind_null (stmt, icol);
@@ -5028,16 +5187,16 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 		    sqlite3_bind_int64 (stmt, icol, nd->containing_face);
 		icol++;
 	    }
-	  if (upd_fields & LWT_COL_NODE_GEOM)
+	  if (upd_fields & RTT_COL_NODE_GEOM)
 	    {
-		POINTARRAY *pa;
-		POINT4D pt4d;
+		RTPOINTARRAY *pa;
+		RTPOINT4D pt4d;
 		double x;
 		double y;
 		double z;
-		/* extracting X and Y from LWPOINT */
+		/* extracting X and Y from RTPOINT */
 		pa = nd->geom->point;
-		getPoint4d_p (pa, 0, &pt4d);
+		rt_getPoint4d_p (ctx, pa, 0, &pt4d);
 		x = pt4d.x;
 		y = pt4d.y;
 		if (accessor->has_z)
@@ -5067,27 +5226,28 @@ callback_updateNodesById (const LWT_BE_TOPOLOGY * lwt_topo,
 	    }
       }
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return changed;
 
   error:
     sqlite3_finalize (stmt);
-    accessor->inside_lwt_callback = 0;
     return -1;
 }
 
-LWT_ISO_FACE *
-callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo, const GBOX * box,
-			     int *numelems, int fields, int limit)
+RTT_ISO_FACE *
+callback_getFaceWithinBox2D (const RTT_BE_TOPOLOGY * rtt_topo,
+			     const RTGBOX * box, int *numelems, int fields,
+			     int limit)
 {
 /* callback function: getFaceWithinBox2D */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    const RTCTX *ctx = NULL;
+    struct splite_internal_cache *cache = NULL;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     sqlite3_stmt *stmt;
     int ret;
     int count = 0;
     struct topo_faces_list *list = NULL;
-    LWT_ISO_FACE *result = NULL;
+    RTT_ISO_FACE *result = NULL;
     if (accessor == NULL)
       {
 	  *numelems = -1;
@@ -5100,7 +5260,16 @@ callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo, const GBOX * box,
 	  *numelems = -1;
 	  return NULL;
       }
-    accessor->inside_lwt_callback = 1;
+
+    cache = (struct splite_internal_cache *) accessor->cache;
+    if (cache == NULL)
+	return NULL;
+    if (cache->magic1 != SPATIALITE_CACHE_MAGIC1
+	|| cache->magic2 != SPATIALITE_CACHE_MAGIC2)
+	return NULL;
+    ctx = cache->RTTOPO_handle;
+    if (ctx == NULL)
+	return NULL;
 
 /* setting up the prepared statement */
     sqlite3_reset (stmt);
@@ -5161,16 +5330,16 @@ callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo, const GBOX * box,
 	    {
 		int i = 0;
 		struct topo_face *p_fc;
-		result = lwalloc (sizeof (LWT_ISO_FACE) * list->count);
+		result = rtalloc (ctx, sizeof (RTT_ISO_FACE) * list->count);
 		p_fc = list->first;
 		while (p_fc != NULL)
 		  {
-		      LWT_ISO_FACE *fc = result + i;
-		      if (fields & LWT_COL_FACE_FACE_ID)
+		      RTT_ISO_FACE *fc = result + i;
+		      if (fields & RTT_COL_FACE_FACE_ID)
 			  fc->face_id = p_fc->face_id;
-		      if (fields & LWT_COL_FACE_MBR)
+		      if (fields & RTT_COL_FACE_MBR)
 			{
-			    fc->mbr = gbox_new (0);
+			    fc->mbr = gbox_new (ctx, 0);
 			    fc->mbr->xmin = p_fc->minx;
 			    fc->mbr->ymin = p_fc->miny;
 			    fc->mbr->xmax = p_fc->maxx;
@@ -5183,7 +5352,6 @@ callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo, const GBOX * box,
 	    }
       }
     destroy_faces_list (list);
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return result;
 
@@ -5191,15 +5359,14 @@ callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * lwt_topo, const GBOX * box,
     if (list != NULL)
 	destroy_faces_list (list);
     *numelems = -1;
-    accessor->inside_lwt_callback = 0;
     sqlite3_reset (stmt);
     return NULL;
 }
 
 int
-callback_updateTopoGeomEdgeSplit (const LWT_BE_TOPOLOGY * topo,
-				  LWT_ELEMID split_edge, LWT_ELEMID new_edge1,
-				  LWT_ELEMID new_edge2)
+callback_updateTopoGeomEdgeSplit (const RTT_BE_TOPOLOGY * topo,
+				  RTT_ELEMID split_edge, RTT_ELEMID new_edge1,
+				  RTT_ELEMID new_edge2)
 {
 /* does nothing */
     if (topo != NULL && split_edge == 0 && new_edge1 == 0 && new_edge2 == 0)
@@ -5208,9 +5375,9 @@ callback_updateTopoGeomEdgeSplit (const LWT_BE_TOPOLOGY * topo,
 }
 
 int
-callback_updateTopoGeomFaceSplit (const LWT_BE_TOPOLOGY * topo,
-				  LWT_ELEMID split_face,
-				  LWT_ELEMID new_face1, LWT_ELEMID new_face2)
+callback_updateTopoGeomFaceSplit (const RTT_BE_TOPOLOGY * topo,
+				  RTT_ELEMID split_face,
+				  RTT_ELEMID new_face1, RTT_ELEMID new_face2)
 {
 /* does nothing */
     if (topo != NULL && split_face == 0 && new_face1 == 0 && new_face2 == 0)
@@ -5219,9 +5386,9 @@ callback_updateTopoGeomFaceSplit (const LWT_BE_TOPOLOGY * topo,
 }
 
 int
-callback_checkTopoGeomRemEdge (const LWT_BE_TOPOLOGY * topo,
-			       LWT_ELEMID rem_edge, LWT_ELEMID face_left,
-			       LWT_ELEMID face_right)
+callback_checkTopoGeomRemEdge (const RTT_BE_TOPOLOGY * topo,
+			       RTT_ELEMID rem_edge, RTT_ELEMID face_left,
+			       RTT_ELEMID face_right)
 {
 /* does nothing */
     if (topo != NULL && rem_edge == 0 && face_left == 0 && face_right == 0)
@@ -5230,8 +5397,8 @@ callback_checkTopoGeomRemEdge (const LWT_BE_TOPOLOGY * topo,
 }
 
 int
-callback_updateTopoGeomFaceHeal (const LWT_BE_TOPOLOGY * topo, LWT_ELEMID face1,
-				 LWT_ELEMID face2, LWT_ELEMID newface)
+callback_updateTopoGeomFaceHeal (const RTT_BE_TOPOLOGY * topo, RTT_ELEMID face1,
+				 RTT_ELEMID face2, RTT_ELEMID newface)
 {
 /* does nothing */
     if (topo != NULL && face1 == 0 && face2 == 0 && newface == 0)
@@ -5240,9 +5407,9 @@ callback_updateTopoGeomFaceHeal (const LWT_BE_TOPOLOGY * topo, LWT_ELEMID face1,
 }
 
 int
-callback_checkTopoGeomRemNode (const LWT_BE_TOPOLOGY * topo,
-			       LWT_ELEMID rem_node, LWT_ELEMID e1,
-			       LWT_ELEMID e2)
+callback_checkTopoGeomRemNode (const RTT_BE_TOPOLOGY * topo,
+			       RTT_ELEMID rem_node, RTT_ELEMID e1,
+			       RTT_ELEMID e2)
 {
 /* does nothing */
     if (topo != NULL && rem_node == 0 && e1 == 0 && e2 == 0)
@@ -5251,8 +5418,8 @@ callback_checkTopoGeomRemNode (const LWT_BE_TOPOLOGY * topo,
 }
 
 int
-callback_updateTopoGeomEdgeHeal (const LWT_BE_TOPOLOGY * topo, LWT_ELEMID edge1,
-				 LWT_ELEMID edge2, LWT_ELEMID newedge)
+callback_updateTopoGeomEdgeHeal (const RTT_BE_TOPOLOGY * topo, RTT_ELEMID edge1,
+				 RTT_ELEMID edge2, RTT_ELEMID newedge)
 {
 /* does nothing */
     if (topo != NULL && edge1 == 0 && edge2 == 0 && newedge == 0)
@@ -5261,10 +5428,10 @@ callback_updateTopoGeomEdgeHeal (const LWT_BE_TOPOLOGY * topo, LWT_ELEMID edge1,
 }
 
 int
-callback_topoGetSRID (const LWT_BE_TOPOLOGY * lwt_topo)
+callback_topoGetSRID (const RTT_BE_TOPOLOGY * rtt_topo)
 {
 /* callback function: topoGetSRID */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     if (accessor == NULL)
 	return -1;
@@ -5273,10 +5440,10 @@ callback_topoGetSRID (const LWT_BE_TOPOLOGY * lwt_topo)
 }
 
 double
-callback_topoGetPrecision (const LWT_BE_TOPOLOGY * lwt_topo)
+callback_topoGetPrecision (const RTT_BE_TOPOLOGY * rtt_topo)
 {
 /* callback function: topoGetPrecision */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     if (accessor == NULL)
 	return 0.0;
@@ -5285,10 +5452,10 @@ callback_topoGetPrecision (const LWT_BE_TOPOLOGY * lwt_topo)
 }
 
 int
-callback_topoHasZ (const LWT_BE_TOPOLOGY * lwt_topo)
+callback_topoHasZ (const RTT_BE_TOPOLOGY * rtt_topo)
 {
 /* callback function: topoHasZ */
-    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) lwt_topo;
+    GaiaTopologyAccessorPtr topo = (GaiaTopologyAccessorPtr) rtt_topo;
     struct gaia_topology *accessor = (struct gaia_topology *) topo;
     if (accessor == NULL)
 	return 0;
@@ -5296,4 +5463,4 @@ callback_topoHasZ (const LWT_BE_TOPOLOGY * lwt_topo)
     return accessor->has_z;
 }
 
-#endif /* end TOPOLOGY conditionals */
+#endif /* end ENABLE_RTTOPO conditionals */
diff --git a/src/topology/topology_private.h b/src/topology/topology_private.h
index fd49580..20ff179 100644
--- a/src/topology/topology_private.h
+++ b/src/topology/topology_private.h
@@ -88,11 +88,10 @@ struct gaia_topology
     sqlite3_stmt *stmt_deleteFacesById;
     sqlite3_stmt *stmt_deleteNodesById;
     void *callbacks;
-    void *lwt_iface;
-    void *lwt_topology;
+    void *rtt_iface;
+    void *rtt_topology;
     struct gaia_topology *prev;
     struct gaia_topology *next;
-    int inside_lwt_callback;
 };
 
 struct face_edge_item
@@ -125,10 +124,10 @@ struct face_edges
 };
 
 /* common utilities */
-TOPOLOGY_PRIVATE LWLINE *gaia_convert_linestring_to_lwline (gaiaLinestringPtr
+TOPOLOGY_PRIVATE RTLINE *gaia_convert_linestring_to_rtline (const RTCTX *ctx, gaiaLinestringPtr
 							    ln, int srid,
 							    int has_z);
-TOPOLOGY_PRIVATE LWPOLY *gaia_convert_polygon_to_lwpoly (gaiaPolygonPtr pg,
+TOPOLOGY_PRIVATE RTPOLY *gaia_convert_polygon_to_rtpoly (const RTCTX *ctx, gaiaPolygonPtr pg,
 							 int srid, int has_z);
 
 /* prototypes for functions handling Topology errors */
@@ -271,136 +270,136 @@ TOPOLOGY_PRIVATE void create_all_topo_prepared_stmts (const void *cache);
 
 
 /* callback function prototypes */
-const char *callback_lastErrorMessage (const LWT_BE_DATA * be);
+const char *callback_lastErrorMessage (const RTT_BE_DATA * be);
 
-int callback_freeTopology (LWT_BE_TOPOLOGY * topo);
+int callback_freeTopology (RTT_BE_TOPOLOGY * topo);
 
-LWT_BE_TOPOLOGY *callback_loadTopologyByName (const LWT_BE_DATA * be,
+RTT_BE_TOPOLOGY *callback_loadTopologyByName (const RTT_BE_DATA * be,
 					      const char *name);
 
-LWT_ISO_NODE *callback_getNodeById (const LWT_BE_TOPOLOGY * topo,
-				    const LWT_ELEMID * ids, int *numelems,
+RTT_ISO_NODE *callback_getNodeById (const RTT_BE_TOPOLOGY * topo,
+				    const RTT_ELEMID * ids, int *numelems,
 				    int fields);
 
-LWT_ISO_NODE *callback_getNodeWithinDistance2D (const LWT_BE_TOPOLOGY *
-						topo, const LWPOINT * pt,
+RTT_ISO_NODE *callback_getNodeWithinDistance2D (const RTT_BE_TOPOLOGY *
+						topo, const RTPOINT * pt,
 						double dist, int *numelems,
 						int fields, int limit);
 
-int callback_insertNodes (const LWT_BE_TOPOLOGY * topo,
-			  LWT_ISO_NODE * nodes, int numelems);
+int callback_insertNodes (const RTT_BE_TOPOLOGY * topo,
+			  RTT_ISO_NODE * nodes, int numelems);
 
-LWT_ISO_EDGE *callback_getEdgeById (const LWT_BE_TOPOLOGY * topo,
-				    const LWT_ELEMID * ids, int *numelems,
+RTT_ISO_EDGE *callback_getEdgeById (const RTT_BE_TOPOLOGY * topo,
+				    const RTT_ELEMID * ids, int *numelems,
 				    int fields);
 
-LWT_ISO_EDGE *callback_getEdgeWithinDistance2D (const LWT_BE_TOPOLOGY *
-						topo, const LWPOINT * pt,
+RTT_ISO_EDGE *callback_getEdgeWithinDistance2D (const RTT_BE_TOPOLOGY *
+						topo, const RTPOINT * pt,
 						double dist, int *numelems,
 						int fields, int limit);
 
-LWT_ELEMID callback_getNextEdgeId (const LWT_BE_TOPOLOGY * topo);
+RTT_ELEMID callback_getNextEdgeId (const RTT_BE_TOPOLOGY * topo);
 
-int callback_insertEdges (const LWT_BE_TOPOLOGY * topo,
-			  LWT_ISO_EDGE * edges, int numelems);
+int callback_insertEdges (const RTT_BE_TOPOLOGY * topo,
+			  RTT_ISO_EDGE * edges, int numelems);
 
-int callback_updateEdges (const LWT_BE_TOPOLOGY * topo,
-			  const LWT_ISO_EDGE * sel_edge, int sel_fields,
-			  const LWT_ISO_EDGE * upd_edge, int upd_fields,
-			  const LWT_ISO_EDGE * exc_edge, int exc_fields);
+int callback_updateEdges (const RTT_BE_TOPOLOGY * topo,
+			  const RTT_ISO_EDGE * sel_edge, int sel_fields,
+			  const RTT_ISO_EDGE * upd_edge, int upd_fields,
+			  const RTT_ISO_EDGE * exc_edge, int exc_fields);
 
-LWT_ISO_FACE *callback_getFaceById (const LWT_BE_TOPOLOGY * topo,
-				    const LWT_ELEMID * ids, int *numelems,
+RTT_ISO_FACE *callback_getFaceById (const RTT_BE_TOPOLOGY * topo,
+				    const RTT_ELEMID * ids, int *numelems,
 				    int fields);
 
-LWT_ELEMID callback_getFaceContainingPoint (const LWT_BE_TOPOLOGY * topo,
-					    const LWPOINT * pt);
+RTT_ELEMID callback_getFaceContainingPoint (const RTT_BE_TOPOLOGY * topo,
+					    const RTPOINT * pt);
 
-int callback_deleteEdges (const LWT_BE_TOPOLOGY * topo,
-			  const LWT_ISO_EDGE * sel_edge, int sel_fields);
+int callback_deleteEdges (const RTT_BE_TOPOLOGY * topo,
+			  const RTT_ISO_EDGE * sel_edge, int sel_fields);
 
-LWT_ISO_NODE *callback_getNodeWithinBox2D (const LWT_BE_TOPOLOGY * topo,
-					   const GBOX * box, int *numelems,
+RTT_ISO_NODE *callback_getNodeWithinBox2D (const RTT_BE_TOPOLOGY * topo,
+					   const RTGBOX * box, int *numelems,
 					   int fields, int limit);
 
-LWT_ISO_EDGE *callback_getEdgeWithinBox2D (const LWT_BE_TOPOLOGY * topo,
-					   const GBOX * box, int *numelems,
+RTT_ISO_EDGE *callback_getEdgeWithinBox2D (const RTT_BE_TOPOLOGY * topo,
+					   const RTGBOX * box, int *numelems,
 					   int fields, int limit);
 
-LWT_ISO_EDGE *callback_getEdgeByNode (const LWT_BE_TOPOLOGY * topo,
-				      const LWT_ELEMID * ids,
+RTT_ISO_EDGE *callback_getEdgeByNode (const RTT_BE_TOPOLOGY * topo,
+				      const RTT_ELEMID * ids,
 				      int *numelems, int fields);
 
-int callback_updateNodes (const LWT_BE_TOPOLOGY * topo,
-			  const LWT_ISO_NODE * sel_node, int sel_fields,
-			  const LWT_ISO_NODE * upd_node, int upd_fields,
-			  const LWT_ISO_NODE * exc_node, int exc_fields);
+int callback_updateNodes (const RTT_BE_TOPOLOGY * topo,
+			  const RTT_ISO_NODE * sel_node, int sel_fields,
+			  const RTT_ISO_NODE * upd_node, int upd_fields,
+			  const RTT_ISO_NODE * exc_node, int exc_fields);
 
-int callback_updateTopoGeomFaceSplit (const LWT_BE_TOPOLOGY * topo,
-				      LWT_ELEMID split_face,
-				      LWT_ELEMID new_face1,
-				      LWT_ELEMID new_face2);
+int callback_updateTopoGeomFaceSplit (const RTT_BE_TOPOLOGY * topo,
+				      RTT_ELEMID split_face,
+				      RTT_ELEMID new_face1,
+				      RTT_ELEMID new_face2);
 
-int callback_insertFaces (const LWT_BE_TOPOLOGY * topo,
-			  LWT_ISO_FACE * faces, int numelems);
+int callback_insertFaces (const RTT_BE_TOPOLOGY * topo,
+			  RTT_ISO_FACE * faces, int numelems);
 
-int callback_updateFacesById (const LWT_BE_TOPOLOGY * topo,
-			      const LWT_ISO_FACE * faces, int numfaces);
+int callback_updateFacesById (const RTT_BE_TOPOLOGY * topo,
+			      const RTT_ISO_FACE * faces, int numfaces);
 
-int callback_deleteFacesById (const LWT_BE_TOPOLOGY * topo,
-			      const LWT_ELEMID * ids, int numelems);
+int callback_deleteFacesById (const RTT_BE_TOPOLOGY * topo,
+			      const RTT_ELEMID * ids, int numelems);
 
-LWT_ELEMID *callback_getRingEdges (const LWT_BE_TOPOLOGY * topo,
-				   LWT_ELEMID edge, int *numedges, int limit);
+RTT_ELEMID *callback_getRingEdges (const RTT_BE_TOPOLOGY * topo,
+				   RTT_ELEMID edge, int *numedges, int limit);
 
-int callback_updateEdgesById (const LWT_BE_TOPOLOGY * topo,
-			      const LWT_ISO_EDGE * edges, int numedges,
+int callback_updateEdgesById (const RTT_BE_TOPOLOGY * topo,
+			      const RTT_ISO_EDGE * edges, int numedges,
 			      int upd_fields);
 
-LWT_ISO_EDGE *callback_getEdgeByFace (const LWT_BE_TOPOLOGY * topo,
-				      const LWT_ELEMID * ids,
+RTT_ISO_EDGE *callback_getEdgeByFace (const RTT_BE_TOPOLOGY * topo,
+				      const RTT_ELEMID * ids,
 				      int *numelems, int fields,
-				      const GBOX * box);
+				      const RTGBOX * box);
 
-LWT_ISO_NODE *callback_getNodeByFace (const LWT_BE_TOPOLOGY * topo,
-				      const LWT_ELEMID * faces,
+RTT_ISO_NODE *callback_getNodeByFace (const RTT_BE_TOPOLOGY * topo,
+				      const RTT_ELEMID * faces,
 				      int *numelems, int fields,
-				      const GBOX * box);
+				      const RTGBOX * box);
 
-int callback_updateNodesById (const LWT_BE_TOPOLOGY * topo,
-			      const LWT_ISO_NODE * nodes, int numnodes,
+int callback_updateNodesById (const RTT_BE_TOPOLOGY * topo,
+			      const RTT_ISO_NODE * nodes, int numnodes,
 			      int upd_fields);
 
-int callback_deleteNodesById (const LWT_BE_TOPOLOGY * topo,
-			      const LWT_ELEMID * ids, int numelems);
+int callback_deleteNodesById (const RTT_BE_TOPOLOGY * topo,
+			      const RTT_ELEMID * ids, int numelems);
 
-int callback_updateTopoGeomEdgeSplit (const LWT_BE_TOPOLOGY * topo,
-				      LWT_ELEMID split_edge,
-				      LWT_ELEMID new_edge1,
-				      LWT_ELEMID new_edge2);
+int callback_updateTopoGeomEdgeSplit (const RTT_BE_TOPOLOGY * topo,
+				      RTT_ELEMID split_edge,
+				      RTT_ELEMID new_edge1,
+				      RTT_ELEMID new_edge2);
 
-int callback_checkTopoGeomRemEdge (const LWT_BE_TOPOLOGY * topo,
-				   LWT_ELEMID rem_edge, LWT_ELEMID face_left,
-				   LWT_ELEMID face_right);
+int callback_checkTopoGeomRemEdge (const RTT_BE_TOPOLOGY * topo,
+				   RTT_ELEMID rem_edge, RTT_ELEMID face_left,
+				   RTT_ELEMID face_right);
 
-int callback_updateTopoGeomFaceHeal (const LWT_BE_TOPOLOGY * topo,
-				     LWT_ELEMID face1, LWT_ELEMID face2,
-				     LWT_ELEMID newface);
+int callback_updateTopoGeomFaceHeal (const RTT_BE_TOPOLOGY * topo,
+				     RTT_ELEMID face1, RTT_ELEMID face2,
+				     RTT_ELEMID newface);
 
-int callback_checkTopoGeomRemNode (const LWT_BE_TOPOLOGY * topo,
-				   LWT_ELEMID rem_node, LWT_ELEMID e1,
-				   LWT_ELEMID e2);
+int callback_checkTopoGeomRemNode (const RTT_BE_TOPOLOGY * topo,
+				   RTT_ELEMID rem_node, RTT_ELEMID e1,
+				   RTT_ELEMID e2);
 
-int callback_updateTopoGeomEdgeHeal (const LWT_BE_TOPOLOGY * topo,
-				     LWT_ELEMID edge1, LWT_ELEMID edge2,
-				     LWT_ELEMID newedge);
+int callback_updateTopoGeomEdgeHeal (const RTT_BE_TOPOLOGY * topo,
+				     RTT_ELEMID edge1, RTT_ELEMID edge2,
+				     RTT_ELEMID newedge);
 
-LWT_ISO_FACE *callback_getFaceWithinBox2D (const LWT_BE_TOPOLOGY * topo,
-					   const GBOX * box, int *numelems,
+RTT_ISO_FACE *callback_getFaceWithinBox2D (const RTT_BE_TOPOLOGY * topo,
+					   const RTGBOX * box, int *numelems,
 					   int fields, int limit);
 
-int callback_topoGetSRID (const LWT_BE_TOPOLOGY * topo);
+int callback_topoGetSRID (const RTT_BE_TOPOLOGY * topo);
 
-double callback_topoGetPrecision (const LWT_BE_TOPOLOGY * topo);
+double callback_topoGetPrecision (const RTT_BE_TOPOLOGY * topo);
 
-int callback_topoHasZ (const LWT_BE_TOPOLOGY * topo);
+int callback_topoHasZ (const RTT_BE_TOPOLOGY * topo);
diff --git a/src/virtualtext/virtualtext.c b/src/virtualtext/virtualtext.c
index 2bd482a..f42cdc0 100644
--- a/src/virtualtext/virtualtext.c
+++ b/src/virtualtext/virtualtext.c
@@ -113,16 +113,18 @@ text_clean_integer (char *value)
 {
 /* cleaning an integer value */
     char last;
-    char buffer[35536];
+    char *buffer;
     int len = strlen (value);
     last = value[len - 1];
     if (last == '-' || last == '+')
       {
 	  /* trailing sign; transforming into a leading sign */
+	  buffer = malloc (len + 1);
 	  *buffer = last;
 	  strcpy (buffer + 1, value);
 	  buffer[len - 1] = '\0';
 	  strcpy (value, buffer);
+	  free (buffer);
       }
 }
 
@@ -132,16 +134,18 @@ text_clean_double (char *value)
 /* cleaning an integer value */
     char *p;
     char last;
-    char buffer[35536];
+    char *buffer;
     int len = strlen (value);
     last = value[len - 1];
     if (last == '-' || last == '+')
       {
 	  /* trailing sign; transforming into a leading sign */
+	  buffer = malloc (len + 1);
 	  *buffer = last;
 	  strcpy (buffer + 1, value);
 	  buffer[len - 1] = '\0';
 	  strcpy (value, buffer);
+	  free (buffer);
       }
     p = value;
     while (*p != '\0')
@@ -504,8 +508,8 @@ vtxt_eval_constraints (VirtualTextCursorPtr cursor)
     char buf[4096];
     int type;
     const char *value = NULL;
-    sqlite3_int64 int_value;
-    double dbl_value;
+    sqlite3_int64 int_value = 0;
+    double dbl_value = 0.0;
     char *txt_value = NULL;
     int is_int = 0;
     int is_dbl = 0;
@@ -1164,9 +1168,55 @@ vrttxt_is_integer (const char *value)
 }
 
 static int
-vrttxt_is_double (const char *value, char decimal_separator)
+vrttxt_is_scientific_double (const char *value, char decimal_separator)
 {
-/* checking if this value can be a DOUBLE */
+/* checking if this value can be a DOUBLE (scientific notation: -1.567E-16) */
+    int points = 0;
+    int exp = 0;
+    int sign = 0;
+    int invalid = 0;
+    int digit2 = 0;
+    int digit3 = 0;
+    const char *p = value;
+    if (*p == '-' || *p == '+')
+	p++;			/* skipping the first sign */
+    while (*p != '\0')
+      {
+	  if (*p == decimal_separator)
+	    {
+		if (digit2 == 0)
+		    points++;
+		else
+		    invalid++;
+	    }
+	  else if (*p == 'E' || *p == 'e')
+	      exp++;
+	  else if (*p == '-' || *p == '+')
+	    {
+		if (exp && !digit3)
+		    sign++;
+		else
+		    invalid++;
+	    }
+	  else if (*p >= '0' && *p <= '9')
+	    {
+		if (exp)
+		    digit3++;
+		else if (points)
+		    digit2++;
+	    }
+	  p++;
+      }
+    if (digit2 >= 0 && exp == 1 && (sign == 0 || sign == 1) && digit3
+	&& !invalid)
+	return 1;
+    return 0;
+}
+
+static int
+vrttxt_is_plain_double (const char *value, char decimal_separator)
+{
+/* checking if this value can be a DOUBLE (normal case: -123.567 */
     int invalids = 0;
     int digits = 0;
     int signs = 0;
@@ -1216,6 +1266,17 @@ vrttxt_is_double (const char *value, char decimal_separator)
 }
 
 static int
+vrttxt_is_double (const char *value, char decimal_separator)
+{
+/* checking if this value can be a DOUBLE */
+    if (vrttxt_is_plain_double (value, decimal_separator))
+	return 1;
+    if (vrttxt_is_scientific_double (value, decimal_separator))
+	return 1;
+    return 0;
+}
+
+static int
 vrttxt_check_type (const char *value, char decimal_separator)
 {
 /* checking the Field type */
@@ -1539,7 +1600,7 @@ gaiaTextReaderParse (gaiaTextReaderPtr txt)
 		      if (token_start)
 			  masked = 1;
 		  }
-		vrttxt_line_push (txt, c);
+		vrttxt_line_push (txt, (char) c);
 		if (txt->error)
 		    return 0;
 		row_offset++;
@@ -1551,7 +1612,7 @@ gaiaTextReaderParse (gaiaTextReaderPtr txt)
 	    {
 		if (masked)
 		  {
-		      vrttxt_line_push (txt, c);
+		      vrttxt_line_push (txt, (char) c);
 		      if (txt->error)
 			  return 0;
 		      row_offset++;
@@ -1563,7 +1624,7 @@ gaiaTextReaderParse (gaiaTextReaderPtr txt)
 	    {
 		if (masked)
 		  {
-		      vrttxt_line_push (txt, c);
+		      vrttxt_line_push (txt, (char) c);
 		      if (txt->error)
 			  return 0;
 		      row_offset++;
@@ -1586,14 +1647,14 @@ gaiaTextReaderParse (gaiaTextReaderPtr txt)
 	    {
 		if (masked)
 		  {
-		      vrttxt_line_push (txt, c);
+		      vrttxt_line_push (txt, (char) c);
 		      if (txt->error)
 			  return 0;
 		      row_offset++;
 		      offset++;
 		      continue;
 		  }
-		vrttxt_line_push (txt, c);
+		vrttxt_line_push (txt, (char) c);
 		if (txt->error)
 		    return 0;
 		row_offset++;
@@ -1602,7 +1663,7 @@ gaiaTextReaderParse (gaiaTextReaderPtr txt)
 		offset++;
 		continue;
 	    }
-	  vrttxt_line_push (txt, c);
+	  vrttxt_line_push (txt, (char) c);
 	  if (txt->error)
 	      return 0;
 	  row_offset++;
diff --git a/src/wfs/wfs_in.c b/src/wfs/wfs_in.c
index b473ff4..bbc907a 100644
--- a/src/wfs/wfs_in.c
+++ b/src/wfs/wfs_in.c
@@ -2536,11 +2536,11 @@ do_adjust_geoms (sqlite3 * sqlite, const char *table, const char *geometry,
     char *errMsg = NULL;
     char *xtable;
     char *xgeom;
-    char *xopen;
-    char *xclose;
+    char *xopen = "";
+    char *xclose = "";
     char *sql;
     int ret;
-    int dims;
+    int dims = -1;
     int metadata_version = checkSpatialMetaData (sqlite);
 
 /* starting a transaction */
@@ -2993,8 +2993,8 @@ do_adjust_geoms (sqlite3 * sqlite, const char *table, const char *geometry,
     if (metadata_version == 1)
       {
 	  /* legacy metadata style <= v.3.1.0 */
-	  const char *pType;
-	  const char *pDims;
+	  const char *pType = "";
+	  const char *pDims = "";
 	  switch (type)
 	    {
 	    case GAIA_POINT:
diff --git a/test/Makefile.am b/test/Makefile.am
index bad520c..485f652 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -197,11 +197,11 @@ EXTRA_DIST = fnmatch_impl4win.h \
 	Gpx-sample.gpx 000323485.gpx
 
 SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
-	sql_stmt_libxml2_tests sql_stmt_lwgeom_tests \
-	sql_stmt_lwgeom_20_tests sql_stmt_lwgeom_22_tests \
+	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
 	sql_stmt_mathsql_tests sql_stmt_proj_tests \
 	sql_stmt_security_tests sql_stmt_tests \
 	sql_stmt_xmlsec_tests sql_stmt_geopackage_tests \
 	sql_stmt_freexl_tests sql_stmt_cache_tests \
 	sql_stmt_nocache_tests sql_stmt_voronoj1_tests \
-	sql_stmt_voronoj2_tests
+	sql_stmt_voronoj2_tests sql_stmt_gpkg_epsg_tests \
+	sql_stmt_rttopo_tests
diff --git a/test/Makefile.in b/test/Makefile.in
index becaffa..2ff343a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1123,14 +1123,14 @@ EXTRA_DIST = fnmatch_impl4win.h \
 	Gpx-sample.gpx 000323485.gpx
 
 SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
-	sql_stmt_libxml2_tests sql_stmt_lwgeom_tests \
-	sql_stmt_lwgeom_20_tests sql_stmt_lwgeom_22_tests \
+	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
 	sql_stmt_mathsql_tests sql_stmt_proj_tests \
 	sql_stmt_security_tests sql_stmt_tests \
 	sql_stmt_xmlsec_tests sql_stmt_geopackage_tests \
 	sql_stmt_freexl_tests sql_stmt_cache_tests \
 	sql_stmt_nocache_tests sql_stmt_voronoj1_tests \
-	sql_stmt_voronoj2_tests
+	sql_stmt_voronoj2_tests sql_stmt_gpkg_epsg_tests \
+	sql_stmt_rttopo_tests
 
 all: all-recursive
 
diff --git a/test/check_create.c b/test/check_create.c
index 9a06177..610d92c 100644
--- a/test/check_create.c
+++ b/test/check_create.c
@@ -194,7 +194,8 @@ main (int argc, char *argv[])
 	  return -5;
       }
     ret =
-	sqlite3_exec (handle, "SELECT HasGeosReentrant()", NULL, NULL, &err_msg);
+	sqlite3_exec (handle, "SELECT HasGeosReentrant()", NULL, NULL,
+		      &err_msg);
     if (ret != SQLITE_OK)
       {
 	  fprintf (stderr, "HasGeosReentrant() error: %s\n", err_msg);
@@ -203,7 +204,8 @@ main (int argc, char *argv[])
 	  return -6;
       }
     ret =
-	sqlite3_exec (handle, "SELECT HasGeosOnlyReentrant()", NULL, NULL, &err_msg);
+	sqlite3_exec (handle, "SELECT HasGeosOnlyReentrant()", NULL, NULL,
+		      &err_msg);
     if (ret != SQLITE_OK)
       {
 	  fprintf (stderr, "HasGeosOnlyReentrant() error: %s\n", err_msg);
@@ -260,10 +262,10 @@ main (int argc, char *argv[])
 	  sqlite3_close (handle);
 	  return -13;
       }
-    ret = sqlite3_exec (handle, "SELECT HasLwGeom()", NULL, NULL, &err_msg);
+    ret = sqlite3_exec (handle, "SELECT HasRtTopo()", NULL, NULL, &err_msg);
     if (ret != SQLITE_OK)
       {
-	  fprintf (stderr, "HasLwGeom() error: %s\n", err_msg);
+	  fprintf (stderr, "HasRtTopo() error: %s\n", err_msg);
 	  sqlite3_free (err_msg);
 	  sqlite3_close (handle);
 	  return -14;
diff --git a/test/check_dxf.c b/test/check_dxf.c
index e0c2751..893f471 100644
--- a/test/check_dxf.c
+++ b/test/check_dxf.c
@@ -1409,8 +1409,8 @@ main (int argc, char *argv[])
     for (cache_mode = 0; cache_mode <= 1; cache_mode++)
       {
 #ifdef GEOS_USE_ONLY_R_API	/* skipping legacy test */
-if (!cache_mode)
-continue;
+	  if (!cache_mode)
+	      continue;
 #endif
 
 	  fprintf (stderr, "\n******* Testing DXF in %s cache-mode\n\n",
diff --git a/test/check_extension.c b/test/check_extension.c
index 45c578c..f58bd13 100644
--- a/test/check_extension.c
+++ b/test/check_extension.c
@@ -209,7 +209,7 @@ main (int argc, char *argv[])
       }
     sqlite3_free_table (results);
 
-    sql_statement = sqlite3_mprintf ("SELECT lwgeom_version()");
+    sql_statement = sqlite3_mprintf ("SELECT rttopo_version()");
     ret =
 	sqlite3_get_table (db_handle, sql_statement, &results, &rows,
 			   &columns, &err_msg);
@@ -223,26 +223,26 @@ main (int argc, char *argv[])
     if ((rows != 1) || (columns != 1))
       {
 	  fprintf (stderr,
-		   "Unexpected error: lwgeom_version() bad result: %i/%i.\n",
+		   "Unexpected error: rttopo_version() bad result: %i/%i.\n",
 		   rows, columns);
 	  return -23;
       }
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
     /* we tolerate any string here, because versions always change */
     if (strlen (results[1]) == 0)
       {
-	  fprintf (stderr, "Unexpected error: lwgeom_version() bad result.\n");
+	  fprintf (stderr, "Unexpected error: rttopo_version() bad result.\n");
 	  return -24;
       }
-#else /* LWGEOM is not supported */
+#else /* RTTOPO is not supported */
     /* in this case we expect a NULL */
     if (results[1] != NULL)
       {
-	  fprintf (stderr, "Unexpected error: lwgeom_version() bad result.\n");
+	  fprintf (stderr, "Unexpected error: rttopo_version() bad result.\n");
 	  return -25;
       }
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
     sqlite3_free_table (results);
 
     sql_statement = sqlite3_mprintf ("SELECT libxml2_version()");
diff --git a/test/check_multithread.c b/test/check_multithread.c
index 5d9ab54..361726e 100644
--- a/test/check_multithread.c
+++ b/test/check_multithread.c
@@ -577,9 +577,9 @@ load_testcases (struct test_list *list)
     free (namelist);
 #endif /* end GEOS_ADVANCED conditional */
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
-/* LWGEOM SQL testcases */
-    current_dir = "sql_stmt_lwgeom_tests";
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
+/* RTTOPO SQL testcases */
+    current_dir = "sql_stmt_rtgeom_tests";
     path = sqlite3_mprintf ("%s", current_dir);
     n = scandir (path, &namelist, test_case_filter, alphasort);
     if (n < 0)
@@ -602,7 +602,7 @@ load_testcases (struct test_list *list)
 	  free (namelist[i]);
       }
     free (namelist);
-#endif /* end LWGEOM conditional */
+#endif /* end RTTOPO conditional */
 
 #ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
 /* LIBXML2 SQL testcases */
diff --git a/test/check_network2d.c b/test/check_network2d.c
index 85ebb8f..97a9004 100644
--- a/test/check_network2d.c
+++ b/test/check_network2d.c
@@ -2196,7 +2196,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -2270,7 +2270,7 @@ main (int argc, char *argv[])
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_network3d.c b/test/check_network3d.c
index 4c59590..76636d5 100644
--- a/test/check_network3d.c
+++ b/test/check_network3d.c
@@ -2196,7 +2196,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -2270,7 +2270,7 @@ main (int argc, char *argv[])
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_network_log.c b/test/check_network_log.c
index dee2524..e468c11 100644
--- a/test/check_network_log.c
+++ b/test/check_network_log.c
@@ -948,7 +948,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -1021,7 +1021,7 @@ main (int argc, char *argv[])
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_relations_fncts.c b/test/check_relations_fncts.c
index 12ed4f5..dcad2e6 100644
--- a/test/check_relations_fncts.c
+++ b/test/check_relations_fncts.c
@@ -2101,7 +2101,7 @@ test_legacy_mode ()
     gaiaSetPoint (rng->Coords, 4, 4.5, 4.5);
 
 
-#ifndef GEOS_ONLY_REENTRANT /* skipping legacy mode test (non-thread-safe GEOS API) */
+#ifndef GEOS_ONLY_REENTRANT	/* skipping legacy mode test (non-thread-safe GEOS API) */
     /* Tests Polygons UnaryUnion [as in aggregate ST_Union] */
     g = gaiaUnaryUnion (geom);
     if (g == NULL)
diff --git a/test/check_shp_load.c b/test/check_shp_load.c
index b8f111a..784c4cb 100644
--- a/test/check_shp_load.c
+++ b/test/check_shp_load.c
@@ -78,7 +78,7 @@ do_test (sqlite3 * handle, const void *p_cache)
 	  return -3;
       }
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
 
     if (p_cache == NULL)
 	ret =
@@ -144,7 +144,7 @@ do_test (sqlite3 * handle, const void *p_cache)
 	  return -7;
       }
 
-#endif /* end LWGEOM conditionals */
+#endif /* end RTTOPO conditionals */
     return 0;
 }
 
diff --git a/test/check_shp_load_3d.c b/test/check_shp_load_3d.c
index 3e321d3..e61ed90 100644
--- a/test/check_shp_load_3d.c
+++ b/test/check_shp_load_3d.c
@@ -672,7 +672,7 @@ do_test (sqlite3 * handle, const void *p_cache)
 				 GAIA_VECTORS_LIST_OPTIMISTIC);
     gaiaFreeVectorLayersList (list);
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
 
     if (p_cache == NULL)
 	ret = check_all_geometry_columns (handle, "./report", NULL, NULL);
@@ -702,7 +702,7 @@ do_test (sqlite3 * handle, const void *p_cache)
 	  return -62;
       }
 
-#endif /* end LWGEOM conditionals */
+#endif /* end RTTOPO conditionals */
 
 /* checking gaiaGetVectorLayersList() - Table */
     list =
diff --git a/test/check_sql_stmt.c b/test/check_sql_stmt.c
index 86f196e..1963c66 100644
--- a/test/check_sql_stmt.c
+++ b/test/check_sql_stmt.c
@@ -637,19 +637,17 @@ run_all_testcases (struct db_conn *conn, int load_extension, int legacy)
       {
 	  return result;
       }
-      
+
 #ifdef GEOS_REENTRANT
     result =
-	run_subdir_test ("sql_stmt_voronoj2_tests", conn, load_extension,
-			 0);
+	run_subdir_test ("sql_stmt_voronoj2_tests", conn, load_extension, 0);
     if (result != 0)
       {
 	  return result;
       }
 #else
     result =
-	run_subdir_test ("sql_stmt_voronoj1_tests", conn, load_extension,
-			 0);
+	run_subdir_test ("sql_stmt_voronoj1_tests", conn, load_extension, 0);
     if (result != 0)
       {
 	  return result;
@@ -659,44 +657,30 @@ run_all_testcases (struct db_conn *conn, int load_extension, int legacy)
   skip_geos_advanced:
 #endif /* end GEOS_ADVANCED conditional */
 
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
-#ifdef GEOS_USE_ONLY_R_API	/* only fully thread-safe GEOS API */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
     if (legacy)
       {
-	  /* skipping LWGEOM tests in legacy mode */
+	  /* skipping RTTOPO tests in legacy mode */
 	  fprintf (stderr,
-		   "WARNING: skipping LWGEOM testcases in legacy mode:  GEOS_USE_ONLY_R_API defined !!!\n");
-	  goto skip_lwgeom;
+		   "WARNING: skipping RTTOPO testcases in legacy mode !!!\n");
+	  goto skip_rttopo;
       }
-#endif
-    result = run_subdir_test ("sql_stmt_lwgeom_tests", conn, load_extension, 0);
+
+    result = run_subdir_test ("sql_stmt_rtgeom_tests", conn, load_extension, 0);
     if (result != 0)
       {
 	  return result;
       }
 
-#ifdef POSTGIS_2_2
-    if (sqlite3_libversion_number () >= 3008003)
-      {
-	  result =
-	      run_subdir_test ("sql_stmt_lwgeom_22_tests", conn, load_extension,
-			       0);
-	  if (result != 0)
-	    {
-		return result;
-	    }
-      }
-#else
-    result =
-	run_subdir_test ("sql_stmt_lwgeom_20_tests", conn, load_extension, 0);
+    result = run_subdir_test ("sql_stmt_rttopo_tests", conn, load_extension, 0);
     if (result != 0)
       {
 	  return result;
       }
-#endif
 
-  skip_lwgeom:
-#endif /* end LWGEOM conditional */
+  skip_rttopo:
+
+#endif /* end RTTOPO conditional */
 
 #ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
     result =
@@ -732,6 +716,15 @@ run_all_testcases (struct db_conn *conn, int load_extension, int legacy)
 	    {
 		return result;
 	    }
+#ifndef OMIT_EPSG		/* EPSG is supported */
+	  result =
+	      run_subdir_test ("sql_stmt_gpkg_epsg_tests", conn,
+			       load_extension, 1);
+	  if (result != 0)
+	    {
+		return result;
+	    }
+#endif /* end EPSG conditional */
       }
 
 #endif /* end GEOPACKAGE conditional */
diff --git a/test/check_topology2d.c b/test/check_topology2d.c
index 2acea18..979888f 100644
--- a/test/check_topology2d.c
+++ b/test/check_topology2d.c
@@ -1949,6 +1949,7 @@ do_level3_tests (sqlite3 * handle, int *retcode)
       }
 
 /* attempting to add an invalid Edge (closed ring) */
+    fprintf (stderr, "merdalla\n");
     ret =
 	sqlite3_exec (handle,
 		      "SELECT ST_AddIsoEdge('topo', 13, 13, GeomFromText('LINESTRING(178 170, 178 161, 170 161, 178 170)', 4326))",
@@ -1959,9 +1960,10 @@ do_level3_tests (sqlite3 * handle, int *retcode)
 	  *retcode = -128;
 	  return 0;
       }
+    fprintf (stderr, "merdalla 2\n");
     if (strcmp
 	(err_msg,
-	 "Closed edges would not be isolated, try lwt_AddEdgeNewFaces") != 0)
+	 "Closed edges would not be isolated, try rtt_AddEdgeNewFaces") != 0)
       {
 	  fprintf (stderr, "ST_AddIsoEdge() #10: unexpected \"%s\"\n", err_msg);
 	  sqlite3_free (err_msg);
@@ -1969,6 +1971,7 @@ do_level3_tests (sqlite3 * handle, int *retcode)
 	  return 0;
       }
     sqlite3_free (err_msg);
+    fprintf (stderr, "merdalla 3\n");
 
 /* adding an Edge/Face (closed ring) */
     ret =
@@ -2969,7 +2972,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -3066,7 +3069,7 @@ main (int argc, char *argv[])
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_topology3d.c b/test/check_topology3d.c
index e9114b2..9fb7379 100644
--- a/test/check_topology3d.c
+++ b/test/check_topology3d.c
@@ -1886,7 +1886,7 @@ do_level3_tests (sqlite3 * handle, int *retcode)
       }
     if (strcmp
 	(err_msg,
-	 "Closed edges would not be isolated, try lwt_AddEdgeNewFaces") != 0)
+	 "Closed edges would not be isolated, try rtt_AddEdgeNewFaces") != 0)
       {
 	  fprintf (stderr, "ST_AddIsoEdge() #10: unexpected \"%s\"\n", err_msg);
 	  sqlite3_free (err_msg);
@@ -2894,7 +2894,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -2991,7 +2991,7 @@ main (int argc, char *argv[])
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_topoplus.c b/test/check_topoplus.c
index 0029ffe..0c20d16 100644
--- a/test/check_topoplus.c
+++ b/test/check_topoplus.c
@@ -52,6 +52,620 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #include "spatialite.h"
 
 static int
+do_level9_tests (sqlite3 * handle, int *retcode)
+{
+/* performing basic tests: Level 9 */
+    int ret;
+    char *err_msg = NULL;
+    int i;
+    char **results;
+    int rows;
+    int columns;
+    int valid;
+
+/* updating TopoSeeds */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_UpdateSeeds('elba_clone')", NULL,
+		      NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_UpdateSeeds() #3 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -300;
+	  return 0;
+      }
+
+/* testing TopoGeo_SnapPointToSeed - ok */
+    if (sqlite3_get_table
+	(handle,
+	 "SELECT ST_AsText(TopoGeo_SnapPointToSeed(MakePoint(612452.7, 4730202.4, 32632), 'elba_clone', 1.0))",
+	 &results, &rows, &columns, &err_msg) != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_SnapPointToSeed() #1 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -301;
+	  return 0;
+      }
+    valid = 1;
+    for (i = 1; i <= rows; i++)
+      {
+	  const char *value = results[(i * columns)];
+	  if (strcmp (value, "POINT(612452.924936 4730202.975964)") != 0)
+	    {
+		fprintf (stderr, "TopoGeo_SnapPointToSeed() #2 error: %s\n",
+			 value);
+		valid = 0;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (!valid)
+      {
+	  *retcode = -302;
+	  return 0;
+      }
+
+/* testing TopoGeo_SnapPointToSeed - no Seed within distance */
+    if (sqlite3_get_table
+	(handle,
+	 "SELECT ST_AsText(TopoGeo_SnapPointToSeed(MakePoint(2.7, 4.9, 32632), 'elba_clone', 1.0))",
+	 &results, &rows, &columns, &err_msg) != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_SnapPointToSeed() #3 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -303;
+	  return 0;
+      }
+    valid = 1;
+    for (i = 1; i <= rows; i++)
+      {
+	  const char *value = results[(i * columns)];
+	  if (value != NULL)
+	    {
+		fprintf (stderr, "TopoGeo_SnapPointToSeed() #4 error: %s\n",
+			 value);
+		valid = 0;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (!valid)
+      {
+	  *retcode = -304;
+	  return 0;
+      }
+
+/* testing TopoGeo_SnapPointToSeed - invalid SRID */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT ST_AsText(TopoGeo_SnapPointToSeed(MakePoint(2.7, 4.9, 4326), 'elba_clone', 1.0))",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapPointToSeed() wrong SRID: expected failure\n");
+	  *retcode = -305;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid Point (mismatching SRID od dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapPointToSeed() wrong SRID: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -306;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* testing TopoGeo_SnapPointToSeed - invalid dims */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT ST_AsText(TopoGeo_SnapPointToSeed(MakePointZ(2.7, 4.9, 10, 32632), 'elba_clone', 1.0))",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapPointToSeed() wrong dims: expected failure\n");
+	  *retcode = -305;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid Point (mismatching SRID od dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapPointToSeed() wrong dims: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -306;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* testing TopoGeo_SnapLineToSeed - ok */
+    if (sqlite3_get_table
+	(handle,
+	 "SELECT ST_AsText(TopoGeo_SnapLineToSeed(ST_GeomFromText("
+	 "'LINESTRING(612385 4730247.99, 612389 4730247.95)', 32632), 'elba_clone', 1.0))",
+	 &results, &rows, &columns, &err_msg) != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_SnapLineToSeed() #1 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -309;
+	  return 0;
+      }
+    valid = 1;
+    for (i = 1; i <= rows; i++)
+      {
+	  const char *value = results[(i * columns)];
+	  if (strcmp
+	      (value,
+	       "LINESTRING(612385 4730247.99, 612387.425489 4730247.975612, 612389 4730247.95)")
+	      != 0)
+	    {
+		fprintf (stderr, "TopoGeo_SnapLineToSeed() #2 error: %s\n",
+			 value);
+		valid = 0;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (!valid)
+      {
+	  *retcode = -310;
+	  return 0;
+      }
+
+/* testing TopoGeo_SnapLineToSeed - no Seed within distance */
+    if (sqlite3_get_table
+	(handle,
+	 "SELECT ST_AsText(TopoGeo_SnapLineToSeed(ST_GeomFromText("
+	 "'LINESTRING(5 7.99, 9 7.95)', 32632), 'elba_clone', 1.0))", &results,
+	 &rows, &columns, &err_msg) != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_SnapLineToSeed() #3 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -311;
+	  return 0;
+      }
+    valid = 1;
+    for (i = 1; i <= rows; i++)
+      {
+	  const char *value = results[(i * columns)];
+	  if (value != NULL)
+	    {
+		fprintf (stderr, "TopoGeo_SnapLineToSeed() #4 error: %s\n",
+			 value);
+		valid = 0;
+	    }
+      }
+    sqlite3_free_table (results);
+    if (!valid)
+      {
+	  *retcode = -312;
+	  return 0;
+      }
+
+/* testing TopoGeo_SnapLineToSeed - invalid SRID */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT ST_AsText(TopoGeo_SnapLineToSeed(ST_GeomFromText("
+		      "'LINESTRING(5 7.99, 9 7.95)', 4325), 'elba_clone', 1.0))",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapLineToSeed() wrong SRID: expected failure\n");
+	  *retcode = -313;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid Line (mismatching SRID od dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapLineToSeed() wrong SRID: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -314;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* testing TopoGeo_SnapLineToSeed - invalid dims */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT ST_AsText(TopoGeo_SnapLineToSeed(ST_GeomFromText("
+		      "'LINESTRINGZ(5 7.99 1, 9 7.95 2)', 32632), 'elba_clone', 1.0))",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapLineToSeed() wrong dims: expected failure\n");
+	  *retcode = -315;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid Line (mismatching SRID od dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_SnapLineToSeed() wrong dims: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -316;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* testing RemoveSmallFaces */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_RemoveSmallFaces('elba_clone', 1000)",
+		      NULL, NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_RemoveSmallFaces() error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -317;
+	  return 0;
+      }
+
+/* testing RemoveDanglingEdges */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_RemoveDanglingEdges('elba_clone')",
+		      NULL, NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_RemoveDanglingEdges() error: %s\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -318;
+	  return 0;
+      }
+
+/* testing RemoveDanglingNodes */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_RemoveDanglingNodes('elba_clone')",
+		      NULL, NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_RemoveDanglingNodes() error: %s\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -319;
+	  return 0;
+      }
+
+    return 1;
+}
+
+
+static int
+do_level8_tests (sqlite3 * handle, int *retcode)
+{
+/* performing basic tests: Level 8 */
+    int ret;
+    char *err_msg = NULL;
+
+/* creating a Topology 2D */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT CreateTopology('diagnostic', 23032, 0, 0)", NULL,
+		      NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "CreateTopology() #8 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -300;
+	  return 0;
+      }
+
+/* attaching an external DB */
+    ret =
+	sqlite3_exec (handle,
+		      "ATTACH DATABASE \"./test_geos.sqlite\" AS inputDB", NULL,
+		      NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "ATTACH DATABASE error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -301;
+	  return 0;
+      }
+
+/* loading a Polygon GeoTable */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('diagnostic', 'inputDB', 'comuni', NULL, 0, 'dustbin', 'dustbinview', 650, -1)",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() no PK: expected failure\n");
+	  *retcode = -302;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - unable to create the dustbin table.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing Topology: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -302;
+	  return 0;
+      }
+
+/* detaching the external DB */
+    ret =
+	sqlite3_exec (handle, "DETACH DATABASE inputDB", NULL, NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "DETACH DATABASE error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  return -303;
+      }
+
+/* attempting to load a Topology - non-existing Topology */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('wannebe', NULL, 'elba_ln', NULL, 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing Topology: expected failure\n");
+	  *retcode = -304;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg, "SQL/MM Spatial exception - invalid topology name.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing Topology: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -305;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - non-existing GeoTable */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('diagnostic', NULL, 'wannabe', NULL, 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing GeoTable: expected failure\n");
+	  *retcode = -306;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg, "SQL/MM Spatial exception - invalid input GeoTable.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing GeoTable: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -307;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - wrong DB-prefix */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('diagnostic', 'lollypop', 'elba_ln', NULL, 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() wrong DB-prefix: expected failure\n");
+	  *retcode = -308;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg, "SQL/MM Spatial exception - invalid input GeoTable.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() wrong DB-prefix: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -309;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - wrong geometry column */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('diagnostic', NULL, 'elba_ln', 'none', 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing Geometry: expected failure\n");
+	  *retcode = -310;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg, "SQL/MM Spatial exception - invalid input GeoTable.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() non-existing Geometry: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -311;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - mismatching SRID */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('badelba1', NULL, 'elba_ln', 'geometry', 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() mismatching SRID: expected failure\n");
+	  *retcode = -312;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid GeoTable (mismatching SRID or dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() mismatching SRID: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -313;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - mismatching dims */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('badelba2', NULL, 'elba_ln', 'GEOMETRY', 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() mismatching dims: expected failure\n");
+	  *retcode = -314;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - invalid GeoTable (mismatching SRID or dimensions).")
+	!= 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() mismatching dims: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -315;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - ambiguous geometry column */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('diagnostic', NULL, 'elba_pg', NULL, 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() ambiguous Geometry: expected failure\n");
+	  *retcode = -316;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg, "SQL/MM Spatial exception - invalid input GeoTable.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() ambiguos Geometry: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -317;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* creating a Topology 2D */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT CreateTopology('ext', 32632, 0, 0)", NULL,
+		      NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "CreateTopology() #9 error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  return -316;
+      }
+
+/* attempting to load a Topology  */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('ext', NULL, 'export_elba1', NULL, 0, 'dustbin', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret != SQLITE_OK)
+      {
+	  fprintf (stderr, "TopoGeo_FromGeoTableExt() error: %s\n", err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -317;
+	  return 0;
+      }
+
+/* attempting to load a Topology - already existing dustbin-table */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('ext', NULL, 'export_elba1', NULL, 0, 'dustbin', 'dustbinview2')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() existing dustbin-table: expected failure\n");
+	  *retcode = -318;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - unable to create the dustbin table.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() existing dustbin-table: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -319;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+/* attempting to load a Topology - already existing dustbin-view */
+    ret =
+	sqlite3_exec (handle,
+		      "SELECT TopoGeo_FromGeoTableExt('ext', NULL, 'export_elba1', NULL, 0, 'dustbin2', 'dustbinview')",
+		      NULL, NULL, &err_msg);
+    if (ret == SQLITE_OK)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() existing dustbin-view: expected failure\n");
+	  *retcode = -320;
+	  return 0;
+      }
+    if (strcmp
+	(err_msg,
+	 "SQL/MM Spatial exception - unable to create the dustbin view.") != 0)
+      {
+	  fprintf (stderr,
+		   "TopoGeo_FromGeoTableExt() existing dustbin-view: unexpected \"%s\"\n",
+		   err_msg);
+	  sqlite3_free (err_msg);
+	  *retcode = -321;
+	  return 0;
+      }
+    sqlite3_free (err_msg);
+
+    return 1;
+}
+
+static int
 do_level7_tests (sqlite3 * handle, int *retcode)
 {
 /* performing basic tests: Level 7 */
@@ -3281,7 +3895,7 @@ main (int argc, char *argv[])
 {
     int retcode = 0;
 
-#ifdef POSTGIS_2_2		/* only if TOPOLOGY is enabled */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is enabled */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -3631,12 +4245,20 @@ main (int argc, char *argv[])
     if (!do_level7_tests (handle, &retcode))
 	goto end;
 
+/* basic tests: level 8 */
+    if (!do_level8_tests (handle, &retcode))
+	goto end;
+
+/* basic tests: level 9 */
+    if (!do_level9_tests (handle, &retcode))
+	goto end;
+
   end:
     spatialite_finalize_topologies (cache);
     sqlite3_close (handle);
     spatialite_cleanup_ex (cache);
 
-#endif /* end TOPOLOGY conditional */
+#endif /* end RTTOPO conditional */
 
     spatialite_shutdown ();
     return retcode;
diff --git a/test/check_virtualknn.c b/test/check_virtualknn.c
index 268c64f..759a6f3 100644
--- a/test/check_virtualknn.c
+++ b/test/check_virtualknn.c
@@ -362,7 +362,7 @@ test_knn (sqlite3 * sqlite, int mode)
       case 6:
 	  sql =
 	      "SELECT * FROM knn WHERE f_table_name = 'view_2' AND f_geometry_column = 'geom' "
-	      "AND ref_geometry = ST_Transform(MakePoint(?, ?, 32532), 4326)";
+	      "AND ref_geometry = ST_Transform(MakePoint(?, ?, 32632), 4326)";
 	  break;
       case 7:
 	  sql =
@@ -451,6 +451,8 @@ main (int argc, char *argv[])
 
     spatialite_init_ex (db_handle, cache, 0);
 
+#ifndef OMIT_KNN		/* only if KNN is enabled */
+
     ret =
 	sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
 		      &err_msg);
@@ -612,6 +614,8 @@ main (int argc, char *argv[])
 	  return -19;
       }
 
+#endif /* end KNN conditional */
+
     sqlite3_close (db_handle);
     spatialite_cleanup_ex (cache);
     spatialite_shutdown ();
diff --git a/test/geos-init.supp b/test/geos-init.supp
new file mode 100644
index 0000000..4cfb302
--- /dev/null
+++ b/test/geos-init.supp
@@ -0,0 +1,13 @@
+{
+   <geos_init_singleton>
+   Memcheck:Leak
+   fun:_Znwm
+   ...
+   fun:_ZN4geos4geom15GeometryFactory18getDefaultInstanceEv
+   fun:initGEOS_r
+   fun:initGEOS
+   fun:spatialite_init_ex
+   ...
+   fun:main
+}
+
diff --git a/test/gpkg_test.gpkg b/test/gpkg_test.gpkg
index d57f048..3d0e9a4 100644
Binary files a/test/gpkg_test.gpkg and b/test/gpkg_test.gpkg differ
diff --git a/test/shape_primitives.c b/test/shape_primitives.c
index 4d418d2..6a8eeae 100644
--- a/test/shape_primitives.c
+++ b/test/shape_primitives.c
@@ -873,7 +873,7 @@ int
 main (int argc, char *argv[])
 {
 #ifndef OMIT_ICONV		/* only if ICONV is supported */
-#ifdef ENABLE_LWGEOM		/* only if LWGEOM is supported */
+#ifdef ENABLE_RTTOPO		/* only if RTTOPO is supported */
     int ret;
     sqlite3 *handle;
     char *err_msg = NULL;
@@ -1089,7 +1089,7 @@ main (int argc, char *argv[])
 	  return -1;
       }
 
-#endif /* end LWGEOM conditionals */
+#endif /* end RTTOPO conditionals */
 #endif /* end ICONV conditional */
 
     spatialite_shutdown ();
diff --git a/test/shp/ReadMe.txt b/test/shp/ReadMe.txt
new file mode 100644
index 0000000..a9cab1b
--- /dev/null
+++ b/test/shp/ReadMe.txt
@@ -0,0 +1,11 @@
+Open Street Map (srid=4326, 2D)
+- new-caledonia (french: CP1252)
+- gaza (nice arabic and hebrew names: UTF-8)
+- taiwan (even nicer chinese names: UTF-8)
+
+Merano Local Council (Srid=25832, 3D, CP1252)
+
+Foggia (Srid=23032, 2D, CP1252: very complex polygons)
+
+
+
diff --git a/test/sql_stmt_cache_tests/Makefile b/test/sql_stmt_cache_tests/Makefile
new file mode 100644
index 0000000..a9b5bd6
--- /dev/null
+++ b/test/sql_stmt_cache_tests/Makefile
@@ -0,0 +1,460 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_cache_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_cache_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_cache_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_cache_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = amphibious1.testcase \
+	amphibious2.testcase \
+	precision1.testcase \
+	precision2.testcase \
+	precision3.testcase \
+	precision4.testcase \
+	precision5.testcase \
+	precision6.testcase \
+	precision7.testcase  \
+	gpkg1.testcase \
+	gpkg2.testcase 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_cache_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_cache_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_freexl_tests/Makefile b/test/sql_stmt_freexl_tests/Makefile
new file mode 100644
index 0000000..4b1c1dc
--- /dev/null
+++ b/test/sql_stmt_freexl_tests/Makefile
@@ -0,0 +1,456 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_freexl_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_freexl_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_freexl_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_freexl_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = loadxls1.testcase \
+	loadxls2.testcase \
+	loadxls3.testcase \
+	loadxls4.testcase \
+	loadxls5.testcase \
+	loadxls6.testcase \
+	loadxls7.testcase
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_freexl_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_freexl_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_geopackage_tests/Makefile.am b/test/sql_stmt_geopackage_tests/Makefile.am
index 201346d..296dd23 100644
--- a/test/sql_stmt_geopackage_tests/Makefile.am
+++ b/test/sql_stmt_geopackage_tests/Makefile.am
@@ -71,13 +71,4 @@ EXTRA_DIST = asgpb1.testcase \
 	makepointzm6.testcase \
 	makepointzm7.testcase \
 	makepointzm8.testcase \
-	makepointzm9.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase 
-	
+	makepointzm9.testcase	
diff --git a/test/sql_stmt_geopackage_tests/Makefile.in b/test/sql_stmt_geopackage_tests/Makefile.in
index 83ff3a4..9dbd571 100644
--- a/test/sql_stmt_geopackage_tests/Makefile.in
+++ b/test/sql_stmt_geopackage_tests/Makefile.in
@@ -323,15 +323,7 @@ EXTRA_DIST = asgpb1.testcase \
 	makepointzm6.testcase \
 	makepointzm7.testcase \
 	makepointzm8.testcase \
-	makepointzm9.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase \
-	transform_geopackage1.testcase 
+	makepointzm9.testcase	
 
 all: all-am
 
diff --git a/test/sql_stmt_geos_tests/geoserror8.testcase b/test/sql_stmt_geos_tests/geoserror8.testcase
new file mode 100644
index 0000000..3ea87e1
--- /dev/null
+++ b/test/sql_stmt_geos_tests/geoserror8.testcase
@@ -0,0 +1,11 @@
+GEOS_Error - topology exception 
+:memory: #use in-memory database
+SELECT ST_Difference(MakePoint(136,-35), GeomFromText('POLYGON((136 -35, 135.2 -34.5, 136 -35.2, 136 -35, 135.2 -34.5))')), GEOS_GetLastWarningMsg(), Length(GEOS_GetLastErrorMsg()) > 1 AS test;
+1 # rows (not including the header row)
+3 # columns
+ST_Difference(MakePoint(136,-35), GeomFromText('POLYGON((136 -35, 135.2 -34.5, 136 -35.2, 136 -35, 135.2 -34.5))'))
+GEOS_GetLastWarningMsg()
+test
+(NULL)
+(NULL)
+1
diff --git a/test/sql_stmt_geosadvanced_tests/Makefile b/test/sql_stmt_geosadvanced_tests/Makefile
new file mode 100644
index 0000000..9f3f947
--- /dev/null
+++ b/test/sql_stmt_geosadvanced_tests/Makefile
@@ -0,0 +1,487 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_geosadvanced_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_geosadvanced_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_geosadvanced_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_geosadvanced_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = concave_hull10.testcase \
+	concave_hull11.testcase \
+	concave_hull12.testcase \
+	concave_hull13.testcase \
+	concave_hull14.testcase \
+	concave_hull15.testcase \
+	concave_hull16.testcase \
+	concave_hull17.testcase \
+	concave_hull18.testcase \
+	concave_hull19.testcase \
+	concave_hull1.testcase \
+	concave_hull2.testcase \
+	concave_hull3.testcase \
+	concave_hull4.testcase \
+	concave_hull5.testcase \
+	concave_hull6.testcase \
+	concave_hull7.testcase \
+	concave_hull8.testcase \
+	concave_hull9.testcase \
+	delaunay10.testcase \
+	delaunay11.testcase \
+	delaunay12.testcase \
+	delaunay13.testcase \
+	delaunay14.testcase \
+	delaunay15.testcase \
+	delaunay16.testcase \
+	delaunay17.testcase \
+	delaunay18.testcase \
+	delaunay19.testcase \
+	delaunay1.testcase \
+	delaunay2.testcase \
+	delaunay3.testcase \
+	delaunay4.testcase \
+	delaunay5.testcase \
+	delaunay6.testcase \
+	delaunay7.testcase \
+	delaunay8.testcase \
+	delaunay9.testcase
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_geosadvanced_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_geosadvanced_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_gpkg_epsg_tests/Makefile.am b/test/sql_stmt_gpkg_epsg_tests/Makefile.am
new file mode 100644
index 0000000..6c301f7
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/Makefile.am
@@ -0,0 +1,10 @@
+
+EXTRA_DIST = transform_geopackage1.testcase \
+	transform_geopackage2.testcase \
+	transform_geopackage3.testcase \
+	transform_geopackage4.testcase \
+	transform_geopackage5.testcase \
+	transform_geopackage6.testcase \
+	transform_geopackage7.testcase \
+	transform_geopackage8.testcase 
+	
diff --git a/test/sql_stmt_gpkg_epsg_tests/Makefile.in b/test/sql_stmt_gpkg_epsg_tests/Makefile.in
new file mode 100644
index 0000000..f089e3c
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/Makefile.in
@@ -0,0 +1,457 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/sql_stmt_gpkg_epsg_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GEOSCONFIG = @GEOSCONFIG@
+GEOS_CFLAGS = @GEOS_CFLAGS@
+GEOS_LDFLAGS = @GEOS_LDFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = transform_geopackage1.testcase \
+	transform_geopackage2.testcase \
+	transform_geopackage3.testcase \
+	transform_geopackage4.testcase \
+	transform_geopackage5.testcase \
+	transform_geopackage6.testcase \
+	transform_geopackage7.testcase \
+	transform_geopackage8.testcase 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_gpkg_epsg_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_gpkg_epsg_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_geopackage_tests/transform_geopackage1.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage1.testcase
similarity index 100%
rename from test/sql_stmt_geopackage_tests/transform_geopackage1.testcase
rename to test/sql_stmt_gpkg_epsg_tests/transform_geopackage1.testcase
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage2.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage2.testcase
new file mode 100644
index 0000000..2caa7cd
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage2.testcase
@@ -0,0 +1,7 @@
+transform - Point
+gpkg_test_extrasrid.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 27700))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 27700))
+POINT(669088.702263 -761460.136215)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage3.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage3.testcase
new file mode 100644
index 0000000..8436b50
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage3.testcase
@@ -0,0 +1,7 @@
+transform - Unknown SRID
+gpkg_test_extrasrid.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 3))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 3))
+(NULL)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage4.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage4.testcase
new file mode 100644
index 0000000..513e749
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage4.testcase
@@ -0,0 +1,7 @@
+transform - Linestring Z
+gpkg_test.gpkg
+SELECT AsText(Transform(GeomFromText('LINESTRINGZ(11 43 100, 12 43 101, 12 42 102)', 4326), 32632))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('LINESTRINGZ(11 43 100, 12 43 101, 12 42 102)', 4326), 32632))
+LINESTRING Z(663019.070082 4762755.64169 100, 744533.019451 4765182.932802 101, 748464.920716 4654130.891324 102)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage5.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage5.testcase
new file mode 100644
index 0000000..dfb4cd4
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage5.testcase
@@ -0,0 +1,7 @@
+transform - Bogus SRID
+gpkg_test_extrasrid.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888888))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888888))
+(NULL)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage6.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage6.testcase
new file mode 100644
index 0000000..7372195
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage6.testcase
@@ -0,0 +1,7 @@
+transform - bad format organization_coordsys_id
+gpkg_test_extrasrid.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888889))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888889))
+(NULL)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage7.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage7.testcase
new file mode 100644
index 0000000..60df311
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage7.testcase
@@ -0,0 +1,7 @@
+transform - bad format organization_coordsys_id
+gpkg_test_extrasrid.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888887))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888887))
+(NULL)
diff --git a/test/sql_stmt_gpkg_epsg_tests/transform_geopackage8.testcase b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage8.testcase
new file mode 100644
index 0000000..de9ad26
--- /dev/null
+++ b/test/sql_stmt_gpkg_epsg_tests/transform_geopackage8.testcase
@@ -0,0 +1,7 @@
+transform - broken geopackage - no gpkg_spatial_ref_sys table
+gpkg_test_broken.gpkg
+SELECT AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888887))
+1 # rows (not including the header row)
+1 # columns
+AsText(Transform(GeomFromText('POINT(1.3 43)', 4326), 888887))
+(NULL)
diff --git a/test/sql_stmt_libxml2_tests/registerStllGroupStyle2.testcase b/test/sql_stmt_libxml2_tests/registerStllGroupStyle2.testcase
new file mode 100644
index 0000000..9d7eaf0
--- /dev/null
+++ b/test/sql_stmt_libxml2_tests/registerStllGroupStyle2.testcase
@@ -0,0 +1,7 @@
+RegisterStyledGroupStyle - Integer group name
+:memory: #use in-memory database
+SELECT SE_RegisterStyledGroupStyle(1, 1);
+1 # rows (not including the header row)
+1 # columns
+SE_RegisterStyledGroupStyle(1, 1)
+-1
diff --git a/test/sql_stmt_libxml2_tests/unregisterStllGroupStyle2.testcase b/test/sql_stmt_libxml2_tests/unregisterStllGroupStyle2.testcase
new file mode 100644
index 0000000..64122f8
--- /dev/null
+++ b/test/sql_stmt_libxml2_tests/unregisterStllGroupStyle2.testcase
@@ -0,0 +1,7 @@
+UnRegisterStyledGroupStyle - Integer group name
+:memory: #use in-memory database
+SELECT SE_UnRegisterStyledGroupStyle(1, 1);
+1 # rows (not including the header row)
+1 # columns
+SE_UnRegisterStyledGroupStyle(1, 1)
+-1
diff --git a/test/sql_stmt_lwgeom_20_tests/st_asx3d25.testcase b/test/sql_stmt_lwgeom_20_tests/st_asx3d25.testcase
index e449650..73e524f 100644
--- a/test/sql_stmt_lwgeom_20_tests/st_asx3d25.testcase
+++ b/test/sql_stmt_lwgeom_20_tests/st_asx3d25.testcase
@@ -4,4 +4,5 @@ SELECT ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.987
 1 # rows (not including the header row)
 1 # columns
 ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.98765432 101.123, 11 10 102, 11.321 11.12 103.6453128), POINTZ(15.1234567 14.7654321 7.654321))', 4326), 6, 0)
-<MultiGeometry srsName="epsg:4326"><geometryMember>15.123457 14.765432 7.654321</geometryMember><geometryMember><LineSet  vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></geometryMember></MultiGeometry>:0
+<Shape>15.123457 14.765432 7.654321<Shape><LineSet  vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet>
+# <MultiGeometry srsName="epsg:4326"><geometryMember>15.123457 14.765432 7.654321</geometryMember><geometryMember><LineSet  vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></geometryMember></MultiGeometry>:0
diff --git a/test/sql_stmt_lwgeom_20_tests/st_asx3d26.testcase b/test/sql_stmt_lwgeom_20_tests/st_asx3d26.testcase
index 9195e9e..e09558d 100644
--- a/test/sql_stmt_lwgeom_20_tests/st_asx3d26.testcase
+++ b/test/sql_stmt_lwgeom_20_tests/st_asx3d26.testcase
@@ -4,4 +4,5 @@ SELECT ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.987
 1 # rows (not including the header row)
 1 # columns
 ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.98765432 101.123, 11 10 102, 11.321 11.12 103.6453128), POINTZ(15.1234567 14.7654321 7.654321))', 4326), 6, 1)
-<MultiGeometry srsName="urn:ogc:def:crs:epsg::4326"><geometryMember>15.123457 14.765432 7.654321</geometryMember><geometryMember><LineSet  vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></geometryMember></MultiGeometry>:0
+<Shape>14.765432 15.123457 7.654321<Shape><LineSet  vertexCount='3'><Coordinate point='10.987654 10.123457 101.123 10 11 102 11.12 11.321 103.645313' /></LineSet>
+# <MultiGeometry srsName="urn:ogc:def:crs:epsg::4326"><geometryMember>15.123457 14.765432 7.654321</geometryMember><geometryMember><LineSet  vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></geometryMember></MultiGeometry>:0
diff --git a/test/sql_stmt_lwgeom_20_tests/st_asx3d30.testcase b/test/sql_stmt_lwgeom_20_tests/st_asx3d30.testcase
index 5635b22..5cb5225 100644
--- a/test/sql_stmt_lwgeom_20_tests/st_asx3d30.testcase
+++ b/test/sql_stmt_lwgeom_20_tests/st_asx3d30.testcase
@@ -4,4 +4,5 @@ SELECT ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.987
 1 # rows (not including the header row)
 1 # columns
 ST_AsX3D(GeomFromText('GEOMETRYCOLLECTIONZ(LINESTRINGZ(10.12345678 10.98765432 101.123, 11 10 102, 11.321 11.12 103.6453128), POINTZ(15.1234567 14.7654321 7.654321))', 4326), 6, 1, 'test_')
-<test_MultiGeometry srsName="urn:ogc:def:crs:epsg::4326"><test_geometryMember>15.123457 14.765432 7.654321</test_geometryMember><test_geometryMember><LineSet test_ vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></test_geometryMember></test_MultiGeometry>:0
+<Shapetest_>14.765432 15.123457 7.654321<Shapetest_><LineSet test_ vertexCount='3'><Coordinate point='10.987654 10.123457 101.123 10 11 102 11.12 11.321 103.645313' /></LineSet>
+# <test_MultiGeometry srsName="urn:ogc:def:crs:epsg::4326"><test_geometryMember>15.123457 14.765432 7.654321</test_geometryMember><test_geometryMember><LineSet test_ vertexCount='3'><Coordinate point='10.123457 10.987654 101.123 11 10 102 11.321 11.12 103.645313' /></LineSet></test_geometryMember></test_MultiGeometry>:0
diff --git a/test/sql_stmt_lwgeom_22_tests/Makefile.am b/test/sql_stmt_lwgeom_22_tests/Makefile.am
index 02711c8..f49eb07 100644
--- a/test/sql_stmt_lwgeom_22_tests/Makefile.am
+++ b/test/sql_stmt_lwgeom_22_tests/Makefile.am
@@ -423,6 +423,23 @@ EXTRA_DIST = addedgemodface1.testcase \
 	inittopolayer15.testcase \
 	inittopolayer16.testcase \
 	inittopolayer17.testcase \
+	linesnapseed1.testcase \
+	linesnapseed2.testcase \
+	linesnapseed3.testcase \
+	linesnapseed4.testcase \
+	linesnapseed5.testcase \
+	linesnapseed6.testcase \
+	linesnapseed7.testcase \
+	linesnapseed8.testcase \
+	linesnapseed9.testcase \
+	linesnapseed10.testcase \
+	linesnapseed11.testcase \
+	linesnapseed12.testcase \
+	linesnapseed13.testcase \
+	linesnapseed14.testcase \
+	linesnapseed15.testcase \
+	linesnapseed16.testcase \
+	linesnapseed17.testcase \
 	loginetfromtgeo1.testcase \
 	loginetfromtgeo2.testcase \
 	loginetfromtgeo3.testcase \
@@ -580,6 +597,23 @@ EXTRA_DIST = addedgemodface1.testcase \
 	newloglinksplit7.testcase \
 	newloglinksplit8.testcase \
 	newloglinksplit9.testcase \
+	pointsnapseed1.testcase \
+	pointsnapseed2.testcase \
+	pointsnapseed3.testcase \
+	pointsnapseed4.testcase \
+	pointsnapseed5.testcase \
+	pointsnapseed6.testcase \
+	pointsnapseed7.testcase \
+	pointsnapseed8.testcase \
+	pointsnapseed9.testcase \
+	pointsnapseed10.testcase \
+	pointsnapseed11.testcase \
+	pointsnapseed12.testcase \
+	pointsnapseed13.testcase \
+	pointsnapseed14.testcase \
+	pointsnapseed15.testcase \
+	pointsnapseed16.testcase \
+	pointsnapseed17.testcase \
 	remedgemodface1.testcase \
 	remedgemodface2.testcase \
 	remedgemodface3.testcase \
@@ -662,10 +696,6 @@ EXTRA_DIST = addedgemodface1.testcase \
 	spatnetfromgeom8.testcase \
 	spatnetfromgeom9.testcase \
 	spatnetfromgeom10.testcase \
-	st_asx3d25.testcase \
-	st_asx3d26.testcase \
-	st_asx3d30.testcase \
-	st_split8.testcase \
 	topoexception1.testcase \
 	topoexception2.testcase \
 	topogeoaddpoint1.testcase \
@@ -714,6 +744,45 @@ EXTRA_DIST = addedgemodface1.testcase \
 	topogeoclone10.testcase \
 	topogeoclone11.testcase \
 	topogeoclone12.testcase \
+	topogeofromext1.testcase \
+	topogeofromext2.testcase \
+	topogeofromext3.testcase \
+	topogeofromext4.testcase \
+	topogeofromext5.testcase \
+	topogeofromext6.testcase \
+	topogeofromext7.testcase \
+	topogeofromext8.testcase \
+	topogeofromext9.testcase \
+	topogeofromext10.testcase \
+	topogeofromext11.testcase \
+	topogeofromext12.testcase \
+	topogeofromext13.testcase \
+	topogeofromext14.testcase \
+	topogeofromext15.testcase \
+	topogeofromext16.testcase \
+	topogeofromext17.testcase \
+	topogeofromext18.testcase \
+	topogeofromext19.testcase \
+	topogeofromext20.testcase \
+	topogeofromext21.testcase \
+	topogeofromext22.testcase \
+	topogeofromext23.testcase \
+	topogeofromext24.testcase \
+	topogeofromext25.testcase \
+	topogeofromext26.testcase \
+	topogeofromext27.testcase \
+	topogeofromext28.testcase \
+	topogeofromext29.testcase \
+	topogeofromext30.testcase \
+	topogeofromext31.testcase \
+	topogeofromext32.testcase \
+	topogeofromext33.testcase \
+	topogeofromext34.testcase \
+	topogeofromext35.testcase \
+	topogeofromext36.testcase \
+	topogeofromext37.testcase \
+	topogeofromext38.testcase \
+	topogeofromext39.testcase \
 	topogeofromtable1.testcase \
 	topogeofromtable2.testcase \
 	topogeofromtable3.testcase \
@@ -760,6 +829,25 @@ EXTRA_DIST = addedgemodface1.testcase \
 	topogeosplitline14.testcase \
 	topogeosplitline15.testcase \
 	topogeosplitline16.testcase \
+	topogeoremovesmall1.testcase \
+	topogeoremovesmall2.testcase \
+	topogeoremovesmall3.testcase \
+	topogeoremovesmall4.testcase \
+	topogeoremovesmall5.testcase \
+	topogeoremovesmall6.testcase \
+	topogeoremovesmall7.testcase \
+	topogeoremovesmall8.testcase \
+	topogeoremovesmall9.testcase \
+	topogeoremoveedges1.testcase \
+	topogeoremoveedges2.testcase \
+	topogeoremoveedges3.testcase \
+	topogeoremoveedges4.testcase \
+	topogeoremoveedges5.testcase \
+	topogeoremovenodes1.testcase \
+	topogeoremovenodes2.testcase \
+	topogeoremovenodes3.testcase \
+	topogeoremovenodes4.testcase \
+	topogeoremovenodes5.testcase \
 	topogeototable1.testcase \
 	topogeototable2.testcase \
 	topogeototable3.testcase \
diff --git a/test/sql_stmt_lwgeom_22_tests/Makefile.in b/test/sql_stmt_lwgeom_22_tests/Makefile.in
index e51260c..797ccf5 100644
--- a/test/sql_stmt_lwgeom_22_tests/Makefile.in
+++ b/test/sql_stmt_lwgeom_22_tests/Makefile.in
@@ -87,7 +87,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = test/sql_stmt_lwgeom_22_tests
+subdir = test/sql_stmt_rttopo_tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -675,6 +675,23 @@ EXTRA_DIST = addedgemodface1.testcase \
 	inittopolayer15.testcase \
 	inittopolayer16.testcase \
 	inittopolayer17.testcase \
+	linesnapseed1.testcase \
+	linesnapseed2.testcase \
+	linesnapseed3.testcase \
+	linesnapseed4.testcase \
+	linesnapseed5.testcase \
+	linesnapseed6.testcase \
+	linesnapseed7.testcase \
+	linesnapseed8.testcase \
+	linesnapseed9.testcase \
+	linesnapseed10.testcase \
+	linesnapseed11.testcase \
+	linesnapseed12.testcase \
+	linesnapseed13.testcase \
+	linesnapseed14.testcase \
+	linesnapseed15.testcase \
+	linesnapseed16.testcase \
+	linesnapseed17.testcase \
 	loginetfromtgeo1.testcase \
 	loginetfromtgeo2.testcase \
 	loginetfromtgeo3.testcase \
@@ -832,6 +849,23 @@ EXTRA_DIST = addedgemodface1.testcase \
 	newloglinksplit7.testcase \
 	newloglinksplit8.testcase \
 	newloglinksplit9.testcase \
+	pointsnapseed1.testcase \
+	pointsnapseed2.testcase \
+	pointsnapseed3.testcase \
+	pointsnapseed4.testcase \
+	pointsnapseed5.testcase \
+	pointsnapseed6.testcase \
+	pointsnapseed7.testcase \
+	pointsnapseed8.testcase \
+	pointsnapseed9.testcase \
+	pointsnapseed10.testcase \
+	pointsnapseed11.testcase \
+	pointsnapseed12.testcase \
+	pointsnapseed13.testcase \
+	pointsnapseed14.testcase \
+	pointsnapseed15.testcase \
+	pointsnapseed16.testcase \
+	pointsnapseed17.testcase \
 	remedgemodface1.testcase \
 	remedgemodface2.testcase \
 	remedgemodface3.testcase \
@@ -914,10 +948,6 @@ EXTRA_DIST = addedgemodface1.testcase \
 	spatnetfromgeom8.testcase \
 	spatnetfromgeom9.testcase \
 	spatnetfromgeom10.testcase \
-	st_asx3d25.testcase \
-	st_asx3d26.testcase \
-	st_asx3d30.testcase \
-	st_split8.testcase \
 	topoexception1.testcase \
 	topoexception2.testcase \
 	topogeoaddpoint1.testcase \
@@ -966,6 +996,45 @@ EXTRA_DIST = addedgemodface1.testcase \
 	topogeoclone10.testcase \
 	topogeoclone11.testcase \
 	topogeoclone12.testcase \
+	topogeofromext1.testcase \
+	topogeofromext2.testcase \
+	topogeofromext3.testcase \
+	topogeofromext4.testcase \
+	topogeofromext5.testcase \
+	topogeofromext6.testcase \
+	topogeofromext7.testcase \
+	topogeofromext8.testcase \
+	topogeofromext9.testcase \
+	topogeofromext10.testcase \
+	topogeofromext11.testcase \
+	topogeofromext12.testcase \
+	topogeofromext13.testcase \
+	topogeofromext14.testcase \
+	topogeofromext15.testcase \
+	topogeofromext16.testcase \
+	topogeofromext17.testcase \
+	topogeofromext18.testcase \
+	topogeofromext19.testcase \
+	topogeofromext20.testcase \
+	topogeofromext21.testcase \
+	topogeofromext22.testcase \
+	topogeofromext23.testcase \
+	topogeofromext24.testcase \
+	topogeofromext25.testcase \
+	topogeofromext26.testcase \
+	topogeofromext27.testcase \
+	topogeofromext28.testcase \
+	topogeofromext29.testcase \
+	topogeofromext30.testcase \
+	topogeofromext31.testcase \
+	topogeofromext32.testcase \
+	topogeofromext33.testcase \
+	topogeofromext34.testcase \
+	topogeofromext35.testcase \
+	topogeofromext36.testcase \
+	topogeofromext37.testcase \
+	topogeofromext38.testcase \
+	topogeofromext39.testcase \
 	topogeofromtable1.testcase \
 	topogeofromtable2.testcase \
 	topogeofromtable3.testcase \
@@ -1012,6 +1081,25 @@ EXTRA_DIST = addedgemodface1.testcase \
 	topogeosplitline14.testcase \
 	topogeosplitline15.testcase \
 	topogeosplitline16.testcase \
+	topogeoremovesmall1.testcase \
+	topogeoremovesmall2.testcase \
+	topogeoremovesmall3.testcase \
+	topogeoremovesmall4.testcase \
+	topogeoremovesmall5.testcase \
+	topogeoremovesmall6.testcase \
+	topogeoremovesmall7.testcase \
+	topogeoremovesmall8.testcase \
+	topogeoremovesmall9.testcase \
+	topogeoremoveedges1.testcase \
+	topogeoremoveedges2.testcase \
+	topogeoremoveedges3.testcase \
+	topogeoremoveedges4.testcase \
+	topogeoremoveedges5.testcase \
+	topogeoremovenodes1.testcase \
+	topogeoremovenodes2.testcase \
+	topogeoremovenodes3.testcase \
+	topogeoremovenodes4.testcase \
+	topogeoremovenodes5.testcase \
 	topogeototable1.testcase \
 	topogeototable2.testcase \
 	topogeototable3.testcase \
@@ -1193,9 +1281,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_lwgeom_22_tests/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_rttopo_tests/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign test/sql_stmt_lwgeom_22_tests/Makefile
+	  $(AUTOMAKE) --foreign test/sql_stmt_rttopo_tests/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed1.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed1.testcase
new file mode 100644
index 0000000..551fa38
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed10.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed10.testcase
new file mode 100644
index 0000000..4bcb69f
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed11.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed11.testcase
new file mode 100644
index 0000000..7132e95
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - TEXT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 'dist');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 'dist')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed12.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed12.testcase
new file mode 100644
index 0000000..083766c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - BLOB distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', zeroblob(5));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', zeroblob(5))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed13.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed13.testcase
new file mode 100644
index 0000000..6e22eea
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed14.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed14.testcase
new file mode 100644
index 0000000..b422891
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed15.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed15.testcase
new file mode 100644
index 0000000..ba269c2
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - point instead of line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('POINT(1 1)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('POINT((1 1)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed16.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed16.testcase
new file mode 100644
index 0000000..8fe522d
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - multilinestring instead of linestring
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('MULTILINESTRING((1 1, 1 2), (2 2, 3 3))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('MULTILINESTRING((1 1, 1 2), (2 2, 3 3))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed17.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed17.testcase
new file mode 100644
index 0000000..d725c00
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - polygon instead of line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed2.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed2.testcase
new file mode 100644
index 0000000..014a974
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed3.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed3.testcase
new file mode 100644
index 0000000..cf22970
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1.1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1.1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed4.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed4.testcase
new file mode 100644
index 0000000..b56b301
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed5.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed5.testcase
new file mode 100644
index 0000000..4a4a5fc
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(NULL, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(NULL, 'topo', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed6.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed6.testcase
new file mode 100644
index 0000000..90d8cb1
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed7.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed7.testcase
new file mode 100644
index 0000000..4dc6eee
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(1.1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(1.1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed8.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed8.testcase
new file mode 100644
index 0000000..03115fd
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - TEXT line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed('line', 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed('line', 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/linesnapseed9.testcase b/test/sql_stmt_lwgeom_22_tests/linesnapseed9.testcase
new file mode 100644
index 0000000..40de20c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/linesnapseed9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - invalid BLOB line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(zeroblob(100), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(zeroblob(100), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed1.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed1.testcase
new file mode 100644
index 0000000..507a209
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed10.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed10.testcase
new file mode 100644
index 0000000..eba2400
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed11.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed11.testcase
new file mode 100644
index 0000000..bd87270
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - TEXT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 'dist');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 'dist')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed12.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed12.testcase
new file mode 100644
index 0000000..1539d13
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - BLOB distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', zeroblob(5));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', zeroblob(5))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed13.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed13.testcase
new file mode 100644
index 0000000..bca060d
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed14.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed14.testcase
new file mode 100644
index 0000000..74c3ac9
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed15.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed15.testcase
new file mode 100644
index 0000000..23cf1e8
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - linestring instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('LINESTRING(1 1, 2 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('LINESTRING(1 1, 2 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed16.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed16.testcase
new file mode 100644
index 0000000..c9fb959
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - multipoint instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('MULTIPOINT(1 1, 1 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('MULTIPOINT(1 1, 1 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed17.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed17.testcase
new file mode 100644
index 0000000..c0d376c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - polygon instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed2.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed2.testcase
new file mode 100644
index 0000000..00f04c9
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed3.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed3.testcase
new file mode 100644
index 0000000..c3d9f74
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1.1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1.1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed4.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed4.testcase
new file mode 100644
index 0000000..f410c7f
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed5.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed5.testcase
new file mode 100644
index 0000000..cd8e949
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(NULL, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(NULL, 'topo', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed6.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed6.testcase
new file mode 100644
index 0000000..ea3a364
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed7.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed7.testcase
new file mode 100644
index 0000000..5c68795
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(1.1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(1.1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed8.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed8.testcase
new file mode 100644
index 0000000..8f55f9c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - TEXT point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed('point', 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed('point', 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/pointsnapseed9.testcase b/test/sql_stmt_lwgeom_22_tests/pointsnapseed9.testcase
new file mode 100644
index 0000000..d2dafc1
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/pointsnapseed9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - invalid BLOB point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(zeroblob(100), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(zeroblob(100), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext1.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext1.testcase
new file mode 100644
index 0000000..04d3919
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(NULL, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(NULL, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext10.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext10.testcase
new file mode 100644
index 0000000..14805d9
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, NULL, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, NULL, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext11.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext11.testcase
new file mode 100644
index 0000000..508cdd2
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 1, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 1, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext12.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext12.testcase
new file mode 100644
index 0000000..c036c67
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 1.2, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 1.2, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext13.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext13.testcase
new file mode 100644
index 0000000..d71c6f3
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, zeroblob(4), NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, zeroblob(4), NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext14.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext14.testcase
new file mode 100644
index 0000000..f95af26
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 'column', 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 'column', 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext15.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext15.testcase
new file mode 100644
index 0000000..06dd6c9
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext16.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext16.testcase
new file mode 100644
index 0000000..a16c09b
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1.2, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1.2, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext17.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext17.testcase
new file mode 100644
index 0000000..79f383a
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', zeroblob(4), 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', zeroblob(4), 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext18.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext18.testcase
new file mode 100644
index 0000000..0283e4b
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, NULL, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, NULL, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext19.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext19.testcase
new file mode 100644
index 0000000..bcc8d1a
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 'zero', 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 'zero', 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext2.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext2.testcase
new file mode 100644
index 0000000..939e2e5
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(1, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(1, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext20.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext20.testcase
new file mode 100644
index 0000000..830c9cf
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, zeroblob(4), 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, zeroblob(4), 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext21.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext21.testcase
new file mode 100644
index 0000000..82e6984
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext22.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext22.testcase
new file mode 100644
index 0000000..a85143d
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext23.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext23.testcase
new file mode 100644
index 0000000..4acb649
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext24.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext24.testcase
new file mode 100644
index 0000000..701166c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 'abc', -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 'abc', -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext25.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext25.testcase
new file mode 100644
index 0000000..3c9841c
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext26.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext26.testcase
new file mode 100644
index 0000000..4d36cf3
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Integer line-max-points / Integer max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext27.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext27.testcase
new file mode 100644
index 0000000..c7c668b
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext27.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext28.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext28.testcase
new file mode 100644
index 0000000..a5b3005
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext28.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext29.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext29.testcase
new file mode 100644
index 0000000..d82f47d
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext29.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 'abc');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 'abc')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext3.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext3.testcase
new file mode 100644
index 0000000..57fde09
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(1.5, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(1.5, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext30.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext30.testcase
new file mode 100644
index 0000000..539ffb4
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext30.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 5000.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 5000.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext31.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext31.testcase
new file mode 100644
index 0000000..2bd77a9
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext31.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext32.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext32.testcase
new file mode 100644
index 0000000..ab999bd
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext32.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext33.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext33.testcase
new file mode 100644
index 0000000..44faf67
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext33.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext34.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext34.testcase
new file mode 100644
index 0000000..44faf67
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext34.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext35.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext35.testcase
new file mode 100644
index 0000000..df9b7e5
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext35.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, zeroblob(5), 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, zeroblob(5), 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext36.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext36.testcase
new file mode 100644
index 0000000..13cff06
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext36.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbin')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext37.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext37.testcase
new file mode 100644
index 0000000..41b5cb8
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext37.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbin')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext38.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext38.testcase
new file mode 100644
index 0000000..9fe19b4
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext38.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbin')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext39.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext39.testcase
new file mode 100644
index 0000000..444f207
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext39.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext4.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext4.testcase
new file mode 100644
index 0000000..6b7e4ec
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(zeroblob(4), NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(zeroblob(4), NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext5.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext5.testcase
new file mode 100644
index 0000000..296e6bc
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext6.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext6.testcase
new file mode 100644
index 0000000..c6ec216
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 'a', 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 'a', 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext7.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext7.testcase
new file mode 100644
index 0000000..05633fa
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 1, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 1, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext8.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext8.testcase
new file mode 100644
index 0000000..f31fb11
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 1.2, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 1.2, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromext9.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromext9.testcase
new file mode 100644
index 0000000..00003f1
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromext9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', zeroblob(4), 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', zeroblob(4), 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeofromtable10.testcase b/test/sql_stmt_lwgeom_22_tests/topogeofromtable10.testcase
index d7fe4a8..1017f3f 100644
--- a/test/sql_stmt_lwgeom_22_tests/topogeofromtable10.testcase
+++ b/test/sql_stmt_lwgeom_22_tests/topogeofromtable10.testcase
@@ -4,4 +4,4 @@ SELECT TopoGeo_FromGeoTable('topology', NULL, NULL, NULL, 0);
 1 # rows (not including the header row)
 1 # columns
 TopoGeo_FromGeoTable('topology', NULL, NULL, NULL, 0)
-SQL/MM Spatial exception - invalid argument.
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges1.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges1.testcase
new file mode 100644
index 0000000..fdf8ff2
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges (NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges (NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges2.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges2.testcase
new file mode 100644
index 0000000..8a93453
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges3.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges3.testcase
new file mode 100644
index 0000000..70abd5b
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges4.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges4.testcase
new file mode 100644
index 0000000..a23acfe
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges5.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges5.testcase
new file mode 100644
index 0000000..04c8421
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremoveedges5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges('topology');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes1.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes1.testcase
new file mode 100644
index 0000000..82d7324
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes (NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes (NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes2.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes2.testcase
new file mode 100644
index 0000000..4df1972
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes3.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes3.testcase
new file mode 100644
index 0000000..91e3269
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes4.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes4.testcase
new file mode 100644
index 0000000..5c05d7e
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes5.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes5.testcase
new file mode 100644
index 0000000..025d426
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovenodes5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes('topology');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall1.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall1.testcase
new file mode 100644
index 0000000..be44fa1
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces (NULL, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces (NULL, 0.1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall2.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall2.testcase
new file mode 100644
index 0000000..bb53191
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(1, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(1, NULL, 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall3.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall3.testcase
new file mode 100644
index 0000000..32fc4a3
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(1.5, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(1.5, 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall4.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall4.testcase
new file mode 100644
index 0000000..6491ed4
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(zeroblob(4), 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(zeroblob(4), 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall5.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall5.testcase
new file mode 100644
index 0000000..2888d1d
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 0.1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall6.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall6.testcase
new file mode 100644
index 0000000..a0cc081
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - TEXT min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 'a');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 'a')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall7.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall7.testcase
new file mode 100644
index 0000000..1f7b146
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - INT min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall8.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall8.testcase
new file mode 100644
index 0000000..d3da8a6
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - NULL min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall9.testcase b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall9.testcase
new file mode 100644
index 0000000..faad353
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topogeoremovesmall9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/topomettotable25.testcase b/test/sql_stmt_lwgeom_22_tests/topomettotable25.testcase
new file mode 100644
index 0000000..7c08529
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/topomettotable25.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - NULL with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds1.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds1.testcase
new file mode 100644
index 0000000..1afb288
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds1.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - NULL Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds10.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds10.testcase
new file mode 100644
index 0000000..ea72c22
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds10.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Text mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 'mode');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 'mode')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds2.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds2.testcase
new file mode 100644
index 0000000..e4f4ae1
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds2.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Int Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds3.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds3.testcase
new file mode 100644
index 0000000..913c437
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds3.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Double Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds4.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds4.testcase
new file mode 100644
index 0000000..d58f2f4
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds4.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Blob Network 
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds5.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds5.testcase
new file mode 100644
index 0000000..866d9c7
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds5.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Text Network 
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds6.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds6.testcase
new file mode 100644
index 0000000..0fa98fb
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds6.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - NULL mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds7.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds7.testcase
new file mode 100644
index 0000000..8f06aad
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds7.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Int mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds8.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds8.testcase
new file mode 100644
index 0000000..d2fdc3a
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds8.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Double mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds9.testcase b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds9.testcase
new file mode 100644
index 0000000..856e2ea
--- /dev/null
+++ b/test/sql_stmt_lwgeom_22_tests/toponetupdateseeds9.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Blob mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_lwgeom_tests/Makefile.am b/test/sql_stmt_lwgeom_tests/Makefile.am
deleted file mode 100644
index 2f63e2f..0000000
--- a/test/sql_stmt_lwgeom_tests/Makefile.am
+++ /dev/null
@@ -1,294 +0,0 @@
-
-EXTRA_DIST = 3ddistance10.testcase \
-	3ddistance1.testcase \
-	3ddistance2.testcase \
-	3ddistance3.testcase \
-	3ddistance4.testcase \
-	3ddistance5.testcase \
-	3ddistance6.testcase \
-	3ddistance7.testcase \
-	3ddistance8.testcase \
-	3ddistance9.testcase \
-	3dlength1.testcase \
-	3dlength2.testcase \
-	3dlength3.testcase \
-	3dlength4.testcase \
-	3dlength5.testcase \
-	3dlength6.testcase \
-	3dlength7.testcase \
-	3dlength8.testcase \
-	3dmaxdistance10.testcase \
-	3dmaxdistance1.testcase \
-	3dmaxdistance2.testcase \
-	3dmaxdistance3.testcase \
-	3dmaxdistance4.testcase \
-	3dmaxdistance5.testcase \
-	3dmaxdistance6.testcase \
-	3dmaxdistance7.testcase \
-	3dmaxdistance8.testcase \
-	3dmaxdistance9.testcase \
-	maxdistance10.testcase \
-	maxdistance1.testcase \
-	maxdistance2.testcase \
-	maxdistance3.testcase \
-	maxdistance4.testcase \
-	maxdistance5.testcase \
-	maxdistance6.testcase \
-	maxdistance7.testcase \
-	maxdistance8.testcase \
-	maxdistance9.testcase \
-	st_asx3d10.testcase \
-	st_asx3d11.testcase \
-	st_asx3d12.testcase \
-	st_asx3d13.testcase \
-	st_asx3d14.testcase \
-	st_asx3d15.testcase \
-	st_asx3d16.testcase \
-	st_asx3d17.testcase \
-	st_asx3d18.testcase \
-	st_asx3d19.testcase \
-	st_asx3d1.testcase \
-	st_asx3d20.testcase \
-	st_asx3d21.testcase \
-	st_asx3d22.testcase \
-	st_asx3d23.testcase \
-	st_asx3d24.testcase \
-	st_asx3d27.testcase \
-	st_asx3d28.testcase \
-	st_asx3d29.testcase \
-	st_asx3d2.testcase \
-	st_asx3d3.testcase \
-	st_asx3d4.testcase \
-	st_asx3d5.testcase \
-	st_asx3d6.testcase \
-	st_asx3d7.testcase \
-	st_asx3d8.testcase \
-	st_asx3d9.testcase \
-	st_area10.testcase \
-	st_area11.testcase \
-	st_area12.testcase \
-	st_area13.testcase \
-	st_area14.testcase \
-	st_area15.testcase \
-	st_area16.testcase \
-	st_area17.testcase \
-	st_area18.testcase \
-	st_azimuth11.testcase \
-	st_azimuth12.testcase \
-	st_azimuth13.testcase \
-	st_azimuth14.testcase \
-	st_azimuth15.testcase \
-	st_azimuth16.testcase \
-	st_azimuth17.testcase \
-	st_azimuth1.testcase \
-	st_azimuth2.testcase \
-	st_azimuth3.testcase \
-	st_azimuth4.testcase \
-	st_azimuth5.testcase \
-	st_azimuth6.testcase \
-	st_azimuth7.testcase \
-	st_azimuth8.testcase \
-	st_azimuth9.testcase \
-	st_geohash10.testcase \
-	st_geohash1.testcase \
-	st_geohash2.testcase \
-	st_geohash3.testcase \
-	st_geohash4.testcase \
-	st_geohash5.testcase \
-	st_geohash6.testcase \
-	st_geohash7.testcase \
-	st_geohash8.testcase \
-	st_geohash9.testcase \
-	st_makevalid1.testcase \
-	st_makevalid2.testcase \
-	st_makevalid3.testcase \
-	st_makevalid4.testcase \
-	st_makevalid5.testcase \
-	st_makevalid6.testcase \
-	st_makevalid7.testcase \
-	st_makevalid8.testcase \
-	st_makevaliddiscarded1.testcase \
-	st_makevaliddiscarded2.testcase \
-	st_makevaliddiscarded3.testcase \
-	st_makevaliddiscarded4.testcase \
-	st_makevaliddiscarded5.testcase \
-	st_makevaliddiscarded6.testcase \
-	st_makevaliddiscarded7.testcase \
-	st_makevaliddiscarded8.testcase \
-	st_project1.testcase \
-	st_project2.testcase \
-	st_project3.testcase \
-	st_project4.testcase \
-	st_project5.testcase \
-	st_project6.testcase \
-	st_project7.testcase \
-	st_project8.testcase \
-	st_project9.testcase \
-	st_project10.testcase \
-	st_project11.testcase \
-	st_project12.testcase \
-	st_project13.testcase \
-	st_project14.testcase \
-	st_segmentize10.testcase \
-	st_segmentize11.testcase \
-	st_segmentize12.testcase \
-	st_segmentize13.testcase \
-	st_segmentize14.testcase \
-	st_segmentize15.testcase \
-	st_segmentize16.testcase \
-	st_segmentize17.testcase \
-	st_segmentize18.testcase \
-	st_segmentize19.testcase \
-	st_segmentize1.testcase \
-	st_segmentize20.testcase \
-	st_segmentize21.testcase \
-	st_segmentize22.testcase \
-	st_segmentize23.testcase \
-	st_segmentize24.testcase \
-	st_segmentize25.testcase \
-	st_segmentize26.testcase \
-	st_segmentize27.testcase \
-	st_segmentize28.testcase \
-	st_segmentize29.testcase \
-	st_segmentize2.testcase \
-	st_segmentize30.testcase \
-	st_segmentize31.testcase \
-	st_segmentize3.testcase \
-	st_segmentize4.testcase \
-	st_segmentize5.testcase \
-	st_segmentize6.testcase \
-	st_segmentize7.testcase \
-	st_segmentize8.testcase \
-	st_segmentize9.testcase \
-	st_snaptogrid10.testcase \
-	st_snaptogrid11.testcase \
-	st_snaptogrid12.testcase \
-	st_snaptogrid13.testcase \
-	st_snaptogrid14.testcase \
-	st_snaptogrid15.testcase \
-	st_snaptogrid16.testcase \
-	st_snaptogrid17.testcase \
-	st_snaptogrid18.testcase \
-	st_snaptogrid19.testcase \
-	st_snaptogrid1.testcase \
-	st_snaptogrid20.testcase \
-	st_snaptogrid21.testcase \
-	st_snaptogrid22.testcase \
-	st_snaptogrid23.testcase \
-	st_snaptogrid24.testcase \
-	st_snaptogrid25.testcase \
-	st_snaptogrid26.testcase \
-	st_snaptogrid27.testcase \
-	st_snaptogrid28.testcase \
-	st_snaptogrid29.testcase \
-	st_snaptogrid2.testcase \
-	st_snaptogrid30.testcase \
-	st_snaptogrid31.testcase \
-	st_snaptogrid32.testcase \
-	st_snaptogrid33.testcase \
-	st_snaptogrid34.testcase \
-	st_snaptogrid35.testcase \
-	st_snaptogrid36.testcase \
-	st_snaptogrid37.testcase \
-	st_snaptogrid38.testcase \
-	st_snaptogrid39.testcase \
-	st_snaptogrid3.testcase \
-	st_snaptogrid40.testcase \
-	st_snaptogrid41.testcase \
-	st_snaptogrid42.testcase \
-	st_snaptogrid43.testcase \
-	st_snaptogrid44.testcase \
-	st_snaptogrid45.testcase \
-	st_snaptogrid46.testcase \
-	st_snaptogrid47.testcase \
-	st_snaptogrid48.testcase \
-	st_snaptogrid49.testcase \
-	st_snaptogrid4.testcase \
-	st_snaptogrid50.testcase \
-	st_snaptogrid51.testcase \
-	st_snaptogrid52.testcase \
-	st_snaptogrid53.testcase \
-	st_snaptogrid54.testcase \
-	st_snaptogrid55.testcase \
-	st_snaptogrid56.testcase \
-	st_snaptogrid57.testcase \
-	st_snaptogrid58.testcase \
-	st_snaptogrid59.testcase \
-	st_snaptogrid5.testcase \
-	st_snaptogrid60.testcase \
-	st_snaptogrid61.testcase \
-	st_snaptogrid62.testcase \
-	st_snaptogrid63.testcase \
-	st_snaptogrid64.testcase \
-	st_snaptogrid65.testcase \
-	st_snaptogrid6.testcase \
-	st_snaptogrid7.testcase \
-	st_snaptogrid8.testcase \
-	st_snaptogrid9.testcase \
-	st_split10.testcase \
-	st_split11.testcase \
-	st_split12.testcase \
-	st_split13.testcase \
-	st_split14.testcase \
-	st_split15.testcase \
-	st_split16.testcase \
-	st_split17.testcase \
-	st_split18.testcase \
-	st_split19.testcase \
-	st_split1.testcase \
-	st_split20.testcase \
-	st_split21.testcase \
-	st_split22.testcase \
-	st_split23.testcase \
-	st_split24.testcase \
-	st_split25.testcase \
-	st_split26.testcase \
-	st_split27.testcase \
-	st_split28.testcase \
-	st_split29.testcase \
-	st_split2.testcase \
-	st_split30.testcase \
-	st_split31.testcase \
-	st_split32.testcase \
-	st_split33.testcase \
-	st_split34.testcase \
-	st_split35.testcase \
-	st_split36.testcase \
-	st_split37.testcase \
-	st_split38.testcase \
-	st_split39.testcase \
-	st_split3.testcase \
-	st_split40.testcase \
-	st_split41.testcase \
-	st_split42.testcase \
-	st_split43.testcase \
-	st_split44.testcase \
-	st_split45.testcase \
-	st_split46.testcase \
-	st_split47.testcase \
-	st_split48.testcase \
-	st_split49.testcase \
-	st_split4.testcase \
-	st_split5.testcase \
-	st_split6.testcase \
-	st_split7.testcase \
-	st_split9.testcase \
-	st_node1.testcase \
-	st_node2.testcase \
-	st_node3.testcase \
-	st_node4.testcase \
-	st_node5.testcase \
-	st_node6.testcase \
-	st_node7.testcase \
-	st_node8.testcase \
-	st_node9.testcase \
-	st_self1.testcase \
-	st_self2.testcase \
-	st_self3.testcase \
-	st_self4.testcase \
-	st_self5.testcase \
-	st_self6.testcase \
-	st_self7.testcase \
-	st_self8.testcase \
-	st_self9.testcase
-
diff --git a/test/sql_stmt_lwgeom_tests/Makefile.in b/test/sql_stmt_lwgeom_tests/Makefile.in
deleted file mode 100644
index 34eeb7b..0000000
--- a/test/sql_stmt_lwgeom_tests/Makefile.in
+++ /dev/null
@@ -1,741 +0,0 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = test/sql_stmt_lwgeom_tests
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GEOSCONFIG = @GEOSCONFIG@
-GEOS_CFLAGS = @GEOS_CFLAGS@
-GEOS_LDFLAGS = @GEOS_LDFLAGS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
-LIBXML2_LIBS = @LIBXML2_LIBS@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-EXTRA_DIST = 3ddistance10.testcase \
-	3ddistance1.testcase \
-	3ddistance2.testcase \
-	3ddistance3.testcase \
-	3ddistance4.testcase \
-	3ddistance5.testcase \
-	3ddistance6.testcase \
-	3ddistance7.testcase \
-	3ddistance8.testcase \
-	3ddistance9.testcase \
-	3dlength1.testcase \
-	3dlength2.testcase \
-	3dlength3.testcase \
-	3dlength4.testcase \
-	3dlength5.testcase \
-	3dlength6.testcase \
-	3dlength7.testcase \
-	3dlength8.testcase \
-	3dmaxdistance10.testcase \
-	3dmaxdistance1.testcase \
-	3dmaxdistance2.testcase \
-	3dmaxdistance3.testcase \
-	3dmaxdistance4.testcase \
-	3dmaxdistance5.testcase \
-	3dmaxdistance6.testcase \
-	3dmaxdistance7.testcase \
-	3dmaxdistance8.testcase \
-	3dmaxdistance9.testcase \
-	maxdistance10.testcase \
-	maxdistance1.testcase \
-	maxdistance2.testcase \
-	maxdistance3.testcase \
-	maxdistance4.testcase \
-	maxdistance5.testcase \
-	maxdistance6.testcase \
-	maxdistance7.testcase \
-	maxdistance8.testcase \
-	maxdistance9.testcase \
-	st_asx3d10.testcase \
-	st_asx3d11.testcase \
-	st_asx3d12.testcase \
-	st_asx3d13.testcase \
-	st_asx3d14.testcase \
-	st_asx3d15.testcase \
-	st_asx3d16.testcase \
-	st_asx3d17.testcase \
-	st_asx3d18.testcase \
-	st_asx3d19.testcase \
-	st_asx3d1.testcase \
-	st_asx3d20.testcase \
-	st_asx3d21.testcase \
-	st_asx3d22.testcase \
-	st_asx3d23.testcase \
-	st_asx3d24.testcase \
-	st_asx3d27.testcase \
-	st_asx3d28.testcase \
-	st_asx3d29.testcase \
-	st_asx3d2.testcase \
-	st_asx3d3.testcase \
-	st_asx3d4.testcase \
-	st_asx3d5.testcase \
-	st_asx3d6.testcase \
-	st_asx3d7.testcase \
-	st_asx3d8.testcase \
-	st_asx3d9.testcase \
-	st_area10.testcase \
-	st_area11.testcase \
-	st_area12.testcase \
-	st_area13.testcase \
-	st_area14.testcase \
-	st_area15.testcase \
-	st_area16.testcase \
-	st_area17.testcase \
-	st_area18.testcase \
-	st_azimuth11.testcase \
-	st_azimuth12.testcase \
-	st_azimuth13.testcase \
-	st_azimuth14.testcase \
-	st_azimuth15.testcase \
-	st_azimuth16.testcase \
-	st_azimuth17.testcase \
-	st_azimuth1.testcase \
-	st_azimuth2.testcase \
-	st_azimuth3.testcase \
-	st_azimuth4.testcase \
-	st_azimuth5.testcase \
-	st_azimuth6.testcase \
-	st_azimuth7.testcase \
-	st_azimuth8.testcase \
-	st_azimuth9.testcase \
-	st_geohash10.testcase \
-	st_geohash1.testcase \
-	st_geohash2.testcase \
-	st_geohash3.testcase \
-	st_geohash4.testcase \
-	st_geohash5.testcase \
-	st_geohash6.testcase \
-	st_geohash7.testcase \
-	st_geohash8.testcase \
-	st_geohash9.testcase \
-	st_makevalid1.testcase \
-	st_makevalid2.testcase \
-	st_makevalid3.testcase \
-	st_makevalid4.testcase \
-	st_makevalid5.testcase \
-	st_makevalid6.testcase \
-	st_makevalid7.testcase \
-	st_makevalid8.testcase \
-	st_makevaliddiscarded1.testcase \
-	st_makevaliddiscarded2.testcase \
-	st_makevaliddiscarded3.testcase \
-	st_makevaliddiscarded4.testcase \
-	st_makevaliddiscarded5.testcase \
-	st_makevaliddiscarded6.testcase \
-	st_makevaliddiscarded7.testcase \
-	st_makevaliddiscarded8.testcase \
-	st_project1.testcase \
-	st_project2.testcase \
-	st_project3.testcase \
-	st_project4.testcase \
-	st_project5.testcase \
-	st_project6.testcase \
-	st_project7.testcase \
-	st_project8.testcase \
-	st_project9.testcase \
-	st_project10.testcase \
-	st_project11.testcase \
-	st_project12.testcase \
-	st_project13.testcase \
-	st_project14.testcase \
-	st_segmentize10.testcase \
-	st_segmentize11.testcase \
-	st_segmentize12.testcase \
-	st_segmentize13.testcase \
-	st_segmentize14.testcase \
-	st_segmentize15.testcase \
-	st_segmentize16.testcase \
-	st_segmentize17.testcase \
-	st_segmentize18.testcase \
-	st_segmentize19.testcase \
-	st_segmentize1.testcase \
-	st_segmentize20.testcase \
-	st_segmentize21.testcase \
-	st_segmentize22.testcase \
-	st_segmentize23.testcase \
-	st_segmentize24.testcase \
-	st_segmentize25.testcase \
-	st_segmentize26.testcase \
-	st_segmentize27.testcase \
-	st_segmentize28.testcase \
-	st_segmentize29.testcase \
-	st_segmentize2.testcase \
-	st_segmentize30.testcase \
-	st_segmentize31.testcase \
-	st_segmentize3.testcase \
-	st_segmentize4.testcase \
-	st_segmentize5.testcase \
-	st_segmentize6.testcase \
-	st_segmentize7.testcase \
-	st_segmentize8.testcase \
-	st_segmentize9.testcase \
-	st_snaptogrid10.testcase \
-	st_snaptogrid11.testcase \
-	st_snaptogrid12.testcase \
-	st_snaptogrid13.testcase \
-	st_snaptogrid14.testcase \
-	st_snaptogrid15.testcase \
-	st_snaptogrid16.testcase \
-	st_snaptogrid17.testcase \
-	st_snaptogrid18.testcase \
-	st_snaptogrid19.testcase \
-	st_snaptogrid1.testcase \
-	st_snaptogrid20.testcase \
-	st_snaptogrid21.testcase \
-	st_snaptogrid22.testcase \
-	st_snaptogrid23.testcase \
-	st_snaptogrid24.testcase \
-	st_snaptogrid25.testcase \
-	st_snaptogrid26.testcase \
-	st_snaptogrid27.testcase \
-	st_snaptogrid28.testcase \
-	st_snaptogrid29.testcase \
-	st_snaptogrid2.testcase \
-	st_snaptogrid30.testcase \
-	st_snaptogrid31.testcase \
-	st_snaptogrid32.testcase \
-	st_snaptogrid33.testcase \
-	st_snaptogrid34.testcase \
-	st_snaptogrid35.testcase \
-	st_snaptogrid36.testcase \
-	st_snaptogrid37.testcase \
-	st_snaptogrid38.testcase \
-	st_snaptogrid39.testcase \
-	st_snaptogrid3.testcase \
-	st_snaptogrid40.testcase \
-	st_snaptogrid41.testcase \
-	st_snaptogrid42.testcase \
-	st_snaptogrid43.testcase \
-	st_snaptogrid44.testcase \
-	st_snaptogrid45.testcase \
-	st_snaptogrid46.testcase \
-	st_snaptogrid47.testcase \
-	st_snaptogrid48.testcase \
-	st_snaptogrid49.testcase \
-	st_snaptogrid4.testcase \
-	st_snaptogrid50.testcase \
-	st_snaptogrid51.testcase \
-	st_snaptogrid52.testcase \
-	st_snaptogrid53.testcase \
-	st_snaptogrid54.testcase \
-	st_snaptogrid55.testcase \
-	st_snaptogrid56.testcase \
-	st_snaptogrid57.testcase \
-	st_snaptogrid58.testcase \
-	st_snaptogrid59.testcase \
-	st_snaptogrid5.testcase \
-	st_snaptogrid60.testcase \
-	st_snaptogrid61.testcase \
-	st_snaptogrid62.testcase \
-	st_snaptogrid63.testcase \
-	st_snaptogrid64.testcase \
-	st_snaptogrid65.testcase \
-	st_snaptogrid6.testcase \
-	st_snaptogrid7.testcase \
-	st_snaptogrid8.testcase \
-	st_snaptogrid9.testcase \
-	st_split10.testcase \
-	st_split11.testcase \
-	st_split12.testcase \
-	st_split13.testcase \
-	st_split14.testcase \
-	st_split15.testcase \
-	st_split16.testcase \
-	st_split17.testcase \
-	st_split18.testcase \
-	st_split19.testcase \
-	st_split1.testcase \
-	st_split20.testcase \
-	st_split21.testcase \
-	st_split22.testcase \
-	st_split23.testcase \
-	st_split24.testcase \
-	st_split25.testcase \
-	st_split26.testcase \
-	st_split27.testcase \
-	st_split28.testcase \
-	st_split29.testcase \
-	st_split2.testcase \
-	st_split30.testcase \
-	st_split31.testcase \
-	st_split32.testcase \
-	st_split33.testcase \
-	st_split34.testcase \
-	st_split35.testcase \
-	st_split36.testcase \
-	st_split37.testcase \
-	st_split38.testcase \
-	st_split39.testcase \
-	st_split3.testcase \
-	st_split40.testcase \
-	st_split41.testcase \
-	st_split42.testcase \
-	st_split43.testcase \
-	st_split44.testcase \
-	st_split45.testcase \
-	st_split46.testcase \
-	st_split47.testcase \
-	st_split48.testcase \
-	st_split49.testcase \
-	st_split4.testcase \
-	st_split5.testcase \
-	st_split6.testcase \
-	st_split7.testcase \
-	st_split9.testcase \
-	st_node1.testcase \
-	st_node2.testcase \
-	st_node3.testcase \
-	st_node4.testcase \
-	st_node5.testcase \
-	st_node6.testcase \
-	st_node7.testcase \
-	st_node8.testcase \
-	st_node9.testcase \
-	st_self1.testcase \
-	st_self2.testcase \
-	st_self3.testcase \
-	st_self4.testcase \
-	st_self5.testcase \
-	st_self6.testcase \
-	st_self7.testcase \
-	st_self8.testcase \
-	st_self9.testcase
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_lwgeom_tests/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign test/sql_stmt_lwgeom_tests/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags-am uninstall uninstall-am
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d14.testcase b/test/sql_stmt_lwgeom_tests/st_asx3d14.testcase
deleted file mode 100644
index 89da3df..0000000
--- a/test/sql_stmt_lwgeom_tests/st_asx3d14.testcase
+++ /dev/null
@@ -1,7 +0,0 @@
-ST_AsX3D - 2D multipolygon
-:memory: #use in-memory database
-SELECT ST_AsX3D(GeomFromText('MULTIPOLYGON(((10 10, 11 10, 11 11, 10 11, 10 10)), ((20 20, 21 20, 21 21, 20 21, 20 20)))'));
-1 # rows (not including the header row)
-1 # columns
-ST_AsX3D(GeomFromText('MULTIPOLYGON(((10 10, 11 10, 11 11, 10 11, 10 10)), ((20 20, 21 20, 21 21, 20 21, 20 20)))'))
-<IndexedFaceSet  coordIndex='0 1 2 3 -1 4 5 6 7'>10 10 11 10 11 11 10 11 20 20 21 20 21 21 20 21 ' />:0
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d15.testcase b/test/sql_stmt_lwgeom_tests/st_asx3d15.testcase
deleted file mode 100644
index a9ac86c..0000000
--- a/test/sql_stmt_lwgeom_tests/st_asx3d15.testcase
+++ /dev/null
@@ -1,7 +0,0 @@
-ST_AsX3D - 3D multipolygon
-:memory: #use in-memory database
-SELECT ST_AsX3D(GeomFromText('MULTIPOLYGONZ(((10 10 1, 11 10 2, 11 11 3, 10 11 4, 10 10 1)), ((20 20 5, 21 20 6, 21 21 7, 20 21 8, 20 20 5)))'));
-1 # rows (not including the header row)
-1 # columns
-ST_AsX3D(GeomFromText('MULTIPOLYGONZ(((10 10 1, 11 10 2, 11 11 3, 10 11 4, 10 10 1)), ((20 20 5, 21 20 6, 21 21 7, 20 21 8, 20 20 5)))'))
-<IndexedFaceSet  coordIndex='0 1 2 3 -1 4 5 6 7'><Coordinate point='10 10 1 11 10 2 11 11 3 10 11 4 20 20 5 21 20 6 21 21 7 20 21 8 ' /></IndexedFaceSet>:0
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d8.testcase b/test/sql_stmt_lwgeom_tests/st_asx3d8.testcase
deleted file mode 100644
index a2aa04c..0000000
--- a/test/sql_stmt_lwgeom_tests/st_asx3d8.testcase
+++ /dev/null
@@ -1,7 +0,0 @@
-ST_AsX3D - 2D polygon
-:memory: #use in-memory database
-SELECT ST_AsX3D(GeomFromText('POLYGON((10 10, 11 10, 11 11, 10 11, 10 10))'));
-1 # rows (not including the header row)
-1 # columns
-ST_AsX3D(GeomFromText('POLYGON((10 10, 11 10, 11 11, 10 11, 10 10))'))
-<IndexedFaceSet  coordIndex='0 1 2 3'>10 10 11 10 11 11 10 11 ' />:0
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d9.testcase b/test/sql_stmt_lwgeom_tests/st_asx3d9.testcase
deleted file mode 100644
index 73c5485..0000000
--- a/test/sql_stmt_lwgeom_tests/st_asx3d9.testcase
+++ /dev/null
@@ -1,7 +0,0 @@
-ST_AsX3D - 3D polygon
-:memory: #use in-memory database
-SELECT ST_AsX3D(GeomFromText('POLYGONZ((10 10 101, 11 10 102, 11 11 103, 10 11 104, 10 10 101))'));
-1 # rows (not including the header row)
-1 # columns
-ST_AsX3D(GeomFromText('POLYGONZ((10 10 101, 11 10 102, 11 11 103, 10 11 104, 10 10 101))'))
-<IndexedFaceSet  coordIndex='0 1 2 3'><Coordinate point='10 10 101 11 10 102 11 11 103 10 11 104 ' /></IndexedFaceSet>:0
diff --git a/test/sql_stmt_nocache_tests/Makefile b/test/sql_stmt_nocache_tests/Makefile
new file mode 100644
index 0000000..6460803
--- /dev/null
+++ b/test/sql_stmt_nocache_tests/Makefile
@@ -0,0 +1,455 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_nocache_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_nocache_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_nocache_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_nocache_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = amphibious1.testcase \
+	amphibious2.testcase \
+	precision1.testcase \
+	precision2.testcase \
+	gpkg1.testcase \
+	gpkg2.testcase 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_nocache_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_nocache_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance1.testcase b/test/sql_stmt_rtgeom_tests/3ddistance1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance1.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance10.testcase b/test/sql_stmt_rtgeom_tests/3ddistance10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance10.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance2.testcase b/test/sql_stmt_rtgeom_tests/3ddistance2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance2.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance3.testcase b/test/sql_stmt_rtgeom_tests/3ddistance3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance3.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance4.testcase b/test/sql_stmt_rtgeom_tests/3ddistance4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance4.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance5.testcase b/test/sql_stmt_rtgeom_tests/3ddistance5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance5.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance6.testcase b/test/sql_stmt_rtgeom_tests/3ddistance6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance6.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance7.testcase b/test/sql_stmt_rtgeom_tests/3ddistance7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance7.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance8.testcase b/test/sql_stmt_rtgeom_tests/3ddistance8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance8.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3ddistance9.testcase b/test/sql_stmt_rtgeom_tests/3ddistance9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3ddistance9.testcase
rename to test/sql_stmt_rtgeom_tests/3ddistance9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength1.testcase b/test/sql_stmt_rtgeom_tests/3dlength1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength1.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength2.testcase b/test/sql_stmt_rtgeom_tests/3dlength2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength2.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength3.testcase b/test/sql_stmt_rtgeom_tests/3dlength3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength3.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength4.testcase b/test/sql_stmt_rtgeom_tests/3dlength4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength4.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength5.testcase b/test/sql_stmt_rtgeom_tests/3dlength5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength5.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength6.testcase b/test/sql_stmt_rtgeom_tests/3dlength6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength6.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength7.testcase b/test/sql_stmt_rtgeom_tests/3dlength7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength7.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dlength8.testcase b/test/sql_stmt_rtgeom_tests/3dlength8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dlength8.testcase
rename to test/sql_stmt_rtgeom_tests/3dlength8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance1.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance1.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance10.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance10.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance2.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance2.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance3.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance3.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance4.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance4.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance5.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance5.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance6.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance6.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance7.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance7.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance8.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance8.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/3dmaxdistance9.testcase b/test/sql_stmt_rtgeom_tests/3dmaxdistance9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/3dmaxdistance9.testcase
rename to test/sql_stmt_rtgeom_tests/3dmaxdistance9.testcase
diff --git a/test/sql_stmt_rtgeom_tests/Makefile.am b/test/sql_stmt_rtgeom_tests/Makefile.am
new file mode 100644
index 0000000..bad29b3
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/Makefile.am
@@ -0,0 +1,298 @@
+
+EXTRA_DIST = 3ddistance10.testcase \
+	3ddistance1.testcase \
+	3ddistance2.testcase \
+	3ddistance3.testcase \
+	3ddistance4.testcase \
+	3ddistance5.testcase \
+	3ddistance6.testcase \
+	3ddistance7.testcase \
+	3ddistance8.testcase \
+	3ddistance9.testcase \
+	3dlength1.testcase \
+	3dlength2.testcase \
+	3dlength3.testcase \
+	3dlength4.testcase \
+	3dlength5.testcase \
+	3dlength6.testcase \
+	3dlength7.testcase \
+	3dlength8.testcase \
+	3dmaxdistance10.testcase \
+	3dmaxdistance1.testcase \
+	3dmaxdistance2.testcase \
+	3dmaxdistance3.testcase \
+	3dmaxdistance4.testcase \
+	3dmaxdistance5.testcase \
+	3dmaxdistance6.testcase \
+	3dmaxdistance7.testcase \
+	3dmaxdistance8.testcase \
+	3dmaxdistance9.testcase \
+	maxdistance10.testcase \
+	maxdistance1.testcase \
+	maxdistance2.testcase \
+	maxdistance3.testcase \
+	maxdistance4.testcase \
+	maxdistance5.testcase \
+	maxdistance6.testcase \
+	maxdistance7.testcase \
+	maxdistance8.testcase \
+	maxdistance9.testcase \
+	st_asx3d10.testcase \
+	st_asx3d11.testcase \
+	st_asx3d12.testcase \
+	st_asx3d13.testcase \
+	st_asx3d14.testcase \
+	st_asx3d15.testcase \
+	st_asx3d16.testcase \
+	st_asx3d17.testcase \
+	st_asx3d18.testcase \
+	st_asx3d19.testcase \
+	st_asx3d1.testcase \
+	st_asx3d20.testcase \
+	st_asx3d21.testcase \
+	st_asx3d22.testcase \
+	st_asx3d23.testcase \
+	st_asx3d24.testcase \
+	st_asx3d25.testcase \
+	st_asx3d26.testcase \
+	st_asx3d27.testcase \
+	st_asx3d28.testcase \
+	st_asx3d29.testcase \
+	st_asx3d30.testcase \
+	st_asx3d2.testcase \
+	st_asx3d3.testcase \
+	st_asx3d4.testcase \
+	st_asx3d5.testcase \
+	st_asx3d6.testcase \
+	st_asx3d7.testcase \
+	st_asx3d8.testcase \
+	st_asx3d9.testcase \
+	st_area10.testcase \
+	st_area11.testcase \
+	st_area12.testcase \
+	st_area13.testcase \
+	st_area14.testcase \
+	st_area15.testcase \
+	st_area16.testcase \
+	st_area17.testcase \
+	st_area18.testcase \
+	st_azimuth11.testcase \
+	st_azimuth12.testcase \
+	st_azimuth13.testcase \
+	st_azimuth14.testcase \
+	st_azimuth15.testcase \
+	st_azimuth16.testcase \
+	st_azimuth17.testcase \
+	st_azimuth1.testcase \
+	st_azimuth2.testcase \
+	st_azimuth3.testcase \
+	st_azimuth4.testcase \
+	st_azimuth5.testcase \
+	st_azimuth6.testcase \
+	st_azimuth7.testcase \
+	st_azimuth8.testcase \
+	st_azimuth9.testcase \
+	st_geohash10.testcase \
+	st_geohash1.testcase \
+	st_geohash2.testcase \
+	st_geohash3.testcase \
+	st_geohash4.testcase \
+	st_geohash5.testcase \
+	st_geohash6.testcase \
+	st_geohash7.testcase \
+	st_geohash8.testcase \
+	st_geohash9.testcase \
+	st_makevalid1.testcase \
+	st_makevalid2.testcase \
+	st_makevalid3.testcase \
+	st_makevalid4.testcase \
+	st_makevalid5.testcase \
+	st_makevalid6.testcase \
+	st_makevalid7.testcase \
+	st_makevalid8.testcase \
+	st_makevaliddiscarded1.testcase \
+	st_makevaliddiscarded2.testcase \
+	st_makevaliddiscarded3.testcase \
+	st_makevaliddiscarded4.testcase \
+	st_makevaliddiscarded5.testcase \
+	st_makevaliddiscarded6.testcase \
+	st_makevaliddiscarded7.testcase \
+	st_makevaliddiscarded8.testcase \
+	st_project1.testcase \
+	st_project2.testcase \
+	st_project3.testcase \
+	st_project4.testcase \
+	st_project5.testcase \
+	st_project6.testcase \
+	st_project7.testcase \
+	st_project8.testcase \
+	st_project9.testcase \
+	st_project10.testcase \
+	st_project11.testcase \
+	st_project12.testcase \
+	st_project13.testcase \
+	st_project14.testcase \
+	st_segmentize10.testcase \
+	st_segmentize11.testcase \
+	st_segmentize12.testcase \
+	st_segmentize13.testcase \
+	st_segmentize14.testcase \
+	st_segmentize15.testcase \
+	st_segmentize16.testcase \
+	st_segmentize17.testcase \
+	st_segmentize18.testcase \
+	st_segmentize19.testcase \
+	st_segmentize1.testcase \
+	st_segmentize20.testcase \
+	st_segmentize21.testcase \
+	st_segmentize22.testcase \
+	st_segmentize23.testcase \
+	st_segmentize24.testcase \
+	st_segmentize25.testcase \
+	st_segmentize26.testcase \
+	st_segmentize27.testcase \
+	st_segmentize28.testcase \
+	st_segmentize29.testcase \
+	st_segmentize2.testcase \
+	st_segmentize30.testcase \
+	st_segmentize31.testcase \
+	st_segmentize3.testcase \
+	st_segmentize4.testcase \
+	st_segmentize5.testcase \
+	st_segmentize6.testcase \
+	st_segmentize7.testcase \
+	st_segmentize8.testcase \
+	st_segmentize9.testcase \
+	st_snaptogrid10.testcase \
+	st_snaptogrid11.testcase \
+	st_snaptogrid12.testcase \
+	st_snaptogrid13.testcase \
+	st_snaptogrid14.testcase \
+	st_snaptogrid15.testcase \
+	st_snaptogrid16.testcase \
+	st_snaptogrid17.testcase \
+	st_snaptogrid18.testcase \
+	st_snaptogrid19.testcase \
+	st_snaptogrid1.testcase \
+	st_snaptogrid20.testcase \
+	st_snaptogrid21.testcase \
+	st_snaptogrid22.testcase \
+	st_snaptogrid23.testcase \
+	st_snaptogrid24.testcase \
+	st_snaptogrid25.testcase \
+	st_snaptogrid26.testcase \
+	st_snaptogrid27.testcase \
+	st_snaptogrid28.testcase \
+	st_snaptogrid29.testcase \
+	st_snaptogrid2.testcase \
+	st_snaptogrid30.testcase \
+	st_snaptogrid31.testcase \
+	st_snaptogrid32.testcase \
+	st_snaptogrid33.testcase \
+	st_snaptogrid34.testcase \
+	st_snaptogrid35.testcase \
+	st_snaptogrid36.testcase \
+	st_snaptogrid37.testcase \
+	st_snaptogrid38.testcase \
+	st_snaptogrid39.testcase \
+	st_snaptogrid3.testcase \
+	st_snaptogrid40.testcase \
+	st_snaptogrid41.testcase \
+	st_snaptogrid42.testcase \
+	st_snaptogrid43.testcase \
+	st_snaptogrid44.testcase \
+	st_snaptogrid45.testcase \
+	st_snaptogrid46.testcase \
+	st_snaptogrid47.testcase \
+	st_snaptogrid48.testcase \
+	st_snaptogrid49.testcase \
+	st_snaptogrid4.testcase \
+	st_snaptogrid50.testcase \
+	st_snaptogrid51.testcase \
+	st_snaptogrid52.testcase \
+	st_snaptogrid53.testcase \
+	st_snaptogrid54.testcase \
+	st_snaptogrid55.testcase \
+	st_snaptogrid56.testcase \
+	st_snaptogrid57.testcase \
+	st_snaptogrid58.testcase \
+	st_snaptogrid59.testcase \
+	st_snaptogrid5.testcase \
+	st_snaptogrid60.testcase \
+	st_snaptogrid61.testcase \
+	st_snaptogrid62.testcase \
+	st_snaptogrid63.testcase \
+	st_snaptogrid64.testcase \
+	st_snaptogrid65.testcase \
+	st_snaptogrid6.testcase \
+	st_snaptogrid7.testcase \
+	st_snaptogrid8.testcase \
+	st_snaptogrid9.testcase \
+	st_split10.testcase \
+	st_split11.testcase \
+	st_split12.testcase \
+	st_split13.testcase \
+	st_split14.testcase \
+	st_split15.testcase \
+	st_split16.testcase \
+	st_split17.testcase \
+	st_split18.testcase \
+	st_split19.testcase \
+	st_split1.testcase \
+	st_split20.testcase \
+	st_split21.testcase \
+	st_split22.testcase \
+	st_split23.testcase \
+	st_split24.testcase \
+	st_split25.testcase \
+	st_split26.testcase \
+	st_split27.testcase \
+	st_split28.testcase \
+	st_split29.testcase \
+	st_split2.testcase \
+	st_split30.testcase \
+	st_split31.testcase \
+	st_split32.testcase \
+	st_split33.testcase \
+	st_split34.testcase \
+	st_split35.testcase \
+	st_split36.testcase \
+	st_split37.testcase \
+	st_split38.testcase \
+	st_split39.testcase \
+	st_split3.testcase \
+	st_split40.testcase \
+	st_split41.testcase \
+	st_split42.testcase \
+	st_split43.testcase \
+	st_split44.testcase \
+	st_split45.testcase \
+	st_split46.testcase \
+	st_split47.testcase \
+	st_split48.testcase \
+	st_split49.testcase \
+	st_split4.testcase \
+	st_split5.testcase \
+	st_split6.testcase \
+	st_split7.testcase \
+	st_split8.testcase \
+	st_split9.testcase \
+	st_node1.testcase \
+	st_node2.testcase \
+	st_node3.testcase \
+	st_node4.testcase \
+	st_node5.testcase \
+	st_node6.testcase \
+	st_node7.testcase \
+	st_node8.testcase \
+	st_node9.testcase \
+	st_self1.testcase \
+	st_self2.testcase \
+	st_self3.testcase \
+	st_self4.testcase \
+	st_self5.testcase \
+	st_self6.testcase \
+	st_self7.testcase \
+	st_self8.testcase \
+	st_self9.testcase
+
diff --git a/test/sql_stmt_rtgeom_tests/Makefile.in b/test/sql_stmt_rtgeom_tests/Makefile.in
new file mode 100644
index 0000000..3cc35bf
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/Makefile.in
@@ -0,0 +1,745 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/sql_stmt_rtgeom_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GEOSCONFIG = @GEOSCONFIG@
+GEOS_CFLAGS = @GEOS_CFLAGS@
+GEOS_LDFLAGS = @GEOS_LDFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = 3ddistance10.testcase \
+	3ddistance1.testcase \
+	3ddistance2.testcase \
+	3ddistance3.testcase \
+	3ddistance4.testcase \
+	3ddistance5.testcase \
+	3ddistance6.testcase \
+	3ddistance7.testcase \
+	3ddistance8.testcase \
+	3ddistance9.testcase \
+	3dlength1.testcase \
+	3dlength2.testcase \
+	3dlength3.testcase \
+	3dlength4.testcase \
+	3dlength5.testcase \
+	3dlength6.testcase \
+	3dlength7.testcase \
+	3dlength8.testcase \
+	3dmaxdistance10.testcase \
+	3dmaxdistance1.testcase \
+	3dmaxdistance2.testcase \
+	3dmaxdistance3.testcase \
+	3dmaxdistance4.testcase \
+	3dmaxdistance5.testcase \
+	3dmaxdistance6.testcase \
+	3dmaxdistance7.testcase \
+	3dmaxdistance8.testcase \
+	3dmaxdistance9.testcase \
+	maxdistance10.testcase \
+	maxdistance1.testcase \
+	maxdistance2.testcase \
+	maxdistance3.testcase \
+	maxdistance4.testcase \
+	maxdistance5.testcase \
+	maxdistance6.testcase \
+	maxdistance7.testcase \
+	maxdistance8.testcase \
+	maxdistance9.testcase \
+	st_asx3d10.testcase \
+	st_asx3d11.testcase \
+	st_asx3d12.testcase \
+	st_asx3d13.testcase \
+	st_asx3d14.testcase \
+	st_asx3d15.testcase \
+	st_asx3d16.testcase \
+	st_asx3d17.testcase \
+	st_asx3d18.testcase \
+	st_asx3d19.testcase \
+	st_asx3d1.testcase \
+	st_asx3d20.testcase \
+	st_asx3d21.testcase \
+	st_asx3d22.testcase \
+	st_asx3d23.testcase \
+	st_asx3d24.testcase \
+	st_asx3d25.testcase \
+	st_asx3d26.testcase \
+	st_asx3d27.testcase \
+	st_asx3d28.testcase \
+	st_asx3d29.testcase \
+	st_asx3d30.testcase \
+	st_asx3d2.testcase \
+	st_asx3d3.testcase \
+	st_asx3d4.testcase \
+	st_asx3d5.testcase \
+	st_asx3d6.testcase \
+	st_asx3d7.testcase \
+	st_asx3d8.testcase \
+	st_asx3d9.testcase \
+	st_area10.testcase \
+	st_area11.testcase \
+	st_area12.testcase \
+	st_area13.testcase \
+	st_area14.testcase \
+	st_area15.testcase \
+	st_area16.testcase \
+	st_area17.testcase \
+	st_area18.testcase \
+	st_azimuth11.testcase \
+	st_azimuth12.testcase \
+	st_azimuth13.testcase \
+	st_azimuth14.testcase \
+	st_azimuth15.testcase \
+	st_azimuth16.testcase \
+	st_azimuth17.testcase \
+	st_azimuth1.testcase \
+	st_azimuth2.testcase \
+	st_azimuth3.testcase \
+	st_azimuth4.testcase \
+	st_azimuth5.testcase \
+	st_azimuth6.testcase \
+	st_azimuth7.testcase \
+	st_azimuth8.testcase \
+	st_azimuth9.testcase \
+	st_geohash10.testcase \
+	st_geohash1.testcase \
+	st_geohash2.testcase \
+	st_geohash3.testcase \
+	st_geohash4.testcase \
+	st_geohash5.testcase \
+	st_geohash6.testcase \
+	st_geohash7.testcase \
+	st_geohash8.testcase \
+	st_geohash9.testcase \
+	st_makevalid1.testcase \
+	st_makevalid2.testcase \
+	st_makevalid3.testcase \
+	st_makevalid4.testcase \
+	st_makevalid5.testcase \
+	st_makevalid6.testcase \
+	st_makevalid7.testcase \
+	st_makevalid8.testcase \
+	st_makevaliddiscarded1.testcase \
+	st_makevaliddiscarded2.testcase \
+	st_makevaliddiscarded3.testcase \
+	st_makevaliddiscarded4.testcase \
+	st_makevaliddiscarded5.testcase \
+	st_makevaliddiscarded6.testcase \
+	st_makevaliddiscarded7.testcase \
+	st_makevaliddiscarded8.testcase \
+	st_project1.testcase \
+	st_project2.testcase \
+	st_project3.testcase \
+	st_project4.testcase \
+	st_project5.testcase \
+	st_project6.testcase \
+	st_project7.testcase \
+	st_project8.testcase \
+	st_project9.testcase \
+	st_project10.testcase \
+	st_project11.testcase \
+	st_project12.testcase \
+	st_project13.testcase \
+	st_project14.testcase \
+	st_segmentize10.testcase \
+	st_segmentize11.testcase \
+	st_segmentize12.testcase \
+	st_segmentize13.testcase \
+	st_segmentize14.testcase \
+	st_segmentize15.testcase \
+	st_segmentize16.testcase \
+	st_segmentize17.testcase \
+	st_segmentize18.testcase \
+	st_segmentize19.testcase \
+	st_segmentize1.testcase \
+	st_segmentize20.testcase \
+	st_segmentize21.testcase \
+	st_segmentize22.testcase \
+	st_segmentize23.testcase \
+	st_segmentize24.testcase \
+	st_segmentize25.testcase \
+	st_segmentize26.testcase \
+	st_segmentize27.testcase \
+	st_segmentize28.testcase \
+	st_segmentize29.testcase \
+	st_segmentize2.testcase \
+	st_segmentize30.testcase \
+	st_segmentize31.testcase \
+	st_segmentize3.testcase \
+	st_segmentize4.testcase \
+	st_segmentize5.testcase \
+	st_segmentize6.testcase \
+	st_segmentize7.testcase \
+	st_segmentize8.testcase \
+	st_segmentize9.testcase \
+	st_snaptogrid10.testcase \
+	st_snaptogrid11.testcase \
+	st_snaptogrid12.testcase \
+	st_snaptogrid13.testcase \
+	st_snaptogrid14.testcase \
+	st_snaptogrid15.testcase \
+	st_snaptogrid16.testcase \
+	st_snaptogrid17.testcase \
+	st_snaptogrid18.testcase \
+	st_snaptogrid19.testcase \
+	st_snaptogrid1.testcase \
+	st_snaptogrid20.testcase \
+	st_snaptogrid21.testcase \
+	st_snaptogrid22.testcase \
+	st_snaptogrid23.testcase \
+	st_snaptogrid24.testcase \
+	st_snaptogrid25.testcase \
+	st_snaptogrid26.testcase \
+	st_snaptogrid27.testcase \
+	st_snaptogrid28.testcase \
+	st_snaptogrid29.testcase \
+	st_snaptogrid2.testcase \
+	st_snaptogrid30.testcase \
+	st_snaptogrid31.testcase \
+	st_snaptogrid32.testcase \
+	st_snaptogrid33.testcase \
+	st_snaptogrid34.testcase \
+	st_snaptogrid35.testcase \
+	st_snaptogrid36.testcase \
+	st_snaptogrid37.testcase \
+	st_snaptogrid38.testcase \
+	st_snaptogrid39.testcase \
+	st_snaptogrid3.testcase \
+	st_snaptogrid40.testcase \
+	st_snaptogrid41.testcase \
+	st_snaptogrid42.testcase \
+	st_snaptogrid43.testcase \
+	st_snaptogrid44.testcase \
+	st_snaptogrid45.testcase \
+	st_snaptogrid46.testcase \
+	st_snaptogrid47.testcase \
+	st_snaptogrid48.testcase \
+	st_snaptogrid49.testcase \
+	st_snaptogrid4.testcase \
+	st_snaptogrid50.testcase \
+	st_snaptogrid51.testcase \
+	st_snaptogrid52.testcase \
+	st_snaptogrid53.testcase \
+	st_snaptogrid54.testcase \
+	st_snaptogrid55.testcase \
+	st_snaptogrid56.testcase \
+	st_snaptogrid57.testcase \
+	st_snaptogrid58.testcase \
+	st_snaptogrid59.testcase \
+	st_snaptogrid5.testcase \
+	st_snaptogrid60.testcase \
+	st_snaptogrid61.testcase \
+	st_snaptogrid62.testcase \
+	st_snaptogrid63.testcase \
+	st_snaptogrid64.testcase \
+	st_snaptogrid65.testcase \
+	st_snaptogrid6.testcase \
+	st_snaptogrid7.testcase \
+	st_snaptogrid8.testcase \
+	st_snaptogrid9.testcase \
+	st_split10.testcase \
+	st_split11.testcase \
+	st_split12.testcase \
+	st_split13.testcase \
+	st_split14.testcase \
+	st_split15.testcase \
+	st_split16.testcase \
+	st_split17.testcase \
+	st_split18.testcase \
+	st_split19.testcase \
+	st_split1.testcase \
+	st_split20.testcase \
+	st_split21.testcase \
+	st_split22.testcase \
+	st_split23.testcase \
+	st_split24.testcase \
+	st_split25.testcase \
+	st_split26.testcase \
+	st_split27.testcase \
+	st_split28.testcase \
+	st_split29.testcase \
+	st_split2.testcase \
+	st_split30.testcase \
+	st_split31.testcase \
+	st_split32.testcase \
+	st_split33.testcase \
+	st_split34.testcase \
+	st_split35.testcase \
+	st_split36.testcase \
+	st_split37.testcase \
+	st_split38.testcase \
+	st_split39.testcase \
+	st_split3.testcase \
+	st_split40.testcase \
+	st_split41.testcase \
+	st_split42.testcase \
+	st_split43.testcase \
+	st_split44.testcase \
+	st_split45.testcase \
+	st_split46.testcase \
+	st_split47.testcase \
+	st_split48.testcase \
+	st_split49.testcase \
+	st_split4.testcase \
+	st_split5.testcase \
+	st_split6.testcase \
+	st_split7.testcase \
+	st_split8.testcase \
+	st_split9.testcase \
+	st_node1.testcase \
+	st_node2.testcase \
+	st_node3.testcase \
+	st_node4.testcase \
+	st_node5.testcase \
+	st_node6.testcase \
+	st_node7.testcase \
+	st_node8.testcase \
+	st_node9.testcase \
+	st_self1.testcase \
+	st_self2.testcase \
+	st_self3.testcase \
+	st_self4.testcase \
+	st_self5.testcase \
+	st_self6.testcase \
+	st_self7.testcase \
+	st_self8.testcase \
+	st_self9.testcase
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_rtgeom_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_rtgeom_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance1.testcase b/test/sql_stmt_rtgeom_tests/maxdistance1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance1.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance10.testcase b/test/sql_stmt_rtgeom_tests/maxdistance10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance10.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance2.testcase b/test/sql_stmt_rtgeom_tests/maxdistance2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance2.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance3.testcase b/test/sql_stmt_rtgeom_tests/maxdistance3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance3.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance4.testcase b/test/sql_stmt_rtgeom_tests/maxdistance4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance4.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance5.testcase b/test/sql_stmt_rtgeom_tests/maxdistance5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance5.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance6.testcase b/test/sql_stmt_rtgeom_tests/maxdistance6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance6.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance7.testcase b/test/sql_stmt_rtgeom_tests/maxdistance7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance7.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance8.testcase b/test/sql_stmt_rtgeom_tests/maxdistance8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance8.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/maxdistance9.testcase b/test/sql_stmt_rtgeom_tests/maxdistance9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/maxdistance9.testcase
rename to test/sql_stmt_rtgeom_tests/maxdistance9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area10.testcase b/test/sql_stmt_rtgeom_tests/st_area10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area10.testcase
rename to test/sql_stmt_rtgeom_tests/st_area10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area11.testcase b/test/sql_stmt_rtgeom_tests/st_area11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area11.testcase
rename to test/sql_stmt_rtgeom_tests/st_area11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area12.testcase b/test/sql_stmt_rtgeom_tests/st_area12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area12.testcase
rename to test/sql_stmt_rtgeom_tests/st_area12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area13.testcase b/test/sql_stmt_rtgeom_tests/st_area13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area13.testcase
rename to test/sql_stmt_rtgeom_tests/st_area13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area14.testcase b/test/sql_stmt_rtgeom_tests/st_area14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area14.testcase
rename to test/sql_stmt_rtgeom_tests/st_area14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area15.testcase b/test/sql_stmt_rtgeom_tests/st_area15.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area15.testcase
rename to test/sql_stmt_rtgeom_tests/st_area15.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area16.testcase b/test/sql_stmt_rtgeom_tests/st_area16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area16.testcase
rename to test/sql_stmt_rtgeom_tests/st_area16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area17.testcase b/test/sql_stmt_rtgeom_tests/st_area17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area17.testcase
rename to test/sql_stmt_rtgeom_tests/st_area17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_area18.testcase b/test/sql_stmt_rtgeom_tests/st_area18.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_area18.testcase
rename to test/sql_stmt_rtgeom_tests/st_area18.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d1.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d1.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d10.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d10.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d11.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d11.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d12.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d12.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d13.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d13.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d13.testcase
diff --git a/test/sql_stmt_rtgeom_tests/st_asx3d14.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d14.testcase
new file mode 100644
index 0000000..73512ea
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/st_asx3d14.testcase
@@ -0,0 +1,8 @@
+ST_AsX3D - 2D multipolygon
+:memory: #use in-memory database
+SELECT ST_AsX3D(GeomFromText('MULTIPOLYGON(((10 10, 11 10, 11 11, 10 11, 10 10)), ((20 20, 21 20, 21 21, 20 21, 20 20)))'));
+1 # rows (not including the header row)
+1 # columns
+ST_AsX3D(GeomFromText('MULTIPOLYGON(((10 10, 11 10, 11 11, 10 11, 10 10)), ((20 20, 21 20, 21 21, 20 21, 20 20)))'))
+<IndexedFaceSet  coordIndex='0 1 2 3 -1 4 5 6 7'>10 10 11 10 11 11 10 11 20 20 21 20 21 21 20 21 ' />
+# <IndexedFaceSet  convex='false' coordIndex='0 1 2 3 -1 4 5 6 7'>10 10 11 10 11 11 10 11 20 20 21 20 21 21 20 21 ' />
diff --git a/test/sql_stmt_rtgeom_tests/st_asx3d15.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d15.testcase
new file mode 100644
index 0000000..95f31a5
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/st_asx3d15.testcase
@@ -0,0 +1,8 @@
+ST_AsX3D - 3D multipolygon
+:memory: #use in-memory database
+SELECT ST_AsX3D(GeomFromText('MULTIPOLYGONZ(((10 10 1, 11 10 2, 11 11 3, 10 11 4, 10 10 1)), ((20 20 5, 21 20 6, 21 21 7, 20 21 8, 20 20 5)))'));
+1 # rows (not including the header row)
+1 # columns
+ST_AsX3D(GeomFromText('MULTIPOLYGONZ(((10 10 1, 11 10 2, 11 11 3, 10 11 4, 10 10 1)), ((20 20 5, 21 20 6, 21 21 7, 20 21 8, 20 20 5)))'))
+<IndexedFaceSet  coordIndex='0 1 2 3 -1 4 5 6 7'><Coordinate point='10 10 1 11 10 2 11 11 3 10 11 4 20 20 5 21 20 6 21 21 7 20 21 8 ' /></IndexedFaceSet>
+# <IndexedFaceSet  convex='false' coordIndex='0 1 2 3 -1 4 5 6 7'><Coordinate point='10 10 1 11 10 2 11 11 3 10 11 4 20 20 5 21 20 6 21 21 7 20 21 8 ' /></IndexedFaceSet>
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d16.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d16.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d17.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d17.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d18.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d18.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d18.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d18.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d19.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d19.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d19.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d19.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d2.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d2.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d20.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d20.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d20.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d20.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d21.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d21.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d21.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d21.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d22.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d22.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d22.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d22.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d23.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d23.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d23.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d23.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d24.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d24.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d24.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d24.testcase
diff --git a/test/sql_stmt_lwgeom_22_tests/st_asx3d25.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d25.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_22_tests/st_asx3d25.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d25.testcase
diff --git a/test/sql_stmt_lwgeom_22_tests/st_asx3d26.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d26.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_22_tests/st_asx3d26.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d26.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d27.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d27.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d27.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d27.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d28.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d28.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d28.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d28.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d29.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d29.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d29.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d29.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d3.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d3.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d3.testcase
diff --git a/test/sql_stmt_lwgeom_22_tests/st_asx3d30.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d30.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_22_tests/st_asx3d30.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d30.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d4.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d4.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d5.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d5.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d6.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d6.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_asx3d7.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_asx3d7.testcase
rename to test/sql_stmt_rtgeom_tests/st_asx3d7.testcase
diff --git a/test/sql_stmt_rtgeom_tests/st_asx3d8.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d8.testcase
new file mode 100644
index 0000000..6cdfe36
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/st_asx3d8.testcase
@@ -0,0 +1,8 @@
+ST_AsX3D - 2D polygon
+:memory: #use in-memory database
+SELECT ST_AsX3D(GeomFromText('POLYGON((10 10, 11 10, 11 11, 10 11, 10 10))'));
+1 # rows (not including the header row)
+1 # columns
+ST_AsX3D(GeomFromText('POLYGON((10 10, 11 10, 11 11, 10 11, 10 10))'))
+<IndexedFaceSet  coordIndex='0 1 2 3'>10 10 11 10 11 11 10 11 ' />
+# <IndexedFaceSet  convex='false' coordIndex='0 1 2 3'>10 10 11 10 11 11 10 11 ' />|
diff --git a/test/sql_stmt_rtgeom_tests/st_asx3d9.testcase b/test/sql_stmt_rtgeom_tests/st_asx3d9.testcase
new file mode 100644
index 0000000..f86c7b4
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/st_asx3d9.testcase
@@ -0,0 +1,8 @@
+ST_AsX3D - 3D polygon
+:memory: #use in-memory database
+SELECT ST_AsX3D(GeomFromText('POLYGONZ((10 10 101, 11 10 102, 11 11 103, 10 11 104, 10 10 101))'));
+1 # rows (not including the header row)
+1 # columns
+ST_AsX3D(GeomFromText('POLYGONZ((10 10 101, 11 10 102, 11 11 103, 10 11 104, 10 10 101))'))
+<IndexedFaceSet  coordIndex='0 1 2 3'><Coordinate point='10 10 101 11 10 102 11 11 103 10 11 104 ' /></IndexedFaceSet>
+# <IndexedFaceSet  convex='false' coordIndex='0 1 2 3'><Coordinate point='10 10 101 11 10 102 11 11 103 10 11 104 ' /></IndexedFaceSet>
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth1.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth1.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth1.testcase
diff --git a/test/sql_stmt_rtgeom_tests/st_azimuth10.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth10.testcase
new file mode 100644
index 0000000..1fbae7f
--- /dev/null
+++ b/test/sql_stmt_rtgeom_tests/st_azimuth10.testcase
@@ -0,0 +1,7 @@
+ST_Azimuth - text PointA (error)
+:memory: #use in-memory database
+SELECT ST_Azimuth('alpha', MakePoint(10, 10, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_Azimuth('alpha', MakePoint(10, 10, 4326))
+(NULL)
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth11.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth11.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth12.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth12.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth13.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth13.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth14.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth14.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth15.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth15.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth15.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth15.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth16.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth16.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth17.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth17.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth2.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth2.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth3.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth3.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth4.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth4.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth5.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth5.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth6.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth6.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth7.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth7.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth8.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth8.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_azimuth9.testcase b/test/sql_stmt_rtgeom_tests/st_azimuth9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_azimuth9.testcase
rename to test/sql_stmt_rtgeom_tests/st_azimuth9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash1.testcase b/test/sql_stmt_rtgeom_tests/st_geohash1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash1.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash10.testcase b/test/sql_stmt_rtgeom_tests/st_geohash10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash10.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash2.testcase b/test/sql_stmt_rtgeom_tests/st_geohash2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash2.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash3.testcase b/test/sql_stmt_rtgeom_tests/st_geohash3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash3.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash4.testcase b/test/sql_stmt_rtgeom_tests/st_geohash4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash4.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash5.testcase b/test/sql_stmt_rtgeom_tests/st_geohash5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash5.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash6.testcase b/test/sql_stmt_rtgeom_tests/st_geohash6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash6.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash7.testcase b/test/sql_stmt_rtgeom_tests/st_geohash7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash7.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash8.testcase b/test/sql_stmt_rtgeom_tests/st_geohash8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash8.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_geohash9.testcase b/test/sql_stmt_rtgeom_tests/st_geohash9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_geohash9.testcase
rename to test/sql_stmt_rtgeom_tests/st_geohash9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid1.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid1.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid2.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid2.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid3.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid3.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid4.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid4.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid5.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid5.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid6.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid6.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid7.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid7.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevalid8.testcase b/test/sql_stmt_rtgeom_tests/st_makevalid8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevalid8.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevalid8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded1.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded1.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded2.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded2.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded3.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded3.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded4.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded4.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded5.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded5.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded6.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded6.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded7.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded7.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_makevaliddiscarded8.testcase b/test/sql_stmt_rtgeom_tests/st_makevaliddiscarded8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_makevaliddiscarded8.testcase
rename to test/sql_stmt_rtgeom_tests/st_makevaliddiscarded8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node1.testcase b/test/sql_stmt_rtgeom_tests/st_node1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node1.testcase
rename to test/sql_stmt_rtgeom_tests/st_node1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node2.testcase b/test/sql_stmt_rtgeom_tests/st_node2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node2.testcase
rename to test/sql_stmt_rtgeom_tests/st_node2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node3.testcase b/test/sql_stmt_rtgeom_tests/st_node3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node3.testcase
rename to test/sql_stmt_rtgeom_tests/st_node3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node4.testcase b/test/sql_stmt_rtgeom_tests/st_node4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node4.testcase
rename to test/sql_stmt_rtgeom_tests/st_node4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node5.testcase b/test/sql_stmt_rtgeom_tests/st_node5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node5.testcase
rename to test/sql_stmt_rtgeom_tests/st_node5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node6.testcase b/test/sql_stmt_rtgeom_tests/st_node6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node6.testcase
rename to test/sql_stmt_rtgeom_tests/st_node6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node7.testcase b/test/sql_stmt_rtgeom_tests/st_node7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node7.testcase
rename to test/sql_stmt_rtgeom_tests/st_node7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node8.testcase b/test/sql_stmt_rtgeom_tests/st_node8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node8.testcase
rename to test/sql_stmt_rtgeom_tests/st_node8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_node9.testcase b/test/sql_stmt_rtgeom_tests/st_node9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_node9.testcase
rename to test/sql_stmt_rtgeom_tests/st_node9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project1.testcase b/test/sql_stmt_rtgeom_tests/st_project1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project1.testcase
rename to test/sql_stmt_rtgeom_tests/st_project1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project10.testcase b/test/sql_stmt_rtgeom_tests/st_project10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project10.testcase
rename to test/sql_stmt_rtgeom_tests/st_project10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project11.testcase b/test/sql_stmt_rtgeom_tests/st_project11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project11.testcase
rename to test/sql_stmt_rtgeom_tests/st_project11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project12.testcase b/test/sql_stmt_rtgeom_tests/st_project12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project12.testcase
rename to test/sql_stmt_rtgeom_tests/st_project12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project13.testcase b/test/sql_stmt_rtgeom_tests/st_project13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project13.testcase
rename to test/sql_stmt_rtgeom_tests/st_project13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project14.testcase b/test/sql_stmt_rtgeom_tests/st_project14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project14.testcase
rename to test/sql_stmt_rtgeom_tests/st_project14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project2.testcase b/test/sql_stmt_rtgeom_tests/st_project2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project2.testcase
rename to test/sql_stmt_rtgeom_tests/st_project2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project3.testcase b/test/sql_stmt_rtgeom_tests/st_project3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project3.testcase
rename to test/sql_stmt_rtgeom_tests/st_project3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project4.testcase b/test/sql_stmt_rtgeom_tests/st_project4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project4.testcase
rename to test/sql_stmt_rtgeom_tests/st_project4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project5.testcase b/test/sql_stmt_rtgeom_tests/st_project5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project5.testcase
rename to test/sql_stmt_rtgeom_tests/st_project5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project6.testcase b/test/sql_stmt_rtgeom_tests/st_project6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project6.testcase
rename to test/sql_stmt_rtgeom_tests/st_project6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project7.testcase b/test/sql_stmt_rtgeom_tests/st_project7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project7.testcase
rename to test/sql_stmt_rtgeom_tests/st_project7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project8.testcase b/test/sql_stmt_rtgeom_tests/st_project8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project8.testcase
rename to test/sql_stmt_rtgeom_tests/st_project8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_project9.testcase b/test/sql_stmt_rtgeom_tests/st_project9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_project9.testcase
rename to test/sql_stmt_rtgeom_tests/st_project9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize1.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize1.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize10.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize10.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize11.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize11.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize12.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize12.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize13.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize13.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize14.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize14.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize15.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize15.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize15.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize15.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize16.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize16.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize17.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize17.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize18.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize18.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize18.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize18.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize19.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize19.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize19.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize19.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize2.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize2.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize20.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize20.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize20.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize20.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize21.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize21.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize21.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize21.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize22.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize22.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize22.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize22.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize23.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize23.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize23.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize23.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize24.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize24.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize24.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize24.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize25.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize25.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize25.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize25.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize26.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize26.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize26.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize26.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize27.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize27.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize27.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize27.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize28.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize28.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize28.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize28.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize29.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize29.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize29.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize29.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize3.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize3.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize30.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize30.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize30.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize30.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize31.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize31.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize31.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize31.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize4.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize4.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize5.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize5.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize6.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize6.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize7.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize7.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize8.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize8.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_segmentize9.testcase b/test/sql_stmt_rtgeom_tests/st_segmentize9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_segmentize9.testcase
rename to test/sql_stmt_rtgeom_tests/st_segmentize9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self1.testcase b/test/sql_stmt_rtgeom_tests/st_self1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self1.testcase
rename to test/sql_stmt_rtgeom_tests/st_self1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self2.testcase b/test/sql_stmt_rtgeom_tests/st_self2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self2.testcase
rename to test/sql_stmt_rtgeom_tests/st_self2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self3.testcase b/test/sql_stmt_rtgeom_tests/st_self3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self3.testcase
rename to test/sql_stmt_rtgeom_tests/st_self3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self4.testcase b/test/sql_stmt_rtgeom_tests/st_self4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self4.testcase
rename to test/sql_stmt_rtgeom_tests/st_self4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self5.testcase b/test/sql_stmt_rtgeom_tests/st_self5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self5.testcase
rename to test/sql_stmt_rtgeom_tests/st_self5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self6.testcase b/test/sql_stmt_rtgeom_tests/st_self6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self6.testcase
rename to test/sql_stmt_rtgeom_tests/st_self6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self7.testcase b/test/sql_stmt_rtgeom_tests/st_self7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self7.testcase
rename to test/sql_stmt_rtgeom_tests/st_self7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self8.testcase b/test/sql_stmt_rtgeom_tests/st_self8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self8.testcase
rename to test/sql_stmt_rtgeom_tests/st_self8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_self9.testcase b/test/sql_stmt_rtgeom_tests/st_self9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_self9.testcase
rename to test/sql_stmt_rtgeom_tests/st_self9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid1.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid1.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid10.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid10.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid11.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid11.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid12.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid12.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid13.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid13.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid14.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid14.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid15.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid15.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid15.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid15.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid16.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid16.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid17.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid17.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid18.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid18.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid18.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid18.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid19.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid19.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid19.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid19.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid2.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid2.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid20.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid20.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid20.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid20.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid21.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid21.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid21.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid21.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid22.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid22.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid22.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid22.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid23.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid23.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid23.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid23.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid24.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid24.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid24.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid24.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid25.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid25.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid25.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid25.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid26.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid26.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid26.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid26.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid27.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid27.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid27.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid27.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid28.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid28.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid28.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid28.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid29.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid29.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid29.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid29.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid3.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid3.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid30.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid30.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid30.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid30.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid31.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid31.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid31.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid31.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid32.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid32.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid32.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid32.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid33.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid33.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid33.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid33.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid34.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid34.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid34.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid34.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid35.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid35.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid35.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid35.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid36.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid36.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid36.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid36.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid37.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid37.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid37.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid37.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid38.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid38.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid38.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid38.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid39.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid39.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid39.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid39.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid4.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid4.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid40.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid40.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid40.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid40.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid41.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid41.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid41.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid41.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid42.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid42.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid42.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid42.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid43.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid43.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid43.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid43.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid44.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid44.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid44.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid44.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid45.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid45.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid45.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid45.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid46.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid46.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid46.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid46.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid47.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid47.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid47.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid47.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid48.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid48.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid48.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid48.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid49.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid49.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid49.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid49.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid5.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid5.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid50.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid50.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid50.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid50.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid51.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid51.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid51.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid51.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid52.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid52.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid52.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid52.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid53.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid53.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid53.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid53.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid54.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid54.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid54.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid54.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid55.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid55.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid55.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid55.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid56.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid56.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid56.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid56.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid57.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid57.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid57.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid57.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid58.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid58.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid58.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid58.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid59.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid59.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid59.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid59.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid6.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid6.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid60.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid60.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid60.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid60.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid61.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid61.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid61.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid61.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid62.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid62.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid62.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid62.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid63.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid63.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid63.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid63.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid64.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid64.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid64.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid64.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid65.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid65.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid65.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid65.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid7.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid7.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid7.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid8.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid8.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_snaptogrid9.testcase b/test/sql_stmt_rtgeom_tests/st_snaptogrid9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_snaptogrid9.testcase
rename to test/sql_stmt_rtgeom_tests/st_snaptogrid9.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split1.testcase b/test/sql_stmt_rtgeom_tests/st_split1.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split1.testcase
rename to test/sql_stmt_rtgeom_tests/st_split1.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split10.testcase b/test/sql_stmt_rtgeom_tests/st_split10.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split10.testcase
rename to test/sql_stmt_rtgeom_tests/st_split10.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split11.testcase b/test/sql_stmt_rtgeom_tests/st_split11.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split11.testcase
rename to test/sql_stmt_rtgeom_tests/st_split11.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split12.testcase b/test/sql_stmt_rtgeom_tests/st_split12.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split12.testcase
rename to test/sql_stmt_rtgeom_tests/st_split12.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split13.testcase b/test/sql_stmt_rtgeom_tests/st_split13.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split13.testcase
rename to test/sql_stmt_rtgeom_tests/st_split13.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split14.testcase b/test/sql_stmt_rtgeom_tests/st_split14.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split14.testcase
rename to test/sql_stmt_rtgeom_tests/st_split14.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split15.testcase b/test/sql_stmt_rtgeom_tests/st_split15.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split15.testcase
rename to test/sql_stmt_rtgeom_tests/st_split15.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split16.testcase b/test/sql_stmt_rtgeom_tests/st_split16.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split16.testcase
rename to test/sql_stmt_rtgeom_tests/st_split16.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split17.testcase b/test/sql_stmt_rtgeom_tests/st_split17.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split17.testcase
rename to test/sql_stmt_rtgeom_tests/st_split17.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split18.testcase b/test/sql_stmt_rtgeom_tests/st_split18.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split18.testcase
rename to test/sql_stmt_rtgeom_tests/st_split18.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split19.testcase b/test/sql_stmt_rtgeom_tests/st_split19.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split19.testcase
rename to test/sql_stmt_rtgeom_tests/st_split19.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split2.testcase b/test/sql_stmt_rtgeom_tests/st_split2.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split2.testcase
rename to test/sql_stmt_rtgeom_tests/st_split2.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split20.testcase b/test/sql_stmt_rtgeom_tests/st_split20.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split20.testcase
rename to test/sql_stmt_rtgeom_tests/st_split20.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split21.testcase b/test/sql_stmt_rtgeom_tests/st_split21.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split21.testcase
rename to test/sql_stmt_rtgeom_tests/st_split21.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split22.testcase b/test/sql_stmt_rtgeom_tests/st_split22.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split22.testcase
rename to test/sql_stmt_rtgeom_tests/st_split22.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split23.testcase b/test/sql_stmt_rtgeom_tests/st_split23.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split23.testcase
rename to test/sql_stmt_rtgeom_tests/st_split23.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split24.testcase b/test/sql_stmt_rtgeom_tests/st_split24.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split24.testcase
rename to test/sql_stmt_rtgeom_tests/st_split24.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split25.testcase b/test/sql_stmt_rtgeom_tests/st_split25.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split25.testcase
rename to test/sql_stmt_rtgeom_tests/st_split25.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split26.testcase b/test/sql_stmt_rtgeom_tests/st_split26.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split26.testcase
rename to test/sql_stmt_rtgeom_tests/st_split26.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split27.testcase b/test/sql_stmt_rtgeom_tests/st_split27.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split27.testcase
rename to test/sql_stmt_rtgeom_tests/st_split27.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split28.testcase b/test/sql_stmt_rtgeom_tests/st_split28.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split28.testcase
rename to test/sql_stmt_rtgeom_tests/st_split28.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split29.testcase b/test/sql_stmt_rtgeom_tests/st_split29.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split29.testcase
rename to test/sql_stmt_rtgeom_tests/st_split29.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split3.testcase b/test/sql_stmt_rtgeom_tests/st_split3.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split3.testcase
rename to test/sql_stmt_rtgeom_tests/st_split3.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split30.testcase b/test/sql_stmt_rtgeom_tests/st_split30.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split30.testcase
rename to test/sql_stmt_rtgeom_tests/st_split30.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split31.testcase b/test/sql_stmt_rtgeom_tests/st_split31.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split31.testcase
rename to test/sql_stmt_rtgeom_tests/st_split31.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split32.testcase b/test/sql_stmt_rtgeom_tests/st_split32.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split32.testcase
rename to test/sql_stmt_rtgeom_tests/st_split32.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split33.testcase b/test/sql_stmt_rtgeom_tests/st_split33.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split33.testcase
rename to test/sql_stmt_rtgeom_tests/st_split33.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split34.testcase b/test/sql_stmt_rtgeom_tests/st_split34.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split34.testcase
rename to test/sql_stmt_rtgeom_tests/st_split34.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split35.testcase b/test/sql_stmt_rtgeom_tests/st_split35.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split35.testcase
rename to test/sql_stmt_rtgeom_tests/st_split35.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split36.testcase b/test/sql_stmt_rtgeom_tests/st_split36.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split36.testcase
rename to test/sql_stmt_rtgeom_tests/st_split36.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split37.testcase b/test/sql_stmt_rtgeom_tests/st_split37.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split37.testcase
rename to test/sql_stmt_rtgeom_tests/st_split37.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split38.testcase b/test/sql_stmt_rtgeom_tests/st_split38.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split38.testcase
rename to test/sql_stmt_rtgeom_tests/st_split38.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split39.testcase b/test/sql_stmt_rtgeom_tests/st_split39.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split39.testcase
rename to test/sql_stmt_rtgeom_tests/st_split39.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split4.testcase b/test/sql_stmt_rtgeom_tests/st_split4.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split4.testcase
rename to test/sql_stmt_rtgeom_tests/st_split4.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split40.testcase b/test/sql_stmt_rtgeom_tests/st_split40.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split40.testcase
rename to test/sql_stmt_rtgeom_tests/st_split40.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split41.testcase b/test/sql_stmt_rtgeom_tests/st_split41.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split41.testcase
rename to test/sql_stmt_rtgeom_tests/st_split41.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split42.testcase b/test/sql_stmt_rtgeom_tests/st_split42.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split42.testcase
rename to test/sql_stmt_rtgeom_tests/st_split42.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split43.testcase b/test/sql_stmt_rtgeom_tests/st_split43.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split43.testcase
rename to test/sql_stmt_rtgeom_tests/st_split43.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split44.testcase b/test/sql_stmt_rtgeom_tests/st_split44.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split44.testcase
rename to test/sql_stmt_rtgeom_tests/st_split44.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split45.testcase b/test/sql_stmt_rtgeom_tests/st_split45.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split45.testcase
rename to test/sql_stmt_rtgeom_tests/st_split45.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split46.testcase b/test/sql_stmt_rtgeom_tests/st_split46.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split46.testcase
rename to test/sql_stmt_rtgeom_tests/st_split46.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split47.testcase b/test/sql_stmt_rtgeom_tests/st_split47.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split47.testcase
rename to test/sql_stmt_rtgeom_tests/st_split47.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split48.testcase b/test/sql_stmt_rtgeom_tests/st_split48.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split48.testcase
rename to test/sql_stmt_rtgeom_tests/st_split48.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split49.testcase b/test/sql_stmt_rtgeom_tests/st_split49.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split49.testcase
rename to test/sql_stmt_rtgeom_tests/st_split49.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split5.testcase b/test/sql_stmt_rtgeom_tests/st_split5.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split5.testcase
rename to test/sql_stmt_rtgeom_tests/st_split5.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split6.testcase b/test/sql_stmt_rtgeom_tests/st_split6.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split6.testcase
rename to test/sql_stmt_rtgeom_tests/st_split6.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split7.testcase b/test/sql_stmt_rtgeom_tests/st_split7.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split7.testcase
rename to test/sql_stmt_rtgeom_tests/st_split7.testcase
diff --git a/test/sql_stmt_lwgeom_22_tests/st_split8.testcase b/test/sql_stmt_rtgeom_tests/st_split8.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_22_tests/st_split8.testcase
rename to test/sql_stmt_rtgeom_tests/st_split8.testcase
diff --git a/test/sql_stmt_lwgeom_tests/st_split9.testcase b/test/sql_stmt_rtgeom_tests/st_split9.testcase
similarity index 100%
rename from test/sql_stmt_lwgeom_tests/st_split9.testcase
rename to test/sql_stmt_rtgeom_tests/st_split9.testcase
diff --git a/test/sql_stmt_rttopo_tests/Makefile.am b/test/sql_stmt_rttopo_tests/Makefile.am
new file mode 100644
index 0000000..f49eb07
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/Makefile.am
@@ -0,0 +1,1019 @@
+
+EXTRA_DIST = addedgemodface1.testcase \
+	addedgemodface2.testcase \
+	addedgemodface3.testcase \
+	addedgemodface4.testcase \
+	addedgemodface5.testcase \
+	addedgemodface6.testcase \
+	addedgemodface7.testcase \
+	addedgemodface8.testcase \
+	addedgemodface9.testcase \
+	addedgemodface10.testcase \
+	addedgemodface11.testcase \
+	addedgemodface12.testcase \
+	addedgemodface13.testcase \
+	addedgemodface14.testcase \
+	addedgemodface15.testcase \
+	addedgemodface16.testcase \
+	addedgemodface17.testcase \
+	addedgemodface18.testcase \
+	addedgemodface19.testcase \
+	addedgemodface20.testcase \
+	addedgenewfaces1.testcase \
+	addedgenewfaces2.testcase \
+	addedgenewfaces3.testcase \
+	addedgenewfaces4.testcase \
+	addedgenewfaces5.testcase \
+	addedgenewfaces6.testcase \
+	addedgenewfaces7.testcase \
+	addedgenewfaces8.testcase \
+	addedgenewfaces9.testcase \
+	addedgenewfaces10.testcase \
+	addedgenewfaces11.testcase \
+	addedgenewfaces12.testcase \
+	addedgenewfaces13.testcase \
+	addedgenewfaces14.testcase \
+	addedgenewfaces15.testcase \
+	addedgenewfaces16.testcase \
+	addedgenewfaces17.testcase \
+	addedgenewfaces18.testcase \
+	addedgenewfaces19.testcase \
+	addedgenewfaces20.testcase \
+	addisoedge1.testcase \
+	addisoedge2.testcase \
+	addisoedge3.testcase \
+	addisoedge4.testcase \
+	addisoedge5.testcase \
+	addisoedge6.testcase \
+	addisoedge7.testcase \
+	addisoedge8.testcase \
+	addisoedge9.testcase \
+	addisoedge10.testcase \
+	addisoedge11.testcase \
+	addisoedge12.testcase \
+	addisoedge13.testcase \
+	addisoedge14.testcase \
+	addisoedge15.testcase \
+	addisoedge16.testcase \
+	addisoedge17.testcase \
+	addisoedge18.testcase \
+	addisoedge19.testcase \
+	addisoedge20.testcase \
+	addisonetnode1.testcase \
+	addisonetnode2.testcase \
+	addisonetnode3.testcase \
+	addisonetnode4.testcase \
+	addisonetnode5.testcase \
+	addisonode1.testcase \
+	addisonode2.testcase \
+	addisonode3.testcase \
+	addisonode4.testcase \
+	addisonode5.testcase \
+	addisonode6.testcase \
+	addisonode7.testcase \
+	addisonode8.testcase \
+	addisonode9.testcase \
+	addisonode10.testcase \
+	addisonode11.testcase \
+	addisonode12.testcase \
+	addisonode13.testcase \
+	addisonode14.testcase \
+	addisonode15.testcase \
+	addisonode16.testcase \
+	addisonode17.testcase \
+	addisonode1.testcase \
+	addisonode2.testcase \
+	addisonode3.testcase \
+	addisonode4.testcase \
+	addisonode5.testcase \
+	addisonode6.testcase \
+	addisonode7.testcase \
+	addisonode8.testcase \
+	addisonode9.testcase \
+	addisonode10.testcase \
+	addisonode11.testcase \
+	addisonode12.testcase \
+	addisonode13.testcase \
+	addisonode14.testcase \
+	addisonode15.testcase \
+	addisonode16.testcase \
+	addisonode17.testcase \
+	addlink1.testcase \
+	addlink2.testcase \
+	addlink3.testcase \
+	addlink4.testcase \
+	addlink5.testcase \
+	addlink6.testcase \
+	addlink7.testcase \
+	addlink8.testcase \
+	addlink9.testcase \
+	addlink10.testcase \
+	addlink11.testcase \
+	addlink12.testcase \
+	addlink13.testcase \
+	changeedgegeom1.testcase \
+	changeedgegeom2.testcase \
+	changeedgegeom3.testcase \
+	changeedgegeom4.testcase \
+	changeedgegeom5.testcase \
+	changeedgegeom6.testcase \
+	changeedgegeom7.testcase \
+	changeedgegeom8.testcase \
+	changeedgegeom9.testcase \
+	changeedgegeom10.testcase \
+	changeedgegeom11.testcase \
+	changeedgegeom12.testcase \
+	changeedgegeom13.testcase \
+	changeedgegeom14.testcase \
+	changeedgegeom15.testcase \
+	changeedgegeom16.testcase \
+	changeedgegeom17.testcase \
+	changelinkgeom1.testcase \
+	changelinkgeom2.testcase \
+	changelinkgeom3.testcase \
+	changelinkgeom4.testcase \
+	changelinkgeom5.testcase \
+	changelinkgeom6.testcase \
+	changelinkgeom7.testcase \
+	changelinkgeom8.testcase \
+	createtopogeo1.testcase \
+	createtopogeo2.testcase \
+	createtopogeo3.testcase \
+	createtopogeo4.testcase \
+	createtopogeo5.testcase \
+	createtopogeo6.testcase \
+	createtopogeo7.testcase \
+	createtopogeo8.testcase \
+	createtopogeo9.testcase \
+	createtopogeo10.testcase \
+	createtopolayer1.testcase \
+	createtopolayer2.testcase \
+	createtopolayer3.testcase \
+	createtopolayer4.testcase \
+	createtopolayer5.testcase \
+	createtopolayer6.testcase \
+	createtopolayer7.testcase \
+	createtopolayer8.testcase \
+	createtopolayer9.testcase \
+	createtopolayer10.testcase \
+	createtopolayer11.testcase \
+	createtopolayer12.testcase \
+	createtopolayer13.testcase \
+	createtopolayer14.testcase \
+	createtopolayer15.testcase \
+	createtopolayer16.testcase \
+	createtopolayer17.testcase \
+	createtopolayer18.testcase \
+	createtopolayer19.testcase \
+	createtopolayer20.testcase \
+	createtopolayer21.testcase \
+	createtopolayer22.testcase \
+	createtopolayer23.testcase \
+	createtopolayer24.testcase \
+	createtopolayer25.testcase \
+	createtopolayer26.testcase \
+	createtopology1.testcase \
+	createtopology2.testcase \
+	createtopology3.testcase \
+	createtopology4.testcase \
+	createtopology5.testcase \
+	createtopology6.testcase \
+	createtopology7.testcase \
+	createtopology8.testcase \
+	createtopology9.testcase \
+	createtopology10.testcase \
+	createtopology11.testcase \
+	createtopology12.testcase \
+	createtopology13.testcase \
+	createtopology14.testcase \
+	createtopology15.testcase \
+	createtopology16.testcase \
+	createtopology17.testcase \
+	createtopology18.testcase \
+	createtopology19.testcase \
+	createtopology20.testcase \
+	createnetwork1.testcase \
+	createnetwork2.testcase \
+	createnetwork3.testcase \
+	createnetwork4.testcase \
+	createnetwork5.testcase \
+	createnetwork6.testcase \
+	createnetwork7.testcase \
+	createnetwork8.testcase \
+	createnetwork9.testcase \
+	createnetwork10.testcase \
+	createnetwork11.testcase \
+	createnetwork12.testcase \
+	createnetwork13.testcase \
+	createnetwork14.testcase \
+	createnetwork15.testcase \
+	createnetwork16.testcase \
+	createnetwork17.testcase \
+	createnetwork18.testcase \
+	createnetwork19.testcase \
+	createnetwork20.testcase \
+	createnetwork21.testcase \
+	createnetwork22.testcase \
+	createnetwork23.testcase \
+	createnetwork24.testcase \
+	createnetwork25.testcase \
+	droptopology1.testcase \
+	droptopology2.testcase \
+	droptopology3.testcase \
+	droptopology4.testcase \
+	droptopology5.testcase \
+	dropnetwork1.testcase \
+	dropnetwork2.testcase \
+	dropnetwork3.testcase \
+	dropnetwork4.testcase \
+	dropnetwork5.testcase \
+	exporttopolayer1.testcase \
+	exporttopolayer2.testcase \
+	exporttopolayer3.testcase \
+	exporttopolayer4.testcase \
+	exporttopolayer5.testcase \
+	exporttopolayer6.testcase \
+	exporttopolayer7.testcase \
+	exporttopolayer8.testcase \
+	exporttopolayer9.testcase \
+	exporttopolayer10.testcase \
+	exporttopolayer11.testcase \
+	exporttopolayer12.testcase \
+	exporttopolayer13.testcase \
+	exporttopolayer14.testcase \
+	exporttopolayer15.testcase \
+	exporttopolayer16.testcase \
+	exporttopolayer17.testcase \
+	exporttopolayer18.testcase \
+	exporttopolayer19.testcase \
+	exporttopolayer20.testcase \
+	exporttopolayer21.testcase \
+	exporttopolayer22.testcase \
+	exporttopolayer23.testcase \
+	featuretopolayer1.testcase \
+	featuretopolayer2.testcase \
+	featuretopolayer3.testcase \
+	featuretopolayer4.testcase \
+	featuretopolayer5.testcase \
+	featuretopolayer6.testcase \
+	featuretopolayer7.testcase \
+	featuretopolayer8.testcase \
+	featuretopolayer9.testcase \
+	featuretopolayer10.testcase \
+	featuretopolayer11.testcase \
+	featuretopolayer12.testcase \
+	featuretopolayer13.testcase \
+	featuretopolayer14.testcase \
+	featuretopolayer15.testcase \
+	featuretopolayer16.testcase \
+	featuretopolayer17.testcase \
+	getedgeseed1.testcase \
+	getedgeseed2.testcase \
+	getedgeseed3.testcase \
+	getedgeseed4.testcase \
+	getedgeseed5.testcase \
+	getedgeseed6.testcase \
+	getedgeseed7.testcase \
+	getedgeseed8.testcase \
+	getedgeseed9.testcase \
+	getlinkseed1.testcase \
+	getlinkseed2.testcase \
+	getlinkseed3.testcase \
+	getlinkseed4.testcase \
+	getlinkseed5.testcase \
+	getlinkseed6.testcase \
+	getlinkseed7.testcase \
+	getlinkseed8.testcase \
+	getlinkseed9.testcase \
+	getfaceedges1.testcase \
+	getfaceedges2.testcase \
+	getfaceedges3.testcase \
+	getfaceedges4.testcase \
+	getfaceedges5.testcase \
+	getfaceedges6.testcase \
+	getfaceedges7.testcase \
+	getfaceedges8.testcase \
+	getfaceedges9.testcase \
+	getfacegeometry1.testcase \
+	getfacegeometry2.testcase \
+	getfacegeometry3.testcase \
+	getfacegeometry4.testcase \
+	getfacegeometry5.testcase \
+	getfacegeometry6.testcase \
+	getfacegeometry7.testcase \
+	getfacegeometry8.testcase \
+	getfacegeometry9.testcase \
+	getedgebypoint1.testcase \
+	getedgebypoint2.testcase \
+	getedgebypoint3.testcase \
+	getedgebypoint4.testcase \
+	getedgebypoint5.testcase \
+	getedgebypoint6.testcase \
+	getedgebypoint7.testcase \
+	getedgebypoint8.testcase \
+	getedgebypoint9.testcase \
+	getedgebypoint10.testcase \
+	getedgebypoint11.testcase \
+	getedgebypoint12.testcase \
+	getedgebypoint13.testcase \
+	getedgebypoint14.testcase \
+	getedgebypoint15.testcase \
+	getedgebypoint16.testcase \
+	getedgebypoint17.testcase \
+	getfacegeometry1.testcase \
+	getfacegeometry2.testcase \
+	getfacegeometry3.testcase \
+	getfacegeometry4.testcase \
+	getfacegeometry5.testcase \
+	getfacegeometry6.testcase \
+	getfacegeometry7.testcase \
+	getfacegeometry8.testcase \
+	getfacegeometry9.testcase \
+	getfacebypoint1.testcase \
+	getfacebypoint2.testcase \
+	getfacebypoint3.testcase \
+	getfacebypoint4.testcase \
+	getfacebypoint5.testcase \
+	getfacebypoint6.testcase \
+	getfacebypoint7.testcase \
+	getfacebypoint8.testcase \
+	getfacebypoint9.testcase \
+	getfacebypoint10.testcase \
+	getfacebypoint11.testcase \
+	getfacebypoint12.testcase \
+	getfacebypoint13.testcase \
+	getfacebypoint14.testcase \
+	getfacebypoint15.testcase \
+	getfacebypoint16.testcase \
+	getfacebypoint17.testcase \
+	getfaceseed1.testcase \
+	getfaceseed2.testcase \
+	getfaceseed3.testcase \
+	getfaceseed4.testcase \
+	getfaceseed5.testcase \
+	getfaceseed6.testcase \
+	getfaceseed7.testcase \
+	getfaceseed8.testcase \
+	getfaceseed9.testcase \
+	getlinkbypoint1.testcase \
+	getlinkbypoint2.testcase \
+	getlinkbypoint3.testcase \
+	getlinkbypoint4.testcase \
+	getlinkbypoint5.testcase \
+	getlinkbypoint6.testcase \
+	getlinkbypoint7.testcase \
+	getlinkbypoint8.testcase \
+	getlinkbypoint9.testcase \
+	getlinkbypoint10.testcase \
+	getlinkbypoint11.testcase \
+	getlinkbypoint12.testcase \
+	getlinkbypoint13.testcase \
+	getlinkbypoint14.testcase \
+	getlinkbypoint15.testcase \
+	getlinkbypoint16.testcase \
+	getlinkbypoint17.testcase \
+	getnetnodebypoint1.testcase \
+	getnetnodebypoint2.testcase \
+	getnetnodebypoint3.testcase \
+	getnetnodebypoint4.testcase \
+	getnetnodebypoint5.testcase \
+	getnetnodebypoint6.testcase \
+	getnetnodebypoint7.testcase \
+	getnetnodebypoint8.testcase \
+	getnetnodebypoint9.testcase \
+	getnetnodebypoint10.testcase \
+	getnetnodebypoint11.testcase \
+	getnetnodebypoint12.testcase \
+	getnetnodebypoint13.testcase \
+	getnetnodebypoint14.testcase \
+	getnetnodebypoint15.testcase \
+	getnetnodebypoint16.testcase \
+	getnetnodebypoint17.testcase \
+	getnodebypoint1.testcase \
+	getnodebypoint2.testcase \
+	getnodebypoint3.testcase \
+	getnodebypoint4.testcase \
+	getnodebypoint5.testcase \
+	getnodebypoint6.testcase \
+	getnodebypoint7.testcase \
+	getnodebypoint8.testcase \
+	getnodebypoint9.testcase \
+	getnodebypoint10.testcase \
+	getnodebypoint11.testcase \
+	getnodebypoint12.testcase \
+	getnodebypoint13.testcase \
+	getnodebypoint14.testcase \
+	getnodebypoint15.testcase \
+	getnodebypoint16.testcase \
+	getnodebypoint17.testcase \
+	inittopolayer1.testcase \
+	inittopolayer2.testcase \
+	inittopolayer3.testcase \
+	inittopolayer4.testcase \
+	inittopolayer5.testcase \
+	inittopolayer6.testcase \
+	inittopolayer7.testcase \
+	inittopolayer8.testcase \
+	inittopolayer9.testcase \
+	inittopolayer10.testcase \
+	inittopolayer11.testcase \
+	inittopolayer12.testcase \
+	inittopolayer13.testcase \
+	inittopolayer14.testcase \
+	inittopolayer15.testcase \
+	inittopolayer16.testcase \
+	inittopolayer17.testcase \
+	linesnapseed1.testcase \
+	linesnapseed2.testcase \
+	linesnapseed3.testcase \
+	linesnapseed4.testcase \
+	linesnapseed5.testcase \
+	linesnapseed6.testcase \
+	linesnapseed7.testcase \
+	linesnapseed8.testcase \
+	linesnapseed9.testcase \
+	linesnapseed10.testcase \
+	linesnapseed11.testcase \
+	linesnapseed12.testcase \
+	linesnapseed13.testcase \
+	linesnapseed14.testcase \
+	linesnapseed15.testcase \
+	linesnapseed16.testcase \
+	linesnapseed17.testcase \
+	loginetfromtgeo1.testcase \
+	loginetfromtgeo2.testcase \
+	loginetfromtgeo3.testcase \
+	loginetfromtgeo4.testcase \
+	loginetfromtgeo5.testcase \
+	loginetfromtgeo6.testcase \
+	loginetfromtgeo7.testcase \
+	loginetfromtgeo8.testcase \
+	loginetfromtgeo9.testcase \
+	modedgeheal1.testcase \
+	modedgeheal2.testcase \
+	modedgeheal3.testcase \
+	modedgeheal4.testcase \
+	modedgeheal5.testcase \
+	modedgeheal6.testcase \
+	modedgeheal7.testcase \
+	modedgeheal8.testcase \
+	modedgeheal9.testcase \
+	modedgeheal10.testcase \
+	modedgeheal11.testcase \
+	modedgeheal12.testcase \
+	modedgeheal13.testcase \
+	modedgesplit1.testcase \
+	modedgesplit2.testcase \
+	modedgesplit3.testcase \
+	modedgesplit4.testcase \
+	modedgesplit5.testcase \
+	modedgesplit6.testcase \
+	modedgesplit7.testcase \
+	modedgesplit8.testcase \
+	modedgesplit9.testcase \
+	modedgesplit10.testcase \
+	modedgesplit11.testcase \
+	modedgesplit12.testcase \
+	modedgesplit13.testcase \
+	modedgesplit14.testcase \
+	modedgesplit15.testcase \
+	modedgesplit16.testcase \
+	modgeolinksplit1.testcase \
+	modgeolinksplit2.testcase \
+	modgeolinksplit3.testcase \
+	modgeolinksplit4.testcase \
+	modgeolinksplit5.testcase \
+	modgeolinksplit6.testcase \
+	modgeolinksplit7.testcase \
+	modgeolinksplit8.testcase \
+	modgeolinksplit9.testcase \
+	modlinkheal1.testcase \
+	modlinkheal2.testcase \
+	modlinkheal3.testcase \
+	modlinkheal4.testcase \
+	modlinkheal5.testcase \
+	modlinkheal6.testcase \
+	modlinkheal7.testcase \
+	modlinkheal8.testcase \
+	modlinkheal9.testcase \
+	modlinkheal10.testcase \
+	modlinkheal11.testcase \
+	modlinkheal12.testcase \
+	modlinkheal13.testcase \
+	modloglinksplit1.testcase \
+	modloglinksplit2.testcase \
+	modloglinksplit3.testcase \
+	modloglinksplit4.testcase \
+	modloglinksplit5.testcase \
+	modloglinksplit6.testcase \
+	modloglinksplit7.testcase \
+	modloglinksplit8.testcase \
+	modloglinksplit9.testcase \
+	moveisonetnode1.testcase \
+	moveisonetnode2.testcase \
+	moveisonetnode3.testcase \
+	moveisonetnode4.testcase \
+	moveisonetnode5.testcase \
+	moveisonetnode6.testcase \
+	moveisonetnode7.testcase \
+	moveisonetnode8.testcase \
+	moveisonetnode9.testcase \
+	moveisonode1.testcase \
+	moveisonode2.testcase \
+	moveisonode3.testcase \
+	moveisonode4.testcase \
+	moveisonode5.testcase \
+	moveisonode6.testcase \
+	moveisonode7.testcase \
+	moveisonode8.testcase \
+	moveisonode9.testcase \
+	moveisonode10.testcase \
+	moveisonode11.testcase \
+	moveisonode12.testcase \
+	moveisonode13.testcase \
+	moveisonode14.testcase \
+	moveisonode15.testcase \
+	moveisonode16.testcase \
+	moveisonode17.testcase \
+	netexception1.testcase \
+	netexception2.testcase \
+	newedgeheal1.testcase \
+	newedgeheal2.testcase \
+	newedgeheal3.testcase \
+	newedgeheal4.testcase \
+	newedgeheal5.testcase \
+	newedgeheal6.testcase \
+	newedgeheal7.testcase \
+	newedgeheal8.testcase \
+	newedgeheal9.testcase \
+	newedgeheal10.testcase \
+	newedgeheal11.testcase \
+	newedgeheal12.testcase \
+	newedgeheal13.testcase \
+	newedgessplit1.testcase \
+	newedgessplit2.testcase \
+	newedgessplit3.testcase \
+	newedgessplit4.testcase \
+	newedgessplit5.testcase \
+	newedgessplit6.testcase \
+	newedgessplit7.testcase \
+	newedgessplit8.testcase \
+	newedgessplit9.testcase \
+	newedgessplit10.testcase \
+	newedgessplit11.testcase \
+	newedgessplit12.testcase \
+	newedgessplit13.testcase \
+	newedgessplit14.testcase \
+	newedgessplit15.testcase \
+	newedgessplit16.testcase \
+	newgeolinksplit1.testcase \
+	newgeolinksplit2.testcase \
+	newgeolinksplit3.testcase \
+	newgeolinksplit4.testcase \
+	newgeolinksplit5.testcase \
+	newgeolinksplit6.testcase \
+	newgeolinksplit7.testcase \
+	newgeolinksplit8.testcase \
+	newgeolinksplit9.testcase \
+	newlinkheal1.testcase \
+	newlinkheal2.testcase \
+	newlinkheal3.testcase \
+	newlinkheal4.testcase \
+	newlinkheal5.testcase \
+	newlinkheal6.testcase \
+	newlinkheal7.testcase \
+	newlinkheal8.testcase \
+	newlinkheal9.testcase \
+	newlinkheal10.testcase \
+	newlinkheal11.testcase \
+	newlinkheal12.testcase \
+	newlinkheal13.testcase \
+	newloglinksplit1.testcase \
+	newloglinksplit2.testcase \
+	newloglinksplit3.testcase \
+	newloglinksplit4.testcase \
+	newloglinksplit5.testcase \
+	newloglinksplit6.testcase \
+	newloglinksplit7.testcase \
+	newloglinksplit8.testcase \
+	newloglinksplit9.testcase \
+	pointsnapseed1.testcase \
+	pointsnapseed2.testcase \
+	pointsnapseed3.testcase \
+	pointsnapseed4.testcase \
+	pointsnapseed5.testcase \
+	pointsnapseed6.testcase \
+	pointsnapseed7.testcase \
+	pointsnapseed8.testcase \
+	pointsnapseed9.testcase \
+	pointsnapseed10.testcase \
+	pointsnapseed11.testcase \
+	pointsnapseed12.testcase \
+	pointsnapseed13.testcase \
+	pointsnapseed14.testcase \
+	pointsnapseed15.testcase \
+	pointsnapseed16.testcase \
+	pointsnapseed17.testcase \
+	remedgemodface1.testcase \
+	remedgemodface2.testcase \
+	remedgemodface3.testcase \
+	remedgemodface4.testcase \
+	remedgemodface5.testcase \
+	remedgemodface6.testcase \
+	remedgemodface7.testcase \
+	remedgemodface8.testcase \
+	remedgemodface9.testcase \
+	remedgenewface1.testcase \
+	remedgenewface2.testcase \
+	remedgenewface3.testcase \
+	remedgenewface4.testcase \
+	remedgenewface5.testcase \
+	remedgenewface6.testcase \
+	remedgenewface7.testcase \
+	remedgenewface8.testcase \
+	remedgenewface9.testcase \
+	remisoedge1.testcase \
+	remisoedge2.testcase \
+	remisoedge3.testcase \
+	remisoedge4.testcase \
+	remisoedge5.testcase \
+	remisoedge6.testcase \
+	remisoedge7.testcase \
+	remisoedge8.testcase \
+	remisoedge9.testcase \
+	remisonode1.testcase \
+	remisonode2.testcase \
+	remisonode3.testcase \
+	remisonode4.testcase \
+	remisonode5.testcase \
+	remisonode6.testcase \
+	remisonode7.testcase \
+	remisonode8.testcase \
+	remisonode9.testcase \
+	remisonetnode1.testcase \
+	remisonetnode2.testcase \
+	remisonetnode3.testcase \
+	remisonetnode4.testcase \
+	remisonetnode5.testcase \
+	remisonetnode6.testcase \
+	remisonetnode7.testcase \
+	remisonetnode8.testcase \
+	remisonetnode9.testcase \
+	remlink1.testcase \
+	remlink2.testcase \
+	remlink3.testcase \
+	remlink4.testcase \
+	remlink5.testcase \
+	remlink6.testcase \
+	remlink7.testcase \
+	remlink8.testcase \
+	remlink9.testcase \
+	removetopolayer1.testcase \
+	removetopolayer2.testcase \
+	removetopolayer3.testcase \
+	removetopolayer4.testcase \
+	removetopolayer5.testcase \
+	removetopolayer6.testcase \
+	removetopolayer7.testcase \
+	removetopolayer8.testcase \
+	removetopolayer9.testcase \
+	spatnetfromtgeo1.testcase \
+	spatnetfromtgeo2.testcase \
+	spatnetfromtgeo3.testcase \
+	spatnetfromtgeo4.testcase \
+	spatnetfromtgeo5.testcase \
+	spatnetfromtgeo6.testcase \
+	spatnetfromtgeo7.testcase \
+	spatnetfromtgeo8.testcase \
+	spatnetfromtgeo9.testcase \
+	spatnetfromgeom1.testcase \
+	spatnetfromgeom2.testcase \
+	spatnetfromgeom3.testcase \
+	spatnetfromgeom4.testcase \
+	spatnetfromgeom5.testcase \
+	spatnetfromgeom6.testcase \
+	spatnetfromgeom7.testcase \
+	spatnetfromgeom8.testcase \
+	spatnetfromgeom9.testcase \
+	spatnetfromgeom10.testcase \
+	topoexception1.testcase \
+	topoexception2.testcase \
+	topogeoaddpoint1.testcase \
+	topogeoaddpoint2.testcase \
+	topogeoaddpoint3.testcase \
+	topogeoaddpoint4.testcase \
+	topogeoaddpoint5.testcase \
+	topogeoaddpoint6.testcase \
+	topogeoaddpoint7.testcase \
+	topogeoaddpoint8.testcase \
+	topogeoaddpoint9.testcase \
+	topogeoaddpoint10.testcase \
+	topogeoaddpoint11.testcase \
+	topogeoaddpoint12.testcase \
+	topogeoaddpoint13.testcase \
+	topogeoaddpoint14.testcase \
+	topogeoaddpoint15.testcase \
+	topogeoaddpoint16.testcase \
+	topogeoaddpoint17.testcase \
+	topogeoaddline1.testcase \
+	topogeoaddline2.testcase \
+	topogeoaddline3.testcase \
+	topogeoaddline4.testcase \
+	topogeoaddline5.testcase \
+	topogeoaddline6.testcase \
+	topogeoaddline7.testcase \
+	topogeoaddline8.testcase \
+	topogeoaddline9.testcase \
+	topogeoaddline10.testcase \
+	topogeoaddline11.testcase \
+	topogeoaddline12.testcase \
+	topogeoaddline13.testcase \
+	topogeoaddline14.testcase \
+	topogeoaddline15.testcase \
+	topogeoaddline16.testcase \
+	topogeoaddline17.testcase \
+	topogeoclone1.testcase \
+	topogeoclone2.testcase \
+	topogeoclone3.testcase \
+	topogeoclone4.testcase \
+	topogeoclone5.testcase \
+	topogeoclone6.testcase \
+	topogeoclone7.testcase \
+	topogeoclone8.testcase \
+	topogeoclone9.testcase \
+	topogeoclone10.testcase \
+	topogeoclone11.testcase \
+	topogeoclone12.testcase \
+	topogeofromext1.testcase \
+	topogeofromext2.testcase \
+	topogeofromext3.testcase \
+	topogeofromext4.testcase \
+	topogeofromext5.testcase \
+	topogeofromext6.testcase \
+	topogeofromext7.testcase \
+	topogeofromext8.testcase \
+	topogeofromext9.testcase \
+	topogeofromext10.testcase \
+	topogeofromext11.testcase \
+	topogeofromext12.testcase \
+	topogeofromext13.testcase \
+	topogeofromext14.testcase \
+	topogeofromext15.testcase \
+	topogeofromext16.testcase \
+	topogeofromext17.testcase \
+	topogeofromext18.testcase \
+	topogeofromext19.testcase \
+	topogeofromext20.testcase \
+	topogeofromext21.testcase \
+	topogeofromext22.testcase \
+	topogeofromext23.testcase \
+	topogeofromext24.testcase \
+	topogeofromext25.testcase \
+	topogeofromext26.testcase \
+	topogeofromext27.testcase \
+	topogeofromext28.testcase \
+	topogeofromext29.testcase \
+	topogeofromext30.testcase \
+	topogeofromext31.testcase \
+	topogeofromext32.testcase \
+	topogeofromext33.testcase \
+	topogeofromext34.testcase \
+	topogeofromext35.testcase \
+	topogeofromext36.testcase \
+	topogeofromext37.testcase \
+	topogeofromext38.testcase \
+	topogeofromext39.testcase \
+	topogeofromtable1.testcase \
+	topogeofromtable2.testcase \
+	topogeofromtable3.testcase \
+	topogeofromtable4.testcase \
+	topogeofromtable5.testcase \
+	topogeofromtable6.testcase \
+	topogeofromtable7.testcase \
+	topogeofromtable8.testcase \
+	topogeofromtable9.testcase \
+	topogeofromtable10.testcase \
+	topogeofromtable11.testcase \
+	topogeofromtable12.testcase \
+	topogeofromtable13.testcase \
+	topogeofromtable14.testcase \
+	topogeofromtable15.testcase \
+	topogeofromtable16.testcase \
+	topogeofromtable17.testcase \
+	topogeofromtable18.testcase \
+	topogeofromtable19.testcase \
+	topogeofromtable20.testcase \
+	topogeofromtable21.testcase \
+	topogeofromtable22.testcase \
+	topogeofromtable23.testcase \
+	topogeofromtable24.testcase \
+	topogeofromtable25.testcase \
+	topogeofromtable26.testcase \
+	topogeofromtable27.testcase \
+	topogeofromtable28.testcase \
+	topogeofromtable29.testcase \
+	topogeofromtable30.testcase \
+	topogeosplitline1.testcase \
+	topogeosplitline2.testcase \
+	topogeosplitline3.testcase \
+	topogeosplitline4.testcase \
+	topogeosplitline5.testcase \
+	topogeosplitline6.testcase \
+	topogeosplitline7.testcase \
+	topogeosplitline8.testcase \
+	topogeosplitline9.testcase \
+	topogeosplitline10.testcase \
+	topogeosplitline11.testcase \
+	topogeosplitline12.testcase \
+	topogeosplitline13.testcase \
+	topogeosplitline14.testcase \
+	topogeosplitline15.testcase \
+	topogeosplitline16.testcase \
+	topogeoremovesmall1.testcase \
+	topogeoremovesmall2.testcase \
+	topogeoremovesmall3.testcase \
+	topogeoremovesmall4.testcase \
+	topogeoremovesmall5.testcase \
+	topogeoremovesmall6.testcase \
+	topogeoremovesmall7.testcase \
+	topogeoremovesmall8.testcase \
+	topogeoremovesmall9.testcase \
+	topogeoremoveedges1.testcase \
+	topogeoremoveedges2.testcase \
+	topogeoremoveedges3.testcase \
+	topogeoremoveedges4.testcase \
+	topogeoremoveedges5.testcase \
+	topogeoremovenodes1.testcase \
+	topogeoremovenodes2.testcase \
+	topogeoremovenodes3.testcase \
+	topogeoremovenodes4.testcase \
+	topogeoremovenodes5.testcase \
+	topogeototable1.testcase \
+	topogeototable2.testcase \
+	topogeototable3.testcase \
+	topogeototable4.testcase \
+	topogeototable5.testcase \
+	topogeototable6.testcase \
+	topogeototable7.testcase \
+	topogeototable8.testcase \
+	topogeototable9.testcase \
+	topogeototable10.testcase \
+	topogeototable11.testcase \
+	topogeototable12.testcase \
+	topogeototable13.testcase \
+	topogeototable14.testcase \
+	topogeototable15.testcase \
+	topogeototable16.testcase \
+	topogeototable17.testcase \
+	topogeototable18.testcase \
+	topogeototable19.testcase \
+	topogeototable20.testcase \
+	topogeototable21.testcase \
+	topogeototable22.testcase \
+	topogeototable23.testcase \
+	topogeototable24.testcase \
+	topogeototable25.testcase \
+	topogeototable26.testcase \
+	topogeototablegen1.testcase \
+	topogeototablegen2.testcase \
+	topogeototablegen3.testcase \
+	topogeototablegen4.testcase \
+	topogeototablegen5.testcase \
+	topogeototablegen6.testcase \
+	topogeototablegen7.testcase \
+	topogeototablegen8.testcase \
+	topogeototablegen9.testcase \
+	topogeototablegen10.testcase \
+	topogeototablegen11.testcase \
+	topogeototablegen12.testcase \
+	topogeototablegen13.testcase \
+	topogeototablegen14.testcase \
+	topogeototablegen15.testcase \
+	topogeototablegen16.testcase \
+	topogeototablegen17.testcase \
+	topogeototablegen18.testcase \
+	topogeototablegen19.testcase \
+	topogeototablegen20.testcase \
+	topogeototablegen21.testcase \
+	topogeototablegen22.testcase \
+	topogeototablegen23.testcase \
+	topogeototablegen24.testcase \
+	topogeototablegen25.testcase \
+	topogeototablegen26.testcase \
+	topogeototablegen27.testcase \
+	topogeototablegen28.testcase \
+	topogeototablegen29.testcase \
+	topogeototablegen30.testcase \
+	topogeototablegen31.testcase \
+	topogeoupdateseeds1.testcase \
+	topogeoupdateseeds2.testcase \
+	topogeoupdateseeds3.testcase \
+	topogeoupdateseeds4.testcase \
+	topogeoupdateseeds5.testcase \
+	topogeoupdateseeds6.testcase \
+	topogeoupdateseeds7.testcase \
+	topogeoupdateseeds8.testcase \
+	topogeoupdateseeds9.testcase \
+	topogeoupdateseeds10.testcase \
+	toponetclone1.testcase \
+	toponetclone2.testcase \
+	toponetclone3.testcase \
+	toponetclone4.testcase \
+	toponetclone5.testcase \
+	toponetclone6.testcase \
+	toponetclone7.testcase \
+	toponetclone8.testcase \
+	toponetclone9.testcase \
+	toponetclone10.testcase \
+	toponetclone11.testcase \
+	toponetclone12.testcase \
+	toponetfromtable1.testcase \
+	toponetfromtable2.testcase \
+	toponetfromtable3.testcase \
+	toponetfromtable4.testcase \
+	toponetfromtable5.testcase \
+	toponetfromtable6.testcase \
+	toponetfromtable7.testcase \
+	toponetfromtable8.testcase \
+	toponetfromtable9.testcase \
+	toponetfromtable10.testcase \
+	toponetfromtable11.testcase \
+	toponetfromtable12.testcase \
+	toponetfromtable13.testcase \
+	toponetfromtable14.testcase \
+	toponetfromtable15.testcase \
+	toponetfromtable16.testcase \
+	toponetfromtable17.testcase \
+	toponettotable1.testcase \
+	toponettotable2.testcase \
+	toponettotable3.testcase \
+	toponettotable4.testcase \
+	toponettotable5.testcase \
+	toponettotable6.testcase \
+	toponettotable7.testcase \
+	toponettotable8.testcase \
+	toponettotable9.testcase \
+	toponettotable10.testcase \
+	toponettotable11.testcase \
+	toponettotable12.testcase \
+	toponettotable13.testcase \
+	toponettotable14.testcase \
+	toponettotable15.testcase \
+	toponettotable16.testcase \
+	toponettotable17.testcase \
+	toponettotable18.testcase \
+	toponettotable19.testcase \
+	toponettotable20.testcase \
+	toponettotable21.testcase \
+	toponettotable22.testcase \
+	toponettotable23.testcase \
+	toponettotable24.testcase \
+	toponettotable25.testcase \
+	toponettotable26.testcase \
+	toponettotablegen1.testcase \
+	toponettotablegen2.testcase \
+	toponettotablegen3.testcase \
+	toponettotablegen4.testcase \
+	toponettotablegen5.testcase \
+	toponettotablegen6.testcase \
+	toponettotablegen7.testcase \
+	toponettotablegen8.testcase \
+	toponettotablegen9.testcase \
+	toponettotablegen10.testcase \
+	toponettotablegen11.testcase \
+	toponettotablegen12.testcase \
+	toponettotablegen13.testcase \
+	toponettotablegen14.testcase \
+	toponettotablegen15.testcase \
+	toponettotablegen16.testcase \
+	toponettotablegen17.testcase \
+	toponettotablegen18.testcase \
+	toponettotablegen19.testcase \
+	toponettotablegen20.testcase \
+	toponettotablegen21.testcase \
+	toponettotablegen22.testcase \
+	toponettotablegen23.testcase \
+	toponettotablegen24.testcase \
+	toponettotablegen25.testcase \
+	toponettotablegen26.testcase \
+	toponettotablegen27.testcase \
+	toponettotablegen28.testcase \
+	toponettotablegen29.testcase \
+	toponettotablegen30.testcase \
+	toponettotablegen31.testcase \
+	validatetopogeo1.testcase \
+	validatetopogeo2.testcase \
+	validatetopogeo3.testcase \
+	validatetopogeo4.testcase \
+	validatetopogeo5.testcase \
+	validlogicalnet1.testcase \
+	validlogicalnet2.testcase \
+	validlogicalnet3.testcase \
+	validlogicalnet4.testcase \
+	validlogicalnet5.testcase \
+	validspatialnet1.testcase \
+	validspatialnet2.testcase \
+	validspatialnet3.testcase \
+	validspatialnet4.testcase \
+	validspatialnet5.testcase
+	
diff --git a/test/sql_stmt_rttopo_tests/Makefile.in b/test/sql_stmt_rttopo_tests/Makefile.in
new file mode 100644
index 0000000..797ccf5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/Makefile.in
@@ -0,0 +1,1466 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/sql_stmt_rttopo_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GEOSCONFIG = @GEOSCONFIG@
+GEOS_CFLAGS = @GEOS_CFLAGS@
+GEOS_LDFLAGS = @GEOS_LDFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = addedgemodface1.testcase \
+	addedgemodface2.testcase \
+	addedgemodface3.testcase \
+	addedgemodface4.testcase \
+	addedgemodface5.testcase \
+	addedgemodface6.testcase \
+	addedgemodface7.testcase \
+	addedgemodface8.testcase \
+	addedgemodface9.testcase \
+	addedgemodface10.testcase \
+	addedgemodface11.testcase \
+	addedgemodface12.testcase \
+	addedgemodface13.testcase \
+	addedgemodface14.testcase \
+	addedgemodface15.testcase \
+	addedgemodface16.testcase \
+	addedgemodface17.testcase \
+	addedgemodface18.testcase \
+	addedgemodface19.testcase \
+	addedgemodface20.testcase \
+	addedgenewfaces1.testcase \
+	addedgenewfaces2.testcase \
+	addedgenewfaces3.testcase \
+	addedgenewfaces4.testcase \
+	addedgenewfaces5.testcase \
+	addedgenewfaces6.testcase \
+	addedgenewfaces7.testcase \
+	addedgenewfaces8.testcase \
+	addedgenewfaces9.testcase \
+	addedgenewfaces10.testcase \
+	addedgenewfaces11.testcase \
+	addedgenewfaces12.testcase \
+	addedgenewfaces13.testcase \
+	addedgenewfaces14.testcase \
+	addedgenewfaces15.testcase \
+	addedgenewfaces16.testcase \
+	addedgenewfaces17.testcase \
+	addedgenewfaces18.testcase \
+	addedgenewfaces19.testcase \
+	addedgenewfaces20.testcase \
+	addisoedge1.testcase \
+	addisoedge2.testcase \
+	addisoedge3.testcase \
+	addisoedge4.testcase \
+	addisoedge5.testcase \
+	addisoedge6.testcase \
+	addisoedge7.testcase \
+	addisoedge8.testcase \
+	addisoedge9.testcase \
+	addisoedge10.testcase \
+	addisoedge11.testcase \
+	addisoedge12.testcase \
+	addisoedge13.testcase \
+	addisoedge14.testcase \
+	addisoedge15.testcase \
+	addisoedge16.testcase \
+	addisoedge17.testcase \
+	addisoedge18.testcase \
+	addisoedge19.testcase \
+	addisoedge20.testcase \
+	addisonetnode1.testcase \
+	addisonetnode2.testcase \
+	addisonetnode3.testcase \
+	addisonetnode4.testcase \
+	addisonetnode5.testcase \
+	addisonode1.testcase \
+	addisonode2.testcase \
+	addisonode3.testcase \
+	addisonode4.testcase \
+	addisonode5.testcase \
+	addisonode6.testcase \
+	addisonode7.testcase \
+	addisonode8.testcase \
+	addisonode9.testcase \
+	addisonode10.testcase \
+	addisonode11.testcase \
+	addisonode12.testcase \
+	addisonode13.testcase \
+	addisonode14.testcase \
+	addisonode15.testcase \
+	addisonode16.testcase \
+	addisonode17.testcase \
+	addisonode1.testcase \
+	addisonode2.testcase \
+	addisonode3.testcase \
+	addisonode4.testcase \
+	addisonode5.testcase \
+	addisonode6.testcase \
+	addisonode7.testcase \
+	addisonode8.testcase \
+	addisonode9.testcase \
+	addisonode10.testcase \
+	addisonode11.testcase \
+	addisonode12.testcase \
+	addisonode13.testcase \
+	addisonode14.testcase \
+	addisonode15.testcase \
+	addisonode16.testcase \
+	addisonode17.testcase \
+	addlink1.testcase \
+	addlink2.testcase \
+	addlink3.testcase \
+	addlink4.testcase \
+	addlink5.testcase \
+	addlink6.testcase \
+	addlink7.testcase \
+	addlink8.testcase \
+	addlink9.testcase \
+	addlink10.testcase \
+	addlink11.testcase \
+	addlink12.testcase \
+	addlink13.testcase \
+	changeedgegeom1.testcase \
+	changeedgegeom2.testcase \
+	changeedgegeom3.testcase \
+	changeedgegeom4.testcase \
+	changeedgegeom5.testcase \
+	changeedgegeom6.testcase \
+	changeedgegeom7.testcase \
+	changeedgegeom8.testcase \
+	changeedgegeom9.testcase \
+	changeedgegeom10.testcase \
+	changeedgegeom11.testcase \
+	changeedgegeom12.testcase \
+	changeedgegeom13.testcase \
+	changeedgegeom14.testcase \
+	changeedgegeom15.testcase \
+	changeedgegeom16.testcase \
+	changeedgegeom17.testcase \
+	changelinkgeom1.testcase \
+	changelinkgeom2.testcase \
+	changelinkgeom3.testcase \
+	changelinkgeom4.testcase \
+	changelinkgeom5.testcase \
+	changelinkgeom6.testcase \
+	changelinkgeom7.testcase \
+	changelinkgeom8.testcase \
+	createtopogeo1.testcase \
+	createtopogeo2.testcase \
+	createtopogeo3.testcase \
+	createtopogeo4.testcase \
+	createtopogeo5.testcase \
+	createtopogeo6.testcase \
+	createtopogeo7.testcase \
+	createtopogeo8.testcase \
+	createtopogeo9.testcase \
+	createtopogeo10.testcase \
+	createtopolayer1.testcase \
+	createtopolayer2.testcase \
+	createtopolayer3.testcase \
+	createtopolayer4.testcase \
+	createtopolayer5.testcase \
+	createtopolayer6.testcase \
+	createtopolayer7.testcase \
+	createtopolayer8.testcase \
+	createtopolayer9.testcase \
+	createtopolayer10.testcase \
+	createtopolayer11.testcase \
+	createtopolayer12.testcase \
+	createtopolayer13.testcase \
+	createtopolayer14.testcase \
+	createtopolayer15.testcase \
+	createtopolayer16.testcase \
+	createtopolayer17.testcase \
+	createtopolayer18.testcase \
+	createtopolayer19.testcase \
+	createtopolayer20.testcase \
+	createtopolayer21.testcase \
+	createtopolayer22.testcase \
+	createtopolayer23.testcase \
+	createtopolayer24.testcase \
+	createtopolayer25.testcase \
+	createtopolayer26.testcase \
+	createtopology1.testcase \
+	createtopology2.testcase \
+	createtopology3.testcase \
+	createtopology4.testcase \
+	createtopology5.testcase \
+	createtopology6.testcase \
+	createtopology7.testcase \
+	createtopology8.testcase \
+	createtopology9.testcase \
+	createtopology10.testcase \
+	createtopology11.testcase \
+	createtopology12.testcase \
+	createtopology13.testcase \
+	createtopology14.testcase \
+	createtopology15.testcase \
+	createtopology16.testcase \
+	createtopology17.testcase \
+	createtopology18.testcase \
+	createtopology19.testcase \
+	createtopology20.testcase \
+	createnetwork1.testcase \
+	createnetwork2.testcase \
+	createnetwork3.testcase \
+	createnetwork4.testcase \
+	createnetwork5.testcase \
+	createnetwork6.testcase \
+	createnetwork7.testcase \
+	createnetwork8.testcase \
+	createnetwork9.testcase \
+	createnetwork10.testcase \
+	createnetwork11.testcase \
+	createnetwork12.testcase \
+	createnetwork13.testcase \
+	createnetwork14.testcase \
+	createnetwork15.testcase \
+	createnetwork16.testcase \
+	createnetwork17.testcase \
+	createnetwork18.testcase \
+	createnetwork19.testcase \
+	createnetwork20.testcase \
+	createnetwork21.testcase \
+	createnetwork22.testcase \
+	createnetwork23.testcase \
+	createnetwork24.testcase \
+	createnetwork25.testcase \
+	droptopology1.testcase \
+	droptopology2.testcase \
+	droptopology3.testcase \
+	droptopology4.testcase \
+	droptopology5.testcase \
+	dropnetwork1.testcase \
+	dropnetwork2.testcase \
+	dropnetwork3.testcase \
+	dropnetwork4.testcase \
+	dropnetwork5.testcase \
+	exporttopolayer1.testcase \
+	exporttopolayer2.testcase \
+	exporttopolayer3.testcase \
+	exporttopolayer4.testcase \
+	exporttopolayer5.testcase \
+	exporttopolayer6.testcase \
+	exporttopolayer7.testcase \
+	exporttopolayer8.testcase \
+	exporttopolayer9.testcase \
+	exporttopolayer10.testcase \
+	exporttopolayer11.testcase \
+	exporttopolayer12.testcase \
+	exporttopolayer13.testcase \
+	exporttopolayer14.testcase \
+	exporttopolayer15.testcase \
+	exporttopolayer16.testcase \
+	exporttopolayer17.testcase \
+	exporttopolayer18.testcase \
+	exporttopolayer19.testcase \
+	exporttopolayer20.testcase \
+	exporttopolayer21.testcase \
+	exporttopolayer22.testcase \
+	exporttopolayer23.testcase \
+	featuretopolayer1.testcase \
+	featuretopolayer2.testcase \
+	featuretopolayer3.testcase \
+	featuretopolayer4.testcase \
+	featuretopolayer5.testcase \
+	featuretopolayer6.testcase \
+	featuretopolayer7.testcase \
+	featuretopolayer8.testcase \
+	featuretopolayer9.testcase \
+	featuretopolayer10.testcase \
+	featuretopolayer11.testcase \
+	featuretopolayer12.testcase \
+	featuretopolayer13.testcase \
+	featuretopolayer14.testcase \
+	featuretopolayer15.testcase \
+	featuretopolayer16.testcase \
+	featuretopolayer17.testcase \
+	getedgeseed1.testcase \
+	getedgeseed2.testcase \
+	getedgeseed3.testcase \
+	getedgeseed4.testcase \
+	getedgeseed5.testcase \
+	getedgeseed6.testcase \
+	getedgeseed7.testcase \
+	getedgeseed8.testcase \
+	getedgeseed9.testcase \
+	getlinkseed1.testcase \
+	getlinkseed2.testcase \
+	getlinkseed3.testcase \
+	getlinkseed4.testcase \
+	getlinkseed5.testcase \
+	getlinkseed6.testcase \
+	getlinkseed7.testcase \
+	getlinkseed8.testcase \
+	getlinkseed9.testcase \
+	getfaceedges1.testcase \
+	getfaceedges2.testcase \
+	getfaceedges3.testcase \
+	getfaceedges4.testcase \
+	getfaceedges5.testcase \
+	getfaceedges6.testcase \
+	getfaceedges7.testcase \
+	getfaceedges8.testcase \
+	getfaceedges9.testcase \
+	getfacegeometry1.testcase \
+	getfacegeometry2.testcase \
+	getfacegeometry3.testcase \
+	getfacegeometry4.testcase \
+	getfacegeometry5.testcase \
+	getfacegeometry6.testcase \
+	getfacegeometry7.testcase \
+	getfacegeometry8.testcase \
+	getfacegeometry9.testcase \
+	getedgebypoint1.testcase \
+	getedgebypoint2.testcase \
+	getedgebypoint3.testcase \
+	getedgebypoint4.testcase \
+	getedgebypoint5.testcase \
+	getedgebypoint6.testcase \
+	getedgebypoint7.testcase \
+	getedgebypoint8.testcase \
+	getedgebypoint9.testcase \
+	getedgebypoint10.testcase \
+	getedgebypoint11.testcase \
+	getedgebypoint12.testcase \
+	getedgebypoint13.testcase \
+	getedgebypoint14.testcase \
+	getedgebypoint15.testcase \
+	getedgebypoint16.testcase \
+	getedgebypoint17.testcase \
+	getfacegeometry1.testcase \
+	getfacegeometry2.testcase \
+	getfacegeometry3.testcase \
+	getfacegeometry4.testcase \
+	getfacegeometry5.testcase \
+	getfacegeometry6.testcase \
+	getfacegeometry7.testcase \
+	getfacegeometry8.testcase \
+	getfacegeometry9.testcase \
+	getfacebypoint1.testcase \
+	getfacebypoint2.testcase \
+	getfacebypoint3.testcase \
+	getfacebypoint4.testcase \
+	getfacebypoint5.testcase \
+	getfacebypoint6.testcase \
+	getfacebypoint7.testcase \
+	getfacebypoint8.testcase \
+	getfacebypoint9.testcase \
+	getfacebypoint10.testcase \
+	getfacebypoint11.testcase \
+	getfacebypoint12.testcase \
+	getfacebypoint13.testcase \
+	getfacebypoint14.testcase \
+	getfacebypoint15.testcase \
+	getfacebypoint16.testcase \
+	getfacebypoint17.testcase \
+	getfaceseed1.testcase \
+	getfaceseed2.testcase \
+	getfaceseed3.testcase \
+	getfaceseed4.testcase \
+	getfaceseed5.testcase \
+	getfaceseed6.testcase \
+	getfaceseed7.testcase \
+	getfaceseed8.testcase \
+	getfaceseed9.testcase \
+	getlinkbypoint1.testcase \
+	getlinkbypoint2.testcase \
+	getlinkbypoint3.testcase \
+	getlinkbypoint4.testcase \
+	getlinkbypoint5.testcase \
+	getlinkbypoint6.testcase \
+	getlinkbypoint7.testcase \
+	getlinkbypoint8.testcase \
+	getlinkbypoint9.testcase \
+	getlinkbypoint10.testcase \
+	getlinkbypoint11.testcase \
+	getlinkbypoint12.testcase \
+	getlinkbypoint13.testcase \
+	getlinkbypoint14.testcase \
+	getlinkbypoint15.testcase \
+	getlinkbypoint16.testcase \
+	getlinkbypoint17.testcase \
+	getnetnodebypoint1.testcase \
+	getnetnodebypoint2.testcase \
+	getnetnodebypoint3.testcase \
+	getnetnodebypoint4.testcase \
+	getnetnodebypoint5.testcase \
+	getnetnodebypoint6.testcase \
+	getnetnodebypoint7.testcase \
+	getnetnodebypoint8.testcase \
+	getnetnodebypoint9.testcase \
+	getnetnodebypoint10.testcase \
+	getnetnodebypoint11.testcase \
+	getnetnodebypoint12.testcase \
+	getnetnodebypoint13.testcase \
+	getnetnodebypoint14.testcase \
+	getnetnodebypoint15.testcase \
+	getnetnodebypoint16.testcase \
+	getnetnodebypoint17.testcase \
+	getnodebypoint1.testcase \
+	getnodebypoint2.testcase \
+	getnodebypoint3.testcase \
+	getnodebypoint4.testcase \
+	getnodebypoint5.testcase \
+	getnodebypoint6.testcase \
+	getnodebypoint7.testcase \
+	getnodebypoint8.testcase \
+	getnodebypoint9.testcase \
+	getnodebypoint10.testcase \
+	getnodebypoint11.testcase \
+	getnodebypoint12.testcase \
+	getnodebypoint13.testcase \
+	getnodebypoint14.testcase \
+	getnodebypoint15.testcase \
+	getnodebypoint16.testcase \
+	getnodebypoint17.testcase \
+	inittopolayer1.testcase \
+	inittopolayer2.testcase \
+	inittopolayer3.testcase \
+	inittopolayer4.testcase \
+	inittopolayer5.testcase \
+	inittopolayer6.testcase \
+	inittopolayer7.testcase \
+	inittopolayer8.testcase \
+	inittopolayer9.testcase \
+	inittopolayer10.testcase \
+	inittopolayer11.testcase \
+	inittopolayer12.testcase \
+	inittopolayer13.testcase \
+	inittopolayer14.testcase \
+	inittopolayer15.testcase \
+	inittopolayer16.testcase \
+	inittopolayer17.testcase \
+	linesnapseed1.testcase \
+	linesnapseed2.testcase \
+	linesnapseed3.testcase \
+	linesnapseed4.testcase \
+	linesnapseed5.testcase \
+	linesnapseed6.testcase \
+	linesnapseed7.testcase \
+	linesnapseed8.testcase \
+	linesnapseed9.testcase \
+	linesnapseed10.testcase \
+	linesnapseed11.testcase \
+	linesnapseed12.testcase \
+	linesnapseed13.testcase \
+	linesnapseed14.testcase \
+	linesnapseed15.testcase \
+	linesnapseed16.testcase \
+	linesnapseed17.testcase \
+	loginetfromtgeo1.testcase \
+	loginetfromtgeo2.testcase \
+	loginetfromtgeo3.testcase \
+	loginetfromtgeo4.testcase \
+	loginetfromtgeo5.testcase \
+	loginetfromtgeo6.testcase \
+	loginetfromtgeo7.testcase \
+	loginetfromtgeo8.testcase \
+	loginetfromtgeo9.testcase \
+	modedgeheal1.testcase \
+	modedgeheal2.testcase \
+	modedgeheal3.testcase \
+	modedgeheal4.testcase \
+	modedgeheal5.testcase \
+	modedgeheal6.testcase \
+	modedgeheal7.testcase \
+	modedgeheal8.testcase \
+	modedgeheal9.testcase \
+	modedgeheal10.testcase \
+	modedgeheal11.testcase \
+	modedgeheal12.testcase \
+	modedgeheal13.testcase \
+	modedgesplit1.testcase \
+	modedgesplit2.testcase \
+	modedgesplit3.testcase \
+	modedgesplit4.testcase \
+	modedgesplit5.testcase \
+	modedgesplit6.testcase \
+	modedgesplit7.testcase \
+	modedgesplit8.testcase \
+	modedgesplit9.testcase \
+	modedgesplit10.testcase \
+	modedgesplit11.testcase \
+	modedgesplit12.testcase \
+	modedgesplit13.testcase \
+	modedgesplit14.testcase \
+	modedgesplit15.testcase \
+	modedgesplit16.testcase \
+	modgeolinksplit1.testcase \
+	modgeolinksplit2.testcase \
+	modgeolinksplit3.testcase \
+	modgeolinksplit4.testcase \
+	modgeolinksplit5.testcase \
+	modgeolinksplit6.testcase \
+	modgeolinksplit7.testcase \
+	modgeolinksplit8.testcase \
+	modgeolinksplit9.testcase \
+	modlinkheal1.testcase \
+	modlinkheal2.testcase \
+	modlinkheal3.testcase \
+	modlinkheal4.testcase \
+	modlinkheal5.testcase \
+	modlinkheal6.testcase \
+	modlinkheal7.testcase \
+	modlinkheal8.testcase \
+	modlinkheal9.testcase \
+	modlinkheal10.testcase \
+	modlinkheal11.testcase \
+	modlinkheal12.testcase \
+	modlinkheal13.testcase \
+	modloglinksplit1.testcase \
+	modloglinksplit2.testcase \
+	modloglinksplit3.testcase \
+	modloglinksplit4.testcase \
+	modloglinksplit5.testcase \
+	modloglinksplit6.testcase \
+	modloglinksplit7.testcase \
+	modloglinksplit8.testcase \
+	modloglinksplit9.testcase \
+	moveisonetnode1.testcase \
+	moveisonetnode2.testcase \
+	moveisonetnode3.testcase \
+	moveisonetnode4.testcase \
+	moveisonetnode5.testcase \
+	moveisonetnode6.testcase \
+	moveisonetnode7.testcase \
+	moveisonetnode8.testcase \
+	moveisonetnode9.testcase \
+	moveisonode1.testcase \
+	moveisonode2.testcase \
+	moveisonode3.testcase \
+	moveisonode4.testcase \
+	moveisonode5.testcase \
+	moveisonode6.testcase \
+	moveisonode7.testcase \
+	moveisonode8.testcase \
+	moveisonode9.testcase \
+	moveisonode10.testcase \
+	moveisonode11.testcase \
+	moveisonode12.testcase \
+	moveisonode13.testcase \
+	moveisonode14.testcase \
+	moveisonode15.testcase \
+	moveisonode16.testcase \
+	moveisonode17.testcase \
+	netexception1.testcase \
+	netexception2.testcase \
+	newedgeheal1.testcase \
+	newedgeheal2.testcase \
+	newedgeheal3.testcase \
+	newedgeheal4.testcase \
+	newedgeheal5.testcase \
+	newedgeheal6.testcase \
+	newedgeheal7.testcase \
+	newedgeheal8.testcase \
+	newedgeheal9.testcase \
+	newedgeheal10.testcase \
+	newedgeheal11.testcase \
+	newedgeheal12.testcase \
+	newedgeheal13.testcase \
+	newedgessplit1.testcase \
+	newedgessplit2.testcase \
+	newedgessplit3.testcase \
+	newedgessplit4.testcase \
+	newedgessplit5.testcase \
+	newedgessplit6.testcase \
+	newedgessplit7.testcase \
+	newedgessplit8.testcase \
+	newedgessplit9.testcase \
+	newedgessplit10.testcase \
+	newedgessplit11.testcase \
+	newedgessplit12.testcase \
+	newedgessplit13.testcase \
+	newedgessplit14.testcase \
+	newedgessplit15.testcase \
+	newedgessplit16.testcase \
+	newgeolinksplit1.testcase \
+	newgeolinksplit2.testcase \
+	newgeolinksplit3.testcase \
+	newgeolinksplit4.testcase \
+	newgeolinksplit5.testcase \
+	newgeolinksplit6.testcase \
+	newgeolinksplit7.testcase \
+	newgeolinksplit8.testcase \
+	newgeolinksplit9.testcase \
+	newlinkheal1.testcase \
+	newlinkheal2.testcase \
+	newlinkheal3.testcase \
+	newlinkheal4.testcase \
+	newlinkheal5.testcase \
+	newlinkheal6.testcase \
+	newlinkheal7.testcase \
+	newlinkheal8.testcase \
+	newlinkheal9.testcase \
+	newlinkheal10.testcase \
+	newlinkheal11.testcase \
+	newlinkheal12.testcase \
+	newlinkheal13.testcase \
+	newloglinksplit1.testcase \
+	newloglinksplit2.testcase \
+	newloglinksplit3.testcase \
+	newloglinksplit4.testcase \
+	newloglinksplit5.testcase \
+	newloglinksplit6.testcase \
+	newloglinksplit7.testcase \
+	newloglinksplit8.testcase \
+	newloglinksplit9.testcase \
+	pointsnapseed1.testcase \
+	pointsnapseed2.testcase \
+	pointsnapseed3.testcase \
+	pointsnapseed4.testcase \
+	pointsnapseed5.testcase \
+	pointsnapseed6.testcase \
+	pointsnapseed7.testcase \
+	pointsnapseed8.testcase \
+	pointsnapseed9.testcase \
+	pointsnapseed10.testcase \
+	pointsnapseed11.testcase \
+	pointsnapseed12.testcase \
+	pointsnapseed13.testcase \
+	pointsnapseed14.testcase \
+	pointsnapseed15.testcase \
+	pointsnapseed16.testcase \
+	pointsnapseed17.testcase \
+	remedgemodface1.testcase \
+	remedgemodface2.testcase \
+	remedgemodface3.testcase \
+	remedgemodface4.testcase \
+	remedgemodface5.testcase \
+	remedgemodface6.testcase \
+	remedgemodface7.testcase \
+	remedgemodface8.testcase \
+	remedgemodface9.testcase \
+	remedgenewface1.testcase \
+	remedgenewface2.testcase \
+	remedgenewface3.testcase \
+	remedgenewface4.testcase \
+	remedgenewface5.testcase \
+	remedgenewface6.testcase \
+	remedgenewface7.testcase \
+	remedgenewface8.testcase \
+	remedgenewface9.testcase \
+	remisoedge1.testcase \
+	remisoedge2.testcase \
+	remisoedge3.testcase \
+	remisoedge4.testcase \
+	remisoedge5.testcase \
+	remisoedge6.testcase \
+	remisoedge7.testcase \
+	remisoedge8.testcase \
+	remisoedge9.testcase \
+	remisonode1.testcase \
+	remisonode2.testcase \
+	remisonode3.testcase \
+	remisonode4.testcase \
+	remisonode5.testcase \
+	remisonode6.testcase \
+	remisonode7.testcase \
+	remisonode8.testcase \
+	remisonode9.testcase \
+	remisonetnode1.testcase \
+	remisonetnode2.testcase \
+	remisonetnode3.testcase \
+	remisonetnode4.testcase \
+	remisonetnode5.testcase \
+	remisonetnode6.testcase \
+	remisonetnode7.testcase \
+	remisonetnode8.testcase \
+	remisonetnode9.testcase \
+	remlink1.testcase \
+	remlink2.testcase \
+	remlink3.testcase \
+	remlink4.testcase \
+	remlink5.testcase \
+	remlink6.testcase \
+	remlink7.testcase \
+	remlink8.testcase \
+	remlink9.testcase \
+	removetopolayer1.testcase \
+	removetopolayer2.testcase \
+	removetopolayer3.testcase \
+	removetopolayer4.testcase \
+	removetopolayer5.testcase \
+	removetopolayer6.testcase \
+	removetopolayer7.testcase \
+	removetopolayer8.testcase \
+	removetopolayer9.testcase \
+	spatnetfromtgeo1.testcase \
+	spatnetfromtgeo2.testcase \
+	spatnetfromtgeo3.testcase \
+	spatnetfromtgeo4.testcase \
+	spatnetfromtgeo5.testcase \
+	spatnetfromtgeo6.testcase \
+	spatnetfromtgeo7.testcase \
+	spatnetfromtgeo8.testcase \
+	spatnetfromtgeo9.testcase \
+	spatnetfromgeom1.testcase \
+	spatnetfromgeom2.testcase \
+	spatnetfromgeom3.testcase \
+	spatnetfromgeom4.testcase \
+	spatnetfromgeom5.testcase \
+	spatnetfromgeom6.testcase \
+	spatnetfromgeom7.testcase \
+	spatnetfromgeom8.testcase \
+	spatnetfromgeom9.testcase \
+	spatnetfromgeom10.testcase \
+	topoexception1.testcase \
+	topoexception2.testcase \
+	topogeoaddpoint1.testcase \
+	topogeoaddpoint2.testcase \
+	topogeoaddpoint3.testcase \
+	topogeoaddpoint4.testcase \
+	topogeoaddpoint5.testcase \
+	topogeoaddpoint6.testcase \
+	topogeoaddpoint7.testcase \
+	topogeoaddpoint8.testcase \
+	topogeoaddpoint9.testcase \
+	topogeoaddpoint10.testcase \
+	topogeoaddpoint11.testcase \
+	topogeoaddpoint12.testcase \
+	topogeoaddpoint13.testcase \
+	topogeoaddpoint14.testcase \
+	topogeoaddpoint15.testcase \
+	topogeoaddpoint16.testcase \
+	topogeoaddpoint17.testcase \
+	topogeoaddline1.testcase \
+	topogeoaddline2.testcase \
+	topogeoaddline3.testcase \
+	topogeoaddline4.testcase \
+	topogeoaddline5.testcase \
+	topogeoaddline6.testcase \
+	topogeoaddline7.testcase \
+	topogeoaddline8.testcase \
+	topogeoaddline9.testcase \
+	topogeoaddline10.testcase \
+	topogeoaddline11.testcase \
+	topogeoaddline12.testcase \
+	topogeoaddline13.testcase \
+	topogeoaddline14.testcase \
+	topogeoaddline15.testcase \
+	topogeoaddline16.testcase \
+	topogeoaddline17.testcase \
+	topogeoclone1.testcase \
+	topogeoclone2.testcase \
+	topogeoclone3.testcase \
+	topogeoclone4.testcase \
+	topogeoclone5.testcase \
+	topogeoclone6.testcase \
+	topogeoclone7.testcase \
+	topogeoclone8.testcase \
+	topogeoclone9.testcase \
+	topogeoclone10.testcase \
+	topogeoclone11.testcase \
+	topogeoclone12.testcase \
+	topogeofromext1.testcase \
+	topogeofromext2.testcase \
+	topogeofromext3.testcase \
+	topogeofromext4.testcase \
+	topogeofromext5.testcase \
+	topogeofromext6.testcase \
+	topogeofromext7.testcase \
+	topogeofromext8.testcase \
+	topogeofromext9.testcase \
+	topogeofromext10.testcase \
+	topogeofromext11.testcase \
+	topogeofromext12.testcase \
+	topogeofromext13.testcase \
+	topogeofromext14.testcase \
+	topogeofromext15.testcase \
+	topogeofromext16.testcase \
+	topogeofromext17.testcase \
+	topogeofromext18.testcase \
+	topogeofromext19.testcase \
+	topogeofromext20.testcase \
+	topogeofromext21.testcase \
+	topogeofromext22.testcase \
+	topogeofromext23.testcase \
+	topogeofromext24.testcase \
+	topogeofromext25.testcase \
+	topogeofromext26.testcase \
+	topogeofromext27.testcase \
+	topogeofromext28.testcase \
+	topogeofromext29.testcase \
+	topogeofromext30.testcase \
+	topogeofromext31.testcase \
+	topogeofromext32.testcase \
+	topogeofromext33.testcase \
+	topogeofromext34.testcase \
+	topogeofromext35.testcase \
+	topogeofromext36.testcase \
+	topogeofromext37.testcase \
+	topogeofromext38.testcase \
+	topogeofromext39.testcase \
+	topogeofromtable1.testcase \
+	topogeofromtable2.testcase \
+	topogeofromtable3.testcase \
+	topogeofromtable4.testcase \
+	topogeofromtable5.testcase \
+	topogeofromtable6.testcase \
+	topogeofromtable7.testcase \
+	topogeofromtable8.testcase \
+	topogeofromtable9.testcase \
+	topogeofromtable10.testcase \
+	topogeofromtable11.testcase \
+	topogeofromtable12.testcase \
+	topogeofromtable13.testcase \
+	topogeofromtable14.testcase \
+	topogeofromtable15.testcase \
+	topogeofromtable16.testcase \
+	topogeofromtable17.testcase \
+	topogeofromtable18.testcase \
+	topogeofromtable19.testcase \
+	topogeofromtable20.testcase \
+	topogeofromtable21.testcase \
+	topogeofromtable22.testcase \
+	topogeofromtable23.testcase \
+	topogeofromtable24.testcase \
+	topogeofromtable25.testcase \
+	topogeofromtable26.testcase \
+	topogeofromtable27.testcase \
+	topogeofromtable28.testcase \
+	topogeofromtable29.testcase \
+	topogeofromtable30.testcase \
+	topogeosplitline1.testcase \
+	topogeosplitline2.testcase \
+	topogeosplitline3.testcase \
+	topogeosplitline4.testcase \
+	topogeosplitline5.testcase \
+	topogeosplitline6.testcase \
+	topogeosplitline7.testcase \
+	topogeosplitline8.testcase \
+	topogeosplitline9.testcase \
+	topogeosplitline10.testcase \
+	topogeosplitline11.testcase \
+	topogeosplitline12.testcase \
+	topogeosplitline13.testcase \
+	topogeosplitline14.testcase \
+	topogeosplitline15.testcase \
+	topogeosplitline16.testcase \
+	topogeoremovesmall1.testcase \
+	topogeoremovesmall2.testcase \
+	topogeoremovesmall3.testcase \
+	topogeoremovesmall4.testcase \
+	topogeoremovesmall5.testcase \
+	topogeoremovesmall6.testcase \
+	topogeoremovesmall7.testcase \
+	topogeoremovesmall8.testcase \
+	topogeoremovesmall9.testcase \
+	topogeoremoveedges1.testcase \
+	topogeoremoveedges2.testcase \
+	topogeoremoveedges3.testcase \
+	topogeoremoveedges4.testcase \
+	topogeoremoveedges5.testcase \
+	topogeoremovenodes1.testcase \
+	topogeoremovenodes2.testcase \
+	topogeoremovenodes3.testcase \
+	topogeoremovenodes4.testcase \
+	topogeoremovenodes5.testcase \
+	topogeototable1.testcase \
+	topogeototable2.testcase \
+	topogeototable3.testcase \
+	topogeototable4.testcase \
+	topogeototable5.testcase \
+	topogeototable6.testcase \
+	topogeototable7.testcase \
+	topogeototable8.testcase \
+	topogeototable9.testcase \
+	topogeototable10.testcase \
+	topogeototable11.testcase \
+	topogeototable12.testcase \
+	topogeototable13.testcase \
+	topogeototable14.testcase \
+	topogeototable15.testcase \
+	topogeototable16.testcase \
+	topogeototable17.testcase \
+	topogeototable18.testcase \
+	topogeototable19.testcase \
+	topogeototable20.testcase \
+	topogeototable21.testcase \
+	topogeototable22.testcase \
+	topogeototable23.testcase \
+	topogeototable24.testcase \
+	topogeototable25.testcase \
+	topogeototable26.testcase \
+	topogeototablegen1.testcase \
+	topogeototablegen2.testcase \
+	topogeototablegen3.testcase \
+	topogeototablegen4.testcase \
+	topogeototablegen5.testcase \
+	topogeototablegen6.testcase \
+	topogeototablegen7.testcase \
+	topogeototablegen8.testcase \
+	topogeototablegen9.testcase \
+	topogeototablegen10.testcase \
+	topogeototablegen11.testcase \
+	topogeototablegen12.testcase \
+	topogeototablegen13.testcase \
+	topogeototablegen14.testcase \
+	topogeototablegen15.testcase \
+	topogeototablegen16.testcase \
+	topogeototablegen17.testcase \
+	topogeototablegen18.testcase \
+	topogeototablegen19.testcase \
+	topogeototablegen20.testcase \
+	topogeototablegen21.testcase \
+	topogeototablegen22.testcase \
+	topogeototablegen23.testcase \
+	topogeototablegen24.testcase \
+	topogeototablegen25.testcase \
+	topogeototablegen26.testcase \
+	topogeototablegen27.testcase \
+	topogeototablegen28.testcase \
+	topogeototablegen29.testcase \
+	topogeototablegen30.testcase \
+	topogeototablegen31.testcase \
+	topogeoupdateseeds1.testcase \
+	topogeoupdateseeds2.testcase \
+	topogeoupdateseeds3.testcase \
+	topogeoupdateseeds4.testcase \
+	topogeoupdateseeds5.testcase \
+	topogeoupdateseeds6.testcase \
+	topogeoupdateseeds7.testcase \
+	topogeoupdateseeds8.testcase \
+	topogeoupdateseeds9.testcase \
+	topogeoupdateseeds10.testcase \
+	toponetclone1.testcase \
+	toponetclone2.testcase \
+	toponetclone3.testcase \
+	toponetclone4.testcase \
+	toponetclone5.testcase \
+	toponetclone6.testcase \
+	toponetclone7.testcase \
+	toponetclone8.testcase \
+	toponetclone9.testcase \
+	toponetclone10.testcase \
+	toponetclone11.testcase \
+	toponetclone12.testcase \
+	toponetfromtable1.testcase \
+	toponetfromtable2.testcase \
+	toponetfromtable3.testcase \
+	toponetfromtable4.testcase \
+	toponetfromtable5.testcase \
+	toponetfromtable6.testcase \
+	toponetfromtable7.testcase \
+	toponetfromtable8.testcase \
+	toponetfromtable9.testcase \
+	toponetfromtable10.testcase \
+	toponetfromtable11.testcase \
+	toponetfromtable12.testcase \
+	toponetfromtable13.testcase \
+	toponetfromtable14.testcase \
+	toponetfromtable15.testcase \
+	toponetfromtable16.testcase \
+	toponetfromtable17.testcase \
+	toponettotable1.testcase \
+	toponettotable2.testcase \
+	toponettotable3.testcase \
+	toponettotable4.testcase \
+	toponettotable5.testcase \
+	toponettotable6.testcase \
+	toponettotable7.testcase \
+	toponettotable8.testcase \
+	toponettotable9.testcase \
+	toponettotable10.testcase \
+	toponettotable11.testcase \
+	toponettotable12.testcase \
+	toponettotable13.testcase \
+	toponettotable14.testcase \
+	toponettotable15.testcase \
+	toponettotable16.testcase \
+	toponettotable17.testcase \
+	toponettotable18.testcase \
+	toponettotable19.testcase \
+	toponettotable20.testcase \
+	toponettotable21.testcase \
+	toponettotable22.testcase \
+	toponettotable23.testcase \
+	toponettotable24.testcase \
+	toponettotable25.testcase \
+	toponettotable26.testcase \
+	toponettotablegen1.testcase \
+	toponettotablegen2.testcase \
+	toponettotablegen3.testcase \
+	toponettotablegen4.testcase \
+	toponettotablegen5.testcase \
+	toponettotablegen6.testcase \
+	toponettotablegen7.testcase \
+	toponettotablegen8.testcase \
+	toponettotablegen9.testcase \
+	toponettotablegen10.testcase \
+	toponettotablegen11.testcase \
+	toponettotablegen12.testcase \
+	toponettotablegen13.testcase \
+	toponettotablegen14.testcase \
+	toponettotablegen15.testcase \
+	toponettotablegen16.testcase \
+	toponettotablegen17.testcase \
+	toponettotablegen18.testcase \
+	toponettotablegen19.testcase \
+	toponettotablegen20.testcase \
+	toponettotablegen21.testcase \
+	toponettotablegen22.testcase \
+	toponettotablegen23.testcase \
+	toponettotablegen24.testcase \
+	toponettotablegen25.testcase \
+	toponettotablegen26.testcase \
+	toponettotablegen27.testcase \
+	toponettotablegen28.testcase \
+	toponettotablegen29.testcase \
+	toponettotablegen30.testcase \
+	toponettotablegen31.testcase \
+	validatetopogeo1.testcase \
+	validatetopogeo2.testcase \
+	validatetopogeo3.testcase \
+	validatetopogeo4.testcase \
+	validatetopogeo5.testcase \
+	validlogicalnet1.testcase \
+	validlogicalnet2.testcase \
+	validlogicalnet3.testcase \
+	validlogicalnet4.testcase \
+	validlogicalnet5.testcase \
+	validspatialnet1.testcase \
+	validspatialnet2.testcase \
+	validspatialnet3.testcase \
+	validspatialnet4.testcase \
+	validspatialnet5.testcase
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_rttopo_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_rttopo_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface1.testcase b/test/sql_stmt_rttopo_tests/addedgemodface1.testcase
new file mode 100644
index 0000000..06136f5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface1.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - NULL Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface10.testcase b/test/sql_stmt_rttopo_tests/addedgemodface10.testcase
new file mode 100644
index 0000000..92dd107
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface10.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - NULL Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface11.testcase b/test/sql_stmt_rttopo_tests/addedgemodface11.testcase
new file mode 100644
index 0000000..05591cb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface11.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Double Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface12.testcase b/test/sql_stmt_rttopo_tests/addedgemodface12.testcase
new file mode 100644
index 0000000..ac329d3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface12.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Text Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface13.testcase b/test/sql_stmt_rttopo_tests/addedgemodface13.testcase
new file mode 100644
index 0000000..118c315
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface13.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - BLOB Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface14.testcase b/test/sql_stmt_rttopo_tests/addedgemodface14.testcase
new file mode 100644
index 0000000..b06c95e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface14.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Int Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface15.testcase b/test/sql_stmt_rttopo_tests/addedgemodface15.testcase
new file mode 100644
index 0000000..9fc3c6d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface15.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Double Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, 1.3);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface16.testcase b/test/sql_stmt_rttopo_tests/addedgemodface16.testcase
new file mode 100644
index 0000000..3abb727
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface16.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface17.testcase b/test/sql_stmt_rttopo_tests/addedgemodface17.testcase
new file mode 100644
index 0000000..525c62a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface17.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface18.testcase b/test/sql_stmt_rttopo_tests/addedgemodface18.testcase
new file mode 100644
index 0000000..2ec150e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface18.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Point Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface19.testcase b/test/sql_stmt_rttopo_tests/addedgemodface19.testcase
new file mode 100644
index 0000000..4639cee
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface19.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface2.testcase b/test/sql_stmt_rttopo_tests/addedgemodface2.testcase
new file mode 100644
index 0000000..642af10
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface2.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Int Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface20.testcase b/test/sql_stmt_rttopo_tests/addedgemodface20.testcase
new file mode 100644
index 0000000..e748670
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface20.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - MultiLinestring Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface3.testcase b/test/sql_stmt_rttopo_tests/addedgemodface3.testcase
new file mode 100644
index 0000000..2b8bf2b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface3.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Double Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface4.testcase b/test/sql_stmt_rttopo_tests/addedgemodface4.testcase
new file mode 100644
index 0000000..dd97a00
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface4.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface5.testcase b/test/sql_stmt_rttopo_tests/addedgemodface5.testcase
new file mode 100644
index 0000000..d755050
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface5.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Text Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface6.testcase b/test/sql_stmt_rttopo_tests/addedgemodface6.testcase
new file mode 100644
index 0000000..9033151
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface6.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - NULL Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface7.testcase b/test/sql_stmt_rttopo_tests/addedgemodface7.testcase
new file mode 100644
index 0000000..1c3e429
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface7.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Double Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface8.testcase b/test/sql_stmt_rttopo_tests/addedgemodface8.testcase
new file mode 100644
index 0000000..168d726
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface8.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - Text Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgemodface9.testcase b/test/sql_stmt_rttopo_tests/addedgemodface9.testcase
new file mode 100644
index 0000000..3904c4d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgemodface9.testcase
@@ -0,0 +1,7 @@
+AddEdgeModFace - BLOB Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeModFace('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeModFace('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces1.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces1.testcase
new file mode 100644
index 0000000..fafd3dd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces1.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - NULL Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces10.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces10.testcase
new file mode 100644
index 0000000..544bcc2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces10.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - NULL Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces11.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces11.testcase
new file mode 100644
index 0000000..e2da37b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces11.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Double Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces12.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces12.testcase
new file mode 100644
index 0000000..c0f80d1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces12.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Text Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces13.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces13.testcase
new file mode 100644
index 0000000..326db12
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces13.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - BLOB Node To
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces14.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces14.testcase
new file mode 100644
index 0000000..99cc3aa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces14.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Int Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces15.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces15.testcase
new file mode 100644
index 0000000..ff6f467
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces15.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Double Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, 1.3);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces16.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces16.testcase
new file mode 100644
index 0000000..8d433f4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces16.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces17.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces17.testcase
new file mode 100644
index 0000000..2d858d4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces17.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces18.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces18.testcase
new file mode 100644
index 0000000..e2b1a1e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces18.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Point Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces19.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces19.testcase
new file mode 100644
index 0000000..309a4de
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces19.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces2.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces2.testcase
new file mode 100644
index 0000000..1ab590a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces2.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Int Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces20.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces20.testcase
new file mode 100644
index 0000000..5e28039
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces20.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - MultiLinestring Geometry
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces3.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces3.testcase
new file mode 100644
index 0000000..46dfb3d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces3.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Double Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces4.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces4.testcase
new file mode 100644
index 0000000..476feb4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces4.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces5.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces5.testcase
new file mode 100644
index 0000000..30f455a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces5.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Text Topology
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces6.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces6.testcase
new file mode 100644
index 0000000..2a0a18b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces6.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - NULL Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces7.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces7.testcase
new file mode 100644
index 0000000..983d13a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces7.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Double Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces8.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces8.testcase
new file mode 100644
index 0000000..a006a32
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces8.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - Text Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addedgenewfaces9.testcase b/test/sql_stmt_rttopo_tests/addedgenewfaces9.testcase
new file mode 100644
index 0000000..b7452a2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addedgenewfaces9.testcase
@@ -0,0 +1,7 @@
+AddEdgeNewFaces - BLOB Node From
+:memory: #use in-memory database
+SELECT ST_AddEdgeNewFaces('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddEdgeNewFaces('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge1.testcase b/test/sql_stmt_rttopo_tests/addisoedge1.testcase
new file mode 100644
index 0000000..383f200
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge1.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - NULL Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge10.testcase b/test/sql_stmt_rttopo_tests/addisoedge10.testcase
new file mode 100644
index 0000000..80a3249
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge10.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - NULL Node To
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge11.testcase b/test/sql_stmt_rttopo_tests/addisoedge11.testcase
new file mode 100644
index 0000000..0b1bebd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge11.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Double Node To
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge12.testcase b/test/sql_stmt_rttopo_tests/addisoedge12.testcase
new file mode 100644
index 0000000..2d80fe5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge12.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Text Node To
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge13.testcase b/test/sql_stmt_rttopo_tests/addisoedge13.testcase
new file mode 100644
index 0000000..c5fc479
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge13.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - BLOB Node To
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge14.testcase b/test/sql_stmt_rttopo_tests/addisoedge14.testcase
new file mode 100644
index 0000000..24665a6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge14.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Int Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge15.testcase b/test/sql_stmt_rttopo_tests/addisoedge15.testcase
new file mode 100644
index 0000000..092df75
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge15.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Double Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, 1.3);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge16.testcase b/test/sql_stmt_rttopo_tests/addisoedge16.testcase
new file mode 100644
index 0000000..4b18f7a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge16.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge17.testcase b/test/sql_stmt_rttopo_tests/addisoedge17.testcase
new file mode 100644
index 0000000..ce31a49
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge17.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge18.testcase b/test/sql_stmt_rttopo_tests/addisoedge18.testcase
new file mode 100644
index 0000000..aff61f7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge18.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Point Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge19.testcase b/test/sql_stmt_rttopo_tests/addisoedge19.testcase
new file mode 100644
index 0000000..3b34c77
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge19.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge2.testcase b/test/sql_stmt_rttopo_tests/addisoedge2.testcase
new file mode 100644
index 0000000..4228ca1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge2.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Int Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge20.testcase b/test/sql_stmt_rttopo_tests/addisoedge20.testcase
new file mode 100644
index 0000000..cd09fc3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge20.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - MultiLinestring Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge3.testcase b/test/sql_stmt_rttopo_tests/addisoedge3.testcase
new file mode 100644
index 0000000..264236c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge3.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Double Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge4.testcase b/test/sql_stmt_rttopo_tests/addisoedge4.testcase
new file mode 100644
index 0000000..3dbc86c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge4.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge5.testcase b/test/sql_stmt_rttopo_tests/addisoedge5.testcase
new file mode 100644
index 0000000..c5b42bc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge5.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Text Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge6.testcase b/test/sql_stmt_rttopo_tests/addisoedge6.testcase
new file mode 100644
index 0000000..6f612e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge6.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - NULL Node From
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge7.testcase b/test/sql_stmt_rttopo_tests/addisoedge7.testcase
new file mode 100644
index 0000000..00744c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge7.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Double Node From
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge8.testcase b/test/sql_stmt_rttopo_tests/addisoedge8.testcase
new file mode 100644
index 0000000..5a91da8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge8.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - Text Node From
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisoedge9.testcase b/test/sql_stmt_rttopo_tests/addisoedge9.testcase
new file mode 100644
index 0000000..b1fab8f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisoedge9.testcase
@@ -0,0 +1,7 @@
+AddIsoEdge - BLOB Node From
+:memory: #use in-memory database
+SELECT ST_AddIsoEdge('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoEdge('topology', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonetnode1.testcase b/test/sql_stmt_rttopo_tests/addisonetnode1.testcase
new file mode 100644
index 0000000..38cba50
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonetnode1.testcase
@@ -0,0 +1,7 @@
+AddIsoNetNode - NULL Network
+:memory: #use in-memory database
+SELECT ST_AddIsoNetNode(NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNetNode(NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonetnode2.testcase b/test/sql_stmt_rttopo_tests/addisonetnode2.testcase
new file mode 100644
index 0000000..98e446a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonetnode2.testcase
@@ -0,0 +1,7 @@
+AddIsoNetNode - Int Network
+:memory: #use in-memory database
+SELECT ST_AddIsoNetNode(1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNetNode(1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonetnode3.testcase b/test/sql_stmt_rttopo_tests/addisonetnode3.testcase
new file mode 100644
index 0000000..ca1bee5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonetnode3.testcase
@@ -0,0 +1,7 @@
+AddIsoNetNode - Double Network
+:memory: #use in-memory database
+SELECT ST_AddIsoNetNode(1.5, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNetNode(1.5, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonetnode4.testcase b/test/sql_stmt_rttopo_tests/addisonetnode4.testcase
new file mode 100644
index 0000000..acaa22f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonetnode4.testcase
@@ -0,0 +1,7 @@
+AddIsoNetNode - BLOB Network
+:memory: #use in-memory database
+SELECT ST_AddIsoNetNode(zeroblob(9), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNetNode(zeroblob(9), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonetnode5.testcase b/test/sql_stmt_rttopo_tests/addisonetnode5.testcase
new file mode 100644
index 0000000..d75d0b6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonetnode5.testcase
@@ -0,0 +1,7 @@
+AddIsoNetNode - NULL Point
+:memory: #use in-memory database
+SELECT ST_AddIsoNetNode('roads', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNetNode('roads', NULL)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/addisonode1.testcase b/test/sql_stmt_rttopo_tests/addisonode1.testcase
new file mode 100644
index 0000000..51c0ca6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode1.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - NULL Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoNode(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode10.testcase b/test/sql_stmt_rttopo_tests/addisonode10.testcase
new file mode 100644
index 0000000..932a689
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode10.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Double Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode11.testcase b/test/sql_stmt_rttopo_tests/addisonode11.testcase
new file mode 100644
index 0000000..f7e8537
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode11.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode12.testcase b/test/sql_stmt_rttopo_tests/addisonode12.testcase
new file mode 100644
index 0000000..0d00a71
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode12.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Text Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', 'face', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', 'face', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode13.testcase b/test/sql_stmt_rttopo_tests/addisonode13.testcase
new file mode 100644
index 0000000..2a24fa3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode13.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', 'face', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', 'face', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode14.testcase b/test/sql_stmt_rttopo_tests/addisonode14.testcase
new file mode 100644
index 0000000..800c855
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode14.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Linestring Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode15.testcase b/test/sql_stmt_rttopo_tests/addisonode15.testcase
new file mode 100644
index 0000000..533b229
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode15.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode16.testcase b/test/sql_stmt_rttopo_tests/addisonode16.testcase
new file mode 100644
index 0000000..3225af1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode16.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode17.testcase b/test/sql_stmt_rttopo_tests/addisonode17.testcase
new file mode 100644
index 0000000..7e88102
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode17.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - NULL Face
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/addisonode2.testcase b/test/sql_stmt_rttopo_tests/addisonode2.testcase
new file mode 100644
index 0000000..9b0f802
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode2.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Int Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoNode(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode3.testcase b/test/sql_stmt_rttopo_tests/addisonode3.testcase
new file mode 100644
index 0000000..ed02d46
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode3.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Double Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoNode(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode4.testcase b/test/sql_stmt_rttopo_tests/addisonode4.testcase
new file mode 100644
index 0000000..4f87681
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode4.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Blob Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoNode(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode5.testcase b/test/sql_stmt_rttopo_tests/addisonode5.testcase
new file mode 100644
index 0000000..ea99873
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode5.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Text Topology
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/addisonode6.testcase b/test/sql_stmt_rttopo_tests/addisonode6.testcase
new file mode 100644
index 0000000..a3cb94d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode6.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Double Face
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode7.testcase b/test/sql_stmt_rttopo_tests/addisonode7.testcase
new file mode 100644
index 0000000..329037d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode7.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - BLOB Face
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode8.testcase b/test/sql_stmt_rttopo_tests/addisonode8.testcase
new file mode 100644
index 0000000..96046f6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode8.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Text Face
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', 'face', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', 'face', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addisonode9.testcase b/test/sql_stmt_rttopo_tests/addisonode9.testcase
new file mode 100644
index 0000000..d686d3a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addisonode9.testcase
@@ -0,0 +1,7 @@
+AddIsoNode - Int Geometry
+:memory: #use in-memory database
+SELECT ST_AddIsoNode('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_AddIsoNode('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink1.testcase b/test/sql_stmt_rttopo_tests/addlink1.testcase
new file mode 100644
index 0000000..facb486
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink1.testcase
@@ -0,0 +1,7 @@
+AddLink - NULL Network
+:memory: #use in-memory database
+SELECT ST_AddLink(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink(NULL, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink10.testcase b/test/sql_stmt_rttopo_tests/addlink10.testcase
new file mode 100644
index 0000000..7287543
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink10.testcase
@@ -0,0 +1,7 @@
+AddLink - NULL Node To
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1, NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink11.testcase b/test/sql_stmt_rttopo_tests/addlink11.testcase
new file mode 100644
index 0000000..9b4e49f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink11.testcase
@@ -0,0 +1,7 @@
+AddLink - Double Node To
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1, 2.4, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink12.testcase b/test/sql_stmt_rttopo_tests/addlink12.testcase
new file mode 100644
index 0000000..296ac50
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink12.testcase
@@ -0,0 +1,7 @@
+AddLink - Text Node To
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1, 'to', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink13.testcase b/test/sql_stmt_rttopo_tests/addlink13.testcase
new file mode 100644
index 0000000..4597bb2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink13.testcase
@@ -0,0 +1,7 @@
+AddLink - BLOB Node To
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1, zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink2.testcase b/test/sql_stmt_rttopo_tests/addlink2.testcase
new file mode 100644
index 0000000..b57f378
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink2.testcase
@@ -0,0 +1,7 @@
+AddLink - Int Network
+:memory: #use in-memory database
+SELECT ST_AddLink(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink(1, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink3.testcase b/test/sql_stmt_rttopo_tests/addlink3.testcase
new file mode 100644
index 0000000..9ee2c4c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink3.testcase
@@ -0,0 +1,7 @@
+AddLink - Double Network
+:memory: #use in-memory database
+SELECT ST_AddLink(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink(1.2, 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink4.testcase b/test/sql_stmt_rttopo_tests/addlink4.testcase
new file mode 100644
index 0000000..cf9003c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink4.testcase
@@ -0,0 +1,7 @@
+AddLink - BLOB Network
+:memory: #use in-memory database
+SELECT ST_AddLink(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink(zeroblob(4), 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink5.testcase b/test/sql_stmt_rttopo_tests/addlink5.testcase
new file mode 100644
index 0000000..80f21b7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink5.testcase
@@ -0,0 +1,7 @@
+AddLink - Text Network
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/addlink6.testcase b/test/sql_stmt_rttopo_tests/addlink6.testcase
new file mode 100644
index 0000000..5c28f49
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink6.testcase
@@ -0,0 +1,7 @@
+AddLink - NULL Node From
+:memory: #use in-memory database
+SELECT ST_AddLink('net', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', NULL, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink7.testcase b/test/sql_stmt_rttopo_tests/addlink7.testcase
new file mode 100644
index 0000000..936a5ad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink7.testcase
@@ -0,0 +1,7 @@
+AddLink - Double Node From
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 1.3, 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink8.testcase b/test/sql_stmt_rttopo_tests/addlink8.testcase
new file mode 100644
index 0000000..a7eed8d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink8.testcase
@@ -0,0 +1,7 @@
+AddLink - Text Node From
+:memory: #use in-memory database
+SELECT ST_AddLink('net', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', 'from', 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/addlink9.testcase b/test/sql_stmt_rttopo_tests/addlink9.testcase
new file mode 100644
index 0000000..5065cb4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/addlink9.testcase
@@ -0,0 +1,7 @@
+AddLink - BLOB Node From
+:memory: #use in-memory database
+SELECT ST_AddLink('net', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_AddLink('net', zeroblob(4), 2, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom1.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom1.testcase
new file mode 100644
index 0000000..9a6f9dc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom1.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - NULL Topology
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom(NULL, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom(NULL, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom10.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom10.testcase
new file mode 100644
index 0000000..c892586
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom10.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Double Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom11.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom11.testcase
new file mode 100644
index 0000000..f11f581
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom11.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom12.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom12.testcase
new file mode 100644
index 0000000..008e8ae
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom12.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Text Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', 'edge', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', 'edge', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom13.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom13.testcase
new file mode 100644
index 0000000..ab9b9b1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom13.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', 'edge', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', 'edge', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom14.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom14.testcase
new file mode 100644
index 0000000..ccd4617
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom14.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Point Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom15.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom15.testcase
new file mode 100644
index 0000000..10bd960
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom15.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom16.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom16.testcase
new file mode 100644
index 0000000..b677cb9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom16.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - MultiLinestring Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom17.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom17.testcase
new file mode 100644
index 0000000..61d97cd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom17.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - NULL Edge
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom2.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom2.testcase
new file mode 100644
index 0000000..3c72c09
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom2.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Int Topology
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom(1, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom(1, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom3.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom3.testcase
new file mode 100644
index 0000000..1ee36e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom3.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Double Topology
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom(1.5, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom(1.5, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom4.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom4.testcase
new file mode 100644
index 0000000..63b1281
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom4.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Blob Topology
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom(zeroblob(4), -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom(zeroblob(4), -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom5.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom5.testcase
new file mode 100644
index 0000000..f785044
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom5.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Text Topology
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom6.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom6.testcase
new file mode 100644
index 0000000..13fa149
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom6.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Double Edge
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', 2.0, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', 2.0, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom7.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom7.testcase
new file mode 100644
index 0000000..0e07bfc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom7.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - BLOB Edge
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom8.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom8.testcase
new file mode 100644
index 0000000..2b174d3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom8.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Text Edge
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', 'edge', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', 'Edge', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changeedgegeom9.testcase b/test/sql_stmt_rttopo_tests/changeedgegeom9.testcase
new file mode 100644
index 0000000..bd61821
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changeedgegeom9.testcase
@@ -0,0 +1,7 @@
+ChangeEdgeGeom - Int Geometry
+:memory: #use in-memory database
+SELECT ST_ChangeEdgeGeom('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeEdgeGeom('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom1.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom1.testcase
new file mode 100644
index 0000000..0420868
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom1.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - NULL Network
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom(NULL, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom(NULL, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom2.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom2.testcase
new file mode 100644
index 0000000..baebe25
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom2.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Int Network
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom(1, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom(1, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom3.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom3.testcase
new file mode 100644
index 0000000..b495f33
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom3.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Double Network
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom(1.5, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom(1.5, -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom4.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom4.testcase
new file mode 100644
index 0000000..8cc5c41
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom4.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Blob Network
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom(zeroblob(4), -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom(zeroblob(4), -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom5.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom5.testcase
new file mode 100644
index 0000000..754599c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom5.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Text Network
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom6.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom6.testcase
new file mode 100644
index 0000000..de70006
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom6.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Double Link
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom('topology', 2.0, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom('topology', 2.0, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom7.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom7.testcase
new file mode 100644
index 0000000..bd108f2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom7.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - BLOB Link
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom('topology', zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom('topology', zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/changelinkgeom8.testcase b/test/sql_stmt_rttopo_tests/changelinkgeom8.testcase
new file mode 100644
index 0000000..f92e8b3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/changelinkgeom8.testcase
@@ -0,0 +1,7 @@
+ChangeLinkGeom - Text Link
+:memory: #use in-memory database
+SELECT ST_ChangeLinkGeom('topology', 'Link', GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ChangeLinkGeom('topology', 'Link', GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createnetwork1.testcase b/test/sql_stmt_rttopo_tests/createnetwork1.testcase
new file mode 100644
index 0000000..d1d0cc9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork1.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - NULL Network
+:memory: #use in-memory database
+SELECT CreateNetwork(NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork(NULL)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork10.testcase b/test/sql_stmt_rttopo_tests/createnetwork10.testcase
new file mode 100644
index 0000000..1a0c9c2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork10.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Int Spatial
+:memory: #use in-memory database
+SELECT CreateNetwork('roads2', 1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads2', 1)
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork11.testcase b/test/sql_stmt_rttopo_tests/createnetwork11.testcase
new file mode 100644
index 0000000..6c63a0e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork11.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - NULL Srid
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsB', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsB', 1, NULL);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork12.testcase b/test/sql_stmt_rttopo_tests/createnetwork12.testcase
new file mode 100644
index 0000000..64292c2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork12.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Int Srid
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsC', 1, 4326);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsC', 1, 4326);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork13.testcase b/test/sql_stmt_rttopo_tests/createnetwork13.testcase
new file mode 100644
index 0000000..b47780f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork13.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Double Srid
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsD', 1, 1.5);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsD', 1, 1.5);
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork14.testcase b/test/sql_stmt_rttopo_tests/createnetwork14.testcase
new file mode 100644
index 0000000..7bf1f92
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork14.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Text Srid
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, 'alpha');
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork15.testcase b/test/sql_stmt_rttopo_tests/createnetwork15.testcase
new file mode 100644
index 0000000..2d8b57c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork15.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Blob Srid
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, zeroblob(4));
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork16.testcase b/test/sql_stmt_rttopo_tests/createnetwork16.testcase
new file mode 100644
index 0000000..ddfbc4a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork16.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - NULL hasZ
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsZ', 1, 4326, NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsZ', 1, 4326, NULL);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork17.testcase b/test/sql_stmt_rttopo_tests/createnetwork17.testcase
new file mode 100644
index 0000000..e81f47b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork17.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Int hasZ
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsX', 1, 4326, 1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsX', 1, 4326, 1);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork18.testcase b/test/sql_stmt_rttopo_tests/createnetwork18.testcase
new file mode 100644
index 0000000..6ced7e8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork18.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Double hasZ
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsD', 1, 4326, 1.5);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsD', 1, 4326, 1.5);
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork19.testcase b/test/sql_stmt_rttopo_tests/createnetwork19.testcase
new file mode 100644
index 0000000..08c9f1b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork19.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Text hasZ
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, 4326, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, 4326, 'alpha');
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork2.testcase b/test/sql_stmt_rttopo_tests/createnetwork2.testcase
new file mode 100644
index 0000000..785a873
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork2.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Int Network
+:memory: #use in-memory database
+SELECT CreateNetwork(1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork(1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork20.testcase b/test/sql_stmt_rttopo_tests/createnetwork20.testcase
new file mode 100644
index 0000000..bea4295
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork20.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Blob hasZ
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, 4326, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, 4326, zeroblob(4));
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork21.testcase b/test/sql_stmt_rttopo_tests/createnetwork21.testcase
new file mode 100644
index 0000000..9262d79
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork21.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - NULL allow-coincident
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsW', 1, 4326, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsW', 1, 4326, 1, NULL);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork22.testcase b/test/sql_stmt_rttopo_tests/createnetwork22.testcase
new file mode 100644
index 0000000..6db911a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork22.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Int allow-coincident
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsY', 1, 4326, 1, 1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsY', 1, 4326, 1, 1);
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork23.testcase b/test/sql_stmt_rttopo_tests/createnetwork23.testcase
new file mode 100644
index 0000000..3c52dc2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork23.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Double allow-coincident
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsE', 1, 4326, 1, 1.5);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsE', 1, 4326, 1, 1.5);
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork24.testcase b/test/sql_stmt_rttopo_tests/createnetwork24.testcase
new file mode 100644
index 0000000..224c5f9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork24.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Text allow-coincident
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, 4326, 1, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, 4326, 1, 'alpha');
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork25.testcase b/test/sql_stmt_rttopo_tests/createnetwork25.testcase
new file mode 100644
index 0000000..67ec3b1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork25.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Blob allow-coincident
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 1, 4326, 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 1, 4326, 1, zeroblob(4));
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork3.testcase b/test/sql_stmt_rttopo_tests/createnetwork3.testcase
new file mode 100644
index 0000000..f414966
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork3.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Double Network
+:memory: #use in-memory database
+SELECT CreateNetwork(1.1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork(1.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork4.testcase b/test/sql_stmt_rttopo_tests/createnetwork4.testcase
new file mode 100644
index 0000000..5c7f423
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork4.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - BLOB Network
+:memory: #use in-memory database
+SELECT CreateNetwork(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork(zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork5.testcase b/test/sql_stmt_rttopo_tests/createnetwork5.testcase
new file mode 100644
index 0000000..7de4803
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork5.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Text Network
+:memory: #use in-memory database
+SELECT CreateNetwork('roads');
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads')
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork6.testcase b/test/sql_stmt_rttopo_tests/createnetwork6.testcase
new file mode 100644
index 0000000..17b60d7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork6.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - NULL Spatial
+:memory: #use in-memory database
+SELECT CreateNetwork('roadsA', NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roadsA', NULL)
+1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork7.testcase b/test/sql_stmt_rttopo_tests/createnetwork7.testcase
new file mode 100644
index 0000000..e6593f7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork7.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - BLOB Spatial
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork8.testcase b/test/sql_stmt_rttopo_tests/createnetwork8.testcase
new file mode 100644
index 0000000..811e2d0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork8.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - TEXT Spatial
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 'beta');
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 'beta')
+-1
diff --git a/test/sql_stmt_rttopo_tests/createnetwork9.testcase b/test/sql_stmt_rttopo_tests/createnetwork9.testcase
new file mode 100644
index 0000000..2d35364
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createnetwork9.testcase
@@ -0,0 +1,7 @@
+CreateNetwork - Double Spatial
+:memory: #use in-memory database
+SELECT CreateNetwork('roads', 3.1);
+1 # rows (not including the header row)
+1 # columns
+CreateNetwork('roads', 3.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo1.testcase b/test/sql_stmt_rttopo_tests/createtopogeo1.testcase
new file mode 100644
index 0000000..5d494ea
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo1.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - NULL Topology
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo(NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo(NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo10.testcase b/test/sql_stmt_rttopo_tests/createtopogeo10.testcase
new file mode 100644
index 0000000..41be5b8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo10.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - non existing Topology
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo2.testcase b/test/sql_stmt_rttopo_tests/createtopogeo2.testcase
new file mode 100644
index 0000000..a446b76
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo2.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Int Topology
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo(1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo(1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo3.testcase b/test/sql_stmt_rttopo_tests/createtopogeo3.testcase
new file mode 100644
index 0000000..37a0d91
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo3.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Double Topology
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo(1.5, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo(1.5, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo4.testcase b/test/sql_stmt_rttopo_tests/createtopogeo4.testcase
new file mode 100644
index 0000000..7d55abe
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo4.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo(zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo(zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo5.testcase b/test/sql_stmt_rttopo_tests/createtopogeo5.testcase
new file mode 100644
index 0000000..1c013c0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo5.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - NULL GeomCollection
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo6.testcase b/test/sql_stmt_rttopo_tests/createtopogeo6.testcase
new file mode 100644
index 0000000..7bd1c72
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo6.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Int GeomCollection
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo7.testcase b/test/sql_stmt_rttopo_tests/createtopogeo7.testcase
new file mode 100644
index 0000000..9266e2e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo7.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Double GeomCollection
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', 1.4);
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', 1.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo8.testcase b/test/sql_stmt_rttopo_tests/createtopogeo8.testcase
new file mode 100644
index 0000000..c4d7bdc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo8.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Text GeomCollection
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopogeo9.testcase b/test/sql_stmt_rttopo_tests/createtopogeo9.testcase
new file mode 100644
index 0000000..c38551a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopogeo9.testcase
@@ -0,0 +1,7 @@
+ST_CreateTopoGeo - Invalid BLOB GeomCollection
+:memory: #use in-memory database
+SELECT ST_CreateTopoGeo('topology', zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+ST_CreateTopoGeo('topology', zeroblob(100))
+SQL/MM Spatial exception - not a Geometry.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer1.testcase b/test/sql_stmt_rttopo_tests/createtopolayer1.testcase
new file mode 100644
index 0000000..be2127d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer(NULL, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer(NULL, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer10.testcase b/test/sql_stmt_rttopo_tests/createtopolayer10.testcase
new file mode 100644
index 0000000..40e965c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, NULL, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, NULL, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer11.testcase b/test/sql_stmt_rttopo_tests/createtopolayer11.testcase
new file mode 100644
index 0000000..966a218
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - INT ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 1, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 1, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer12.testcase b/test/sql_stmt_rttopo_tests/createtopolayer12.testcase
new file mode 100644
index 0000000..ede6cc7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 1.2, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 1.2, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer13.testcase b/test/sql_stmt_rttopo_tests/createtopolayer13.testcase
new file mode 100644
index 0000000..6c09289
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - BLOB ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, zeroblob(4), NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, zeroblob(4), NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer14.testcase b/test/sql_stmt_rttopo_tests/createtopolayer14.testcase
new file mode 100644
index 0000000..acc786a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'column', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'column', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer15.testcase b/test/sql_stmt_rttopo_tests/createtopolayer15.testcase
new file mode 100644
index 0000000..48e33fc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', 1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer16.testcase b/test/sql_stmt_rttopo_tests/createtopolayer16.testcase
new file mode 100644
index 0000000..8fadd6f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 1.2, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', 1.2, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer17.testcase b/test/sql_stmt_rttopo_tests/createtopolayer17.testcase
new file mode 100644
index 0000000..f4c06e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer18.testcase b/test/sql_stmt_rttopo_tests/createtopolayer18.testcase
new file mode 100644
index 0000000..7f1c70c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - NULL TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer19.testcase b/test/sql_stmt_rttopo_tests/createtopolayer19.testcase
new file mode 100644
index 0000000..d6d6936
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer2.testcase b/test/sql_stmt_rttopo_tests/createtopolayer2.testcase
new file mode 100644
index 0000000..8b9515a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer(1, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer(1, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer20.testcase b/test/sql_stmt_rttopo_tests/createtopolayer20.testcase
new file mode 100644
index 0000000..1ecd25a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - BLOB TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer21.testcase b/test/sql_stmt_rttopo_tests/createtopolayer21.testcase
new file mode 100644
index 0000000..11e4064
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Text TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer22.testcase b/test/sql_stmt_rttopo_tests/createtopolayer22.testcase
new file mode 100644
index 0000000..3e23ac2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - BLOB is-view
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'geometry', 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer23.testcase b/test/sql_stmt_rttopo_tests/createtopolayer23.testcase
new file mode 100644
index 0000000..7c06bc5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - TEXT is-view
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'geometry', 'out', 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out', 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer24.testcase b/test/sql_stmt_rttopo_tests/createtopolayer24.testcase
new file mode 100644
index 0000000..a6c9417
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double is-view
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'geometry', 'out', 1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out', 1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer25.testcase b/test/sql_stmt_rttopo_tests/createtopolayer25.testcase
new file mode 100644
index 0000000..b3076b9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - NULL is-view
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'geometry', 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer26.testcase b/test/sql_stmt_rttopo_tests/createtopolayer26.testcase
new file mode 100644
index 0000000..66f8bfc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Integer is-view
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', 'geometry', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', zeroblob(4), 'out', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer3.testcase b/test/sql_stmt_rttopo_tests/createtopolayer3.testcase
new file mode 100644
index 0000000..b8fd433
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer(1.5, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer(1.5, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer4.testcase b/test/sql_stmt_rttopo_tests/createtopolayer4.testcase
new file mode 100644
index 0000000..8a7d8d8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer(zeroblob(4), NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer(zeroblob(4), NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer5.testcase b/test/sql_stmt_rttopo_tests/createtopolayer5.testcase
new file mode 100644
index 0000000..b16a7ac
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer6.testcase b/test/sql_stmt_rttopo_tests/createtopolayer6.testcase
new file mode 100644
index 0000000..397ebd4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', 'a', 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', 'a', 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer7.testcase b/test/sql_stmt_rttopo_tests/createtopolayer7.testcase
new file mode 100644
index 0000000..fa778b3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', 1, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', 1, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer8.testcase b/test/sql_stmt_rttopo_tests/createtopolayer8.testcase
new file mode 100644
index 0000000..c0d5e65
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', 1.2, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', 1.2, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopolayer9.testcase b/test/sql_stmt_rttopo_tests/createtopolayer9.testcase
new file mode 100644
index 0000000..84e5cf2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopolayer9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_CreateTopoLayer - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_CreateTopoLayer('topology', zeroblob(4), 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_CreateTopoLayer('topology', zeroblob(4), 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/createtopology1.testcase b/test/sql_stmt_rttopo_tests/createtopology1.testcase
new file mode 100644
index 0000000..8c9ffbd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology1.testcase
@@ -0,0 +1,7 @@
+CreateTopology - NULL Topology
+:memory: #use in-memory database
+SELECT CreateTopology(NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology(NULL)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology10.testcase b/test/sql_stmt_rttopo_tests/createtopology10.testcase
new file mode 100644
index 0000000..b49cb34
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology10.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Int Srid
+:memory: #use in-memory database
+SELECT CreateTopology('topo2', 4326);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo2', 4326)
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology11.testcase b/test/sql_stmt_rttopo_tests/createtopology11.testcase
new file mode 100644
index 0000000..bbd8e59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology11.testcase
@@ -0,0 +1,7 @@
+CreateTopology - NULL tolerance
+:memory: #use in-memory database
+SELECT CreateTopology('topoB', 4326, NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoB', 4326, NULL);
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology12.testcase b/test/sql_stmt_rttopo_tests/createtopology12.testcase
new file mode 100644
index 0000000..a18a690
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology12.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Int tolerance
+:memory: #use in-memory database
+SELECT CreateTopology('topoC', 4326, 1);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoC', 4326, 1);
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology13.testcase b/test/sql_stmt_rttopo_tests/createtopology13.testcase
new file mode 100644
index 0000000..72819c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology13.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Double tolerance
+:memory: #use in-memory database
+SELECT CreateTopology('topoD', 4326, 1.5);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoD', 4326, 1.5);
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology14.testcase b/test/sql_stmt_rttopo_tests/createtopology14.testcase
new file mode 100644
index 0000000..07d78f6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology14.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Text tolerance
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 4326, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 4326, 'alpha');
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology15.testcase b/test/sql_stmt_rttopo_tests/createtopology15.testcase
new file mode 100644
index 0000000..97b2430
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology15.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Blob tolerance
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 4326, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 4326, zeroblob(4));
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology16.testcase b/test/sql_stmt_rttopo_tests/createtopology16.testcase
new file mode 100644
index 0000000..941889f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology16.testcase
@@ -0,0 +1,7 @@
+CreateTopology - NULL hasZ
+:memory: #use in-memory database
+SELECT CreateTopology('topoZ', 4326, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoZ', 4326, 1, NULL);
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology17.testcase b/test/sql_stmt_rttopo_tests/createtopology17.testcase
new file mode 100644
index 0000000..e0d3002
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology17.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Int hasZ
+:memory: #use in-memory database
+SELECT CreateTopology('topoX', 4326, 1, 1);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoX', 4326, 1, 1);
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology18.testcase b/test/sql_stmt_rttopo_tests/createtopology18.testcase
new file mode 100644
index 0000000..a520799
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology18.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Double hasZ
+:memory: #use in-memory database
+SELECT CreateTopology('topoD', 4326, 1, 1.5);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoD', 4326, 1, 1.5);
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology19.testcase b/test/sql_stmt_rttopo_tests/createtopology19.testcase
new file mode 100644
index 0000000..4fc32bb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology19.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Text hasZ
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 4326, 1, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 4326, 1, 'alpha');
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology2.testcase b/test/sql_stmt_rttopo_tests/createtopology2.testcase
new file mode 100644
index 0000000..f94663f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology2.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Int Topology
+:memory: #use in-memory database
+SELECT CreateTopology(1);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology(1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology20.testcase b/test/sql_stmt_rttopo_tests/createtopology20.testcase
new file mode 100644
index 0000000..cc799e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology20.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Blob hasZ
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 4326, 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 4326, 1, zeroblob(4));
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology3.testcase b/test/sql_stmt_rttopo_tests/createtopology3.testcase
new file mode 100644
index 0000000..573737d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology3.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Double Topology
+:memory: #use in-memory database
+SELECT CreateTopology(1.1);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology(1.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology4.testcase b/test/sql_stmt_rttopo_tests/createtopology4.testcase
new file mode 100644
index 0000000..8c26ccb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology4.testcase
@@ -0,0 +1,7 @@
+CreateTopology - BLOB Topology
+:memory: #use in-memory database
+SELECT CreateTopology(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateTopology(zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology5.testcase b/test/sql_stmt_rttopo_tests/createtopology5.testcase
new file mode 100644
index 0000000..eb29185
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology5.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Text Topology
+:memory: #use in-memory database
+SELECT CreateTopology('topo1');
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo1')
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology6.testcase b/test/sql_stmt_rttopo_tests/createtopology6.testcase
new file mode 100644
index 0000000..4414e05
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology6.testcase
@@ -0,0 +1,7 @@
+CreateTopology - NULL Srid
+:memory: #use in-memory database
+SELECT CreateTopology('topoA', NULL);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topoA', NULL)
+1
diff --git a/test/sql_stmt_rttopo_tests/createtopology7.testcase b/test/sql_stmt_rttopo_tests/createtopology7.testcase
new file mode 100644
index 0000000..07ea13b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology7.testcase
@@ -0,0 +1,7 @@
+CreateTopology - BLOB Srid
+:memory: #use in-memory database
+SELECT CreateTopology('topo', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology8.testcase b/test/sql_stmt_rttopo_tests/createtopology8.testcase
new file mode 100644
index 0000000..f3ab7e9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology8.testcase
@@ -0,0 +1,7 @@
+CreateTopology - TEXT Srid
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 'alpha');
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 'alpha')
+-1
diff --git a/test/sql_stmt_rttopo_tests/createtopology9.testcase b/test/sql_stmt_rttopo_tests/createtopology9.testcase
new file mode 100644
index 0000000..b614557
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/createtopology9.testcase
@@ -0,0 +1,7 @@
+CreateTopology - Double Srid
+:memory: #use in-memory database
+SELECT CreateTopology('topo', 4326.1);
+1 # rows (not including the header row)
+1 # columns
+CreateTopology('topo', 4326.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/dropnetwork1.testcase b/test/sql_stmt_rttopo_tests/dropnetwork1.testcase
new file mode 100644
index 0000000..a7bfe72
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/dropnetwork1.testcase
@@ -0,0 +1,7 @@
+DropNetwork - NULL Network
+:memory: #use in-memory database
+SELECT DropNetwork(NULL);
+1 # rows (not including the header row)
+1 # columns
+DropNetwork(NULL)
+-1
diff --git a/test/sql_stmt_rttopo_tests/dropnetwork2.testcase b/test/sql_stmt_rttopo_tests/dropnetwork2.testcase
new file mode 100644
index 0000000..a0e4f3e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/dropnetwork2.testcase
@@ -0,0 +1,7 @@
+DropNetwork - Int Network
+:memory: #use in-memory database
+SELECT DropNetwork(1);
+1 # rows (not including the header row)
+1 # columns
+DropNetwork(1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/dropnetwork3.testcase b/test/sql_stmt_rttopo_tests/dropnetwork3.testcase
new file mode 100644
index 0000000..6434d9c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/dropnetwork3.testcase
@@ -0,0 +1,7 @@
+DropNetwork - Double Network
+:memory: #use in-memory database
+SELECT DropNetwork(1.1);
+1 # rows (not including the header row)
+1 # columns
+DropNetwork(1.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/dropnetwork4.testcase b/test/sql_stmt_rttopo_tests/dropnetwork4.testcase
new file mode 100644
index 0000000..3ea2de0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/dropnetwork4.testcase
@@ -0,0 +1,7 @@
+DropNetwork - BLOB Network
+:memory: #use in-memory database
+SELECT DropNetwork(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+DropNetwork(zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/dropnetwork5.testcase b/test/sql_stmt_rttopo_tests/dropnetwork5.testcase
new file mode 100644
index 0000000..c4a12e4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/dropnetwork5.testcase
@@ -0,0 +1,7 @@
+DropNetwork - Text Network
+:memory: #use in-memory database
+SELECT DropNetwork('topoW');
+1 # rows (not including the header row)
+1 # columns
+DropNetwork('topoW')
+0
diff --git a/test/sql_stmt_rttopo_tests/droptopology1.testcase b/test/sql_stmt_rttopo_tests/droptopology1.testcase
new file mode 100644
index 0000000..3fe0c8b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/droptopology1.testcase
@@ -0,0 +1,7 @@
+DropTopology - NULL Topology
+:memory: #use in-memory database
+SELECT DropTopology(NULL);
+1 # rows (not including the header row)
+1 # columns
+DropTopology(NULL)
+-1
diff --git a/test/sql_stmt_rttopo_tests/droptopology2.testcase b/test/sql_stmt_rttopo_tests/droptopology2.testcase
new file mode 100644
index 0000000..2b02c9a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/droptopology2.testcase
@@ -0,0 +1,7 @@
+DropTopology - Int Topology
+:memory: #use in-memory database
+SELECT DropTopology(1);
+1 # rows (not including the header row)
+1 # columns
+DropTopology(1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/droptopology3.testcase b/test/sql_stmt_rttopo_tests/droptopology3.testcase
new file mode 100644
index 0000000..808df47
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/droptopology3.testcase
@@ -0,0 +1,7 @@
+DropTopology - Double Topology
+:memory: #use in-memory database
+SELECT DropTopology(1.1);
+1 # rows (not including the header row)
+1 # columns
+DropTopology(1.1)
+-1
diff --git a/test/sql_stmt_rttopo_tests/droptopology4.testcase b/test/sql_stmt_rttopo_tests/droptopology4.testcase
new file mode 100644
index 0000000..bee35df
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/droptopology4.testcase
@@ -0,0 +1,7 @@
+DropTopology - BLOB Topology
+:memory: #use in-memory database
+SELECT DropTopology(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+DropTopology(zeroblob(4))
+-1
diff --git a/test/sql_stmt_rttopo_tests/droptopology5.testcase b/test/sql_stmt_rttopo_tests/droptopology5.testcase
new file mode 100644
index 0000000..2270e0c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/droptopology5.testcase
@@ -0,0 +1,7 @@
+DropTopology - Text Topology
+:memory: #use in-memory database
+SELECT DropTopology('topoW');
+1 # rows (not including the header row)
+1 # columns
+DropTopology('topoW')
+0
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer1.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer1.testcase
new file mode 100644
index 0000000..74ad9a4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer(NULL, 'topolayer', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(NULL, 'topolayer', 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer10.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer10.testcase
new file mode 100644
index 0000000..c034c39
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Integer output
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer11.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer11.testcase
new file mode 100644
index 0000000..e518de0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Double output
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer12.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer12.testcase
new file mode 100644
index 0000000..c34934b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - BLOB output
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer13.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer13.testcase
new file mode 100644
index 0000000..6718d07
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Text output
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer14.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer14.testcase
new file mode 100644
index 0000000..1b3c991
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - NULL create-only
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer15.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer15.testcase
new file mode 100644
index 0000000..6884d13
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Text create-only
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer16.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer16.testcase
new file mode 100644
index 0000000..fb642c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - BLOB create-only
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer17.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer17.testcase
new file mode 100644
index 0000000..c413ed3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Double create-only
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer18.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer18.testcase
new file mode 100644
index 0000000..e8e66ff
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Integer create-only
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer19.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer19.testcase
new file mode 100644
index 0000000..93b2319
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - NULL with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer2.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer2.testcase
new file mode 100644
index 0000000..10d3da5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Integer Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer(1, 'topolayer', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(1, 'topolayer', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer20.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer20.testcase
new file mode 100644
index 0000000..bf7d655
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - BLOB with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer21.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer21.testcase
new file mode 100644
index 0000000..331db80
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Text with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer22.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer22.testcase
new file mode 100644
index 0000000..79478eb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Double with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer23.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer23.testcase
new file mode 100644
index 0000000..ae6bf9d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Integer with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer3.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer3.testcase
new file mode 100644
index 0000000..9204970
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer(1.5, 'topolayer', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(1.5, 'topolayer', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer4.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer4.testcase
new file mode 100644
index 0000000..4182aa1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer(zeroblob(5), 'topolayer', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(zeroblob(5), 'topolayer', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer5.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer5.testcase
new file mode 100644
index 0000000..0303d59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - NULL TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, NULL, 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer6.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer6.testcase
new file mode 100644
index 0000000..c56fcf1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Integer TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer7.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer7.testcase
new file mode 100644
index 0000000..128b9f5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Double TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 1.5, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 1.5, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer8.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer8.testcase
new file mode 100644
index 0000000..7d3400b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - BLOB TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/exporttopolayer9.testcase b/test/sql_stmt_rttopo_tests/exporttopolayer9.testcase
new file mode 100644
index 0000000..61e3dfb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/exporttopolayer9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - NULL output
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer1.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer1.testcase
new file mode 100644
index 0000000..128a042
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer(NULL, 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(NULL, 'topolayer', 'out', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer10.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer10.testcase
new file mode 100644
index 0000000..fcfb12f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Integer output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', 1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer11.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer11.testcase
new file mode 100644
index 0000000..5bb7905
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Double output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', 1.2, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', 1.2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer12.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer12.testcase
new file mode 100644
index 0000000..1f90bda
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - BLOB output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer13.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer13.testcase
new file mode 100644
index 0000000..7fbea35
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Text output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', 'out', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer14.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer14.testcase
new file mode 100644
index 0000000..5ce72b1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Double FID
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', 'out', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', 'out', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer15.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer15.testcase
new file mode 100644
index 0000000..79441f8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ExportTopoLayer - Text FID
+:memory: #use in-memory database
+SELECT TopoGeo_ExportTopoLayer('topology', 'topolayer', 'out', 'fid');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ExportTopoLayer(topology, 'topolayer', 'out', 'fid')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer16.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer16.testcase
new file mode 100644
index 0000000..a2cef7b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - BLOB FID
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer17.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer17.testcase
new file mode 100644
index 0000000..f987653
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - NULL output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer2.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer2.testcase
new file mode 100644
index 0000000..35e847f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Integer Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer(1, 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(1, 'topolayer', 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer3.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer3.testcase
new file mode 100644
index 0000000..98afe3b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer(1.5, 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(1.5, 'topolayer', 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer4.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer4.testcase
new file mode 100644
index 0000000..7e7b1ba
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer(zeroblob(5), 'topolayer', 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(zeroblob(5), 'topolayer', 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer5.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer5.testcase
new file mode 100644
index 0000000..7bfd0fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - NULL TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', NULL, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, NULL, 'out', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer6.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer6.testcase
new file mode 100644
index 0000000..4bc905a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Integer TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 1, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 1, 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer7.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer7.testcase
new file mode 100644
index 0000000..aa90a8d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - Double TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 1.5, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 1.5, 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer8.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer8.testcase
new file mode 100644
index 0000000..5b1ad0d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - BLOB TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', zeroblob(4), 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, zeroblob(4), 'out', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/featuretopolayer9.testcase b/test/sql_stmt_rttopo_tests/featuretopolayer9.testcase
new file mode 100644
index 0000000..f987653
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/featuretopolayer9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InsertFeatureFromTopoLayer - NULL output
+:memory: #use in-memory database
+SELECT TopoGeo_InsertFeatureFromTopoLayer('topology', 'topolayer', NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InsertFeatureFromTopoLayer(topology, 'topolayer', NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint1.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint1.testcase
new file mode 100644
index 0000000..793fd71
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint1.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - NULL Topology
+:memory: #use in-memory database
+SELECT GetEdgeByPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint10.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint10.testcase
new file mode 100644
index 0000000..971f661
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint10.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Double Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint11.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint11.testcase
new file mode 100644
index 0000000..4dc5a45
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint11.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint12.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint12.testcase
new file mode 100644
index 0000000..2691961
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint12.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Text Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint13.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint13.testcase
new file mode 100644
index 0000000..238b7b7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint13.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint14.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint14.testcase
new file mode 100644
index 0000000..7203aad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint14.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint15.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint15.testcase
new file mode 100644
index 0000000..ce4a659
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint15.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint16.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint16.testcase
new file mode 100644
index 0000000..15436ea
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint16.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint17.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint17.testcase
new file mode 100644
index 0000000..3150d2d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint17.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint2.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint2.testcase
new file mode 100644
index 0000000..8e2205f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint2.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Int Topology
+:memory: #use in-memory database
+SELECT GetEdgeByPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint3.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint3.testcase
new file mode 100644
index 0000000..29e8e09
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint3.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Double Topology
+:memory: #use in-memory database
+SELECT GetEdgeByPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint4.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint4.testcase
new file mode 100644
index 0000000..1e1e788
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint4.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Blob Topology
+:memory: #use in-memory database
+SELECT GetEdgeByPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint5.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint5.testcase
new file mode 100644
index 0000000..c0177f4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint5.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Text Topology
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint6.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint6.testcase
new file mode 100644
index 0000000..d5c266a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint6.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint7.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint7.testcase
new file mode 100644
index 0000000..9873e20
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint7.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint8.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint8.testcase
new file mode 100644
index 0000000..5fa0cd9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint8.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgebypoint9.testcase b/test/sql_stmt_rttopo_tests/getedgebypoint9.testcase
new file mode 100644
index 0000000..a13a55d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgebypoint9.testcase
@@ -0,0 +1,7 @@
+GetEdgeByPoint - Int Geometry
+:memory: #use in-memory database
+SELECT GetEdgeByPoint('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+GetEdgeByPoint('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed1.testcase b/test/sql_stmt_rttopo_tests/getedgeseed1.testcase
new file mode 100644
index 0000000..f2156db
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed1.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed(NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed2.testcase b/test/sql_stmt_rttopo_tests/getedgeseed2.testcase
new file mode 100644
index 0000000..2877bd4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed2.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed(1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed(1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed3.testcase b/test/sql_stmt_rttopo_tests/getedgeseed3.testcase
new file mode 100644
index 0000000..10bc2fa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed3.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed(1.2, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed(1.2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed4.testcase b/test/sql_stmt_rttopo_tests/getedgeseed4.testcase
new file mode 100644
index 0000000..7e09be7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed4.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed(zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed(zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed5.testcase b/test/sql_stmt_rttopo_tests/getedgeseed5.testcase
new file mode 100644
index 0000000..1d40827
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed5.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed6.testcase b/test/sql_stmt_rttopo_tests/getedgeseed6.testcase
new file mode 100644
index 0000000..0a114d6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed6.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - NULL Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed7.testcase b/test/sql_stmt_rttopo_tests/getedgeseed7.testcase
new file mode 100644
index 0000000..befa7bc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed7.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - Double Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed('topology', 1.3);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed('topology', 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed8.testcase b/test/sql_stmt_rttopo_tests/getedgeseed8.testcase
new file mode 100644
index 0000000..dc0e923
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed8.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - Text Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed('topology', 'face');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed('topology', 'face')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getedgeseed9.testcase b/test/sql_stmt_rttopo_tests/getedgeseed9.testcase
new file mode 100644
index 0000000..61beabf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getedgeseed9.testcase
@@ -0,0 +1,7 @@
+GetEdgeSeed - BLOB Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetEdgeSeed('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetEdgeSeed('topology', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint1.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint1.testcase
new file mode 100644
index 0000000..d18f4f2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint1.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - NULL Topology
+:memory: #use in-memory database
+SELECT GetFaceByPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint10.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint10.testcase
new file mode 100644
index 0000000..7dd7424
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint10.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Double Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint11.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint11.testcase
new file mode 100644
index 0000000..04e7ce8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint11.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint12.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint12.testcase
new file mode 100644
index 0000000..0364e22
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint12.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Text Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint13.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint13.testcase
new file mode 100644
index 0000000..6ffa3bc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint13.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint14.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint14.testcase
new file mode 100644
index 0000000..9238daf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint14.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint15.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint15.testcase
new file mode 100644
index 0000000..6fe9b87
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint15.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint16.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint16.testcase
new file mode 100644
index 0000000..643e913
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint16.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint17.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint17.testcase
new file mode 100644
index 0000000..9caacc6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint17.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint2.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint2.testcase
new file mode 100644
index 0000000..f71797b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint2.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Int Topology
+:memory: #use in-memory database
+SELECT GetFaceByPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint3.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint3.testcase
new file mode 100644
index 0000000..c8393dd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint3.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Double Topology
+:memory: #use in-memory database
+SELECT GetFaceByPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint4.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint4.testcase
new file mode 100644
index 0000000..860e0d9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint4.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Blob Topology
+:memory: #use in-memory database
+SELECT GetFaceByPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint5.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint5.testcase
new file mode 100644
index 0000000..7dae2d9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint5.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Text Topology
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint6.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint6.testcase
new file mode 100644
index 0000000..cb67632
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint6.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint7.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint7.testcase
new file mode 100644
index 0000000..cf1c691
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint7.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint8.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint8.testcase
new file mode 100644
index 0000000..39f9cc8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint8.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacebypoint9.testcase b/test/sql_stmt_rttopo_tests/getfacebypoint9.testcase
new file mode 100644
index 0000000..ecb695e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacebypoint9.testcase
@@ -0,0 +1,7 @@
+GetFaceByPoint - Int Geometry
+:memory: #use in-memory database
+SELECT GetFaceByPoint('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+GetFaceByPoint('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges1.testcase b/test/sql_stmt_rttopo_tests/getfaceedges1.testcase
new file mode 100644
index 0000000..1a89ad1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges1.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - NULL Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges2.testcase b/test/sql_stmt_rttopo_tests/getfaceedges2.testcase
new file mode 100644
index 0000000..fffaad7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges2.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Int Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges3.testcase b/test/sql_stmt_rttopo_tests/getfaceedges3.testcase
new file mode 100644
index 0000000..779dc1f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges3.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Double Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges4.testcase b/test/sql_stmt_rttopo_tests/getfaceedges4.testcase
new file mode 100644
index 0000000..2835a5b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges4.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Blob Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges5.testcase b/test/sql_stmt_rttopo_tests/getfaceedges5.testcase
new file mode 100644
index 0000000..e719de5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges5.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Text Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges('topology', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges('topology', -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges6.testcase b/test/sql_stmt_rttopo_tests/getfaceedges6.testcase
new file mode 100644
index 0000000..0927c11
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges6.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Double Face
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges('topology', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges('topology', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges7.testcase b/test/sql_stmt_rttopo_tests/getfaceedges7.testcase
new file mode 100644
index 0000000..02cb214
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges7.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - BLOB Face
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges8.testcase b/test/sql_stmt_rttopo_tests/getfaceedges8.testcase
new file mode 100644
index 0000000..56f8127
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges8.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - Text Face
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges('topology', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges('topology', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceedges9.testcase b/test/sql_stmt_rttopo_tests/getfaceedges9.testcase
new file mode 100644
index 0000000..06571fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceedges9.testcase
@@ -0,0 +1,7 @@
+GetFaceEdges - NULL Face
+:memory: #use in-memory database
+SELECT ST_GetFaceEdges('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceEdges('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry1.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry1.testcase
new file mode 100644
index 0000000..2cca200
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry1.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - NULL Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry(NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry2.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry2.testcase
new file mode 100644
index 0000000..b987572
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry2.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - Int Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry(1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry(1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry3.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry3.testcase
new file mode 100644
index 0000000..fd3e155
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry3.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - Double Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry(1.2, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry(1.2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry4.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry4.testcase
new file mode 100644
index 0000000..ee7251a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry4.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry(zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry(zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry5.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry5.testcase
new file mode 100644
index 0000000..075190e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry5.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - Text Topology
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry6.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry6.testcase
new file mode 100644
index 0000000..3885216
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry6.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - NULL Face
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry7.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry7.testcase
new file mode 100644
index 0000000..4cf161c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry7.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - Double Face
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry('topology', 1.3);
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry('topology', 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry8.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry8.testcase
new file mode 100644
index 0000000..4894004
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry8.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - Text Face
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry('topology', 'face');
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry('topology', 'face')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfacegeometry9.testcase b/test/sql_stmt_rttopo_tests/getfacegeometry9.testcase
new file mode 100644
index 0000000..6d0a868
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfacegeometry9.testcase
@@ -0,0 +1,7 @@
+GetFaceGeometry - BLOB Face
+:memory: #use in-memory database
+SELECT ST_GetFaceGeometry('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_GetFaceGeometry('topology', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed1.testcase b/test/sql_stmt_rttopo_tests/getfaceseed1.testcase
new file mode 100644
index 0000000..bfd1ccf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed1.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed(NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed2.testcase b/test/sql_stmt_rttopo_tests/getfaceseed2.testcase
new file mode 100644
index 0000000..04be969
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed2.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed(1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed(1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed3.testcase b/test/sql_stmt_rttopo_tests/getfaceseed3.testcase
new file mode 100644
index 0000000..fa51133
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed3.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed(1.2, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed(1.2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed4.testcase b/test/sql_stmt_rttopo_tests/getfaceseed4.testcase
new file mode 100644
index 0000000..5ca52b4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed4.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed(zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed(zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed5.testcase b/test/sql_stmt_rttopo_tests/getfaceseed5.testcase
new file mode 100644
index 0000000..6f5b2d5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed5.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed6.testcase b/test/sql_stmt_rttopo_tests/getfaceseed6.testcase
new file mode 100644
index 0000000..bb7c3a0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed6.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - NULL Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed7.testcase b/test/sql_stmt_rttopo_tests/getfaceseed7.testcase
new file mode 100644
index 0000000..80989d5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed7.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - Double Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed('topology', 1.3);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed('topology', 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed8.testcase b/test/sql_stmt_rttopo_tests/getfaceseed8.testcase
new file mode 100644
index 0000000..cdd2ae9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_GetFaceSeed - Text Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed('topology', 'face');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed('topology', 'face')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getfaceseed9.testcase b/test/sql_stmt_rttopo_tests/getfaceseed9.testcase
new file mode 100644
index 0000000..d7817d8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getfaceseed9.testcase
@@ -0,0 +1,7 @@
+GetFaceSeed - BLOB Face
+:memory: #use in-memory database
+SELECT TopoGeo_GetFaceSeed('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_GetFaceSeed('topology', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint1.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint1.testcase
new file mode 100644
index 0000000..5fbab44
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint1.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - NULL Network
+:memory: #use in-memory database
+SELECT GetLinkByPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint10.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint10.testcase
new file mode 100644
index 0000000..3918993
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint10.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Double Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint11.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint11.testcase
new file mode 100644
index 0000000..4bfd475
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint11.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint12.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint12.testcase
new file mode 100644
index 0000000..78c6713
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint12.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Text Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint13.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint13.testcase
new file mode 100644
index 0000000..b0f2c93
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint13.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint14.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint14.testcase
new file mode 100644
index 0000000..756e6b5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint14.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint15.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint15.testcase
new file mode 100644
index 0000000..1f985f5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint15.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint16.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint16.testcase
new file mode 100644
index 0000000..90b49ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint16.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint17.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint17.testcase
new file mode 100644
index 0000000..78b9346
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint17.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint2.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint2.testcase
new file mode 100644
index 0000000..995c3d4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint2.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Int Network
+:memory: #use in-memory database
+SELECT GetLinkByPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint3.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint3.testcase
new file mode 100644
index 0000000..2696613
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint3.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Double Network
+:memory: #use in-memory database
+SELECT GetLinkByPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint4.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint4.testcase
new file mode 100644
index 0000000..d25ad90
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint4.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Blob Network
+:memory: #use in-memory database
+SELECT GetLinkByPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint5.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint5.testcase
new file mode 100644
index 0000000..c0388c7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint5.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Text Network
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint6.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint6.testcase
new file mode 100644
index 0000000..a7a0c4e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint6.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint7.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint7.testcase
new file mode 100644
index 0000000..0b6b5ef
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint7.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint8.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint8.testcase
new file mode 100644
index 0000000..b5a4958
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint8.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkbypoint9.testcase b/test/sql_stmt_rttopo_tests/getlinkbypoint9.testcase
new file mode 100644
index 0000000..feb3276
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkbypoint9.testcase
@@ -0,0 +1,7 @@
+GetLinkByPoint - Int Geometry
+:memory: #use in-memory database
+SELECT GetLinkByPoint('network', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+GetLinkByPoint('network', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed1.testcase b/test/sql_stmt_rttopo_tests/getlinkseed1.testcase
new file mode 100644
index 0000000..4deb2bd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed1.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed(NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed2.testcase b/test/sql_stmt_rttopo_tests/getlinkseed2.testcase
new file mode 100644
index 0000000..65fb4c2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed2.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - Int Topology
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed(1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed(1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed3.testcase b/test/sql_stmt_rttopo_tests/getlinkseed3.testcase
new file mode 100644
index 0000000..4f31243
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed3.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - Double Topology
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed(1.2, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed(1.2, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed4.testcase b/test/sql_stmt_rttopo_tests/getlinkseed4.testcase
new file mode 100644
index 0000000..8616520
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed4.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed(zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed(zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed5.testcase b/test/sql_stmt_rttopo_tests/getlinkseed5.testcase
new file mode 100644
index 0000000..0b7e222
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed5.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - Text Topology
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed('network', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed('network', 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed6.testcase b/test/sql_stmt_rttopo_tests/getlinkseed6.testcase
new file mode 100644
index 0000000..363e03e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed6.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - NULL Face
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed7.testcase b/test/sql_stmt_rttopo_tests/getlinkseed7.testcase
new file mode 100644
index 0000000..9ce573b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed7.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - Double Face
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed('network', 1.3);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed('network', 1.3)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed8.testcase b/test/sql_stmt_rttopo_tests/getlinkseed8.testcase
new file mode 100644
index 0000000..3988766
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed8.testcase
@@ -0,0 +1,7 @@
+TopoNet_GetLinkSeed - Text Face
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed('network', 'face');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed('network', 'face')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getlinkseed9.testcase b/test/sql_stmt_rttopo_tests/getlinkseed9.testcase
new file mode 100644
index 0000000..2ff90d8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getlinkseed9.testcase
@@ -0,0 +1,7 @@
+GetLinkSeed - BLOB Face
+:memory: #use in-memory database
+SELECT TopoNet_GetLinkSeed('network', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_GetLinkSeed('network', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint1.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint1.testcase
new file mode 100644
index 0000000..070fa68
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint1.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - NULL Network
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint10.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint10.testcase
new file mode 100644
index 0000000..9513327
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint10.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Double Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint11.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint11.testcase
new file mode 100644
index 0000000..924b3f9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint11.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint12.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint12.testcase
new file mode 100644
index 0000000..fb28715
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint12.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Text Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint13.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint13.testcase
new file mode 100644
index 0000000..ac76331
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint13.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint14.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint14.testcase
new file mode 100644
index 0000000..11f5104
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint14.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint15.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint15.testcase
new file mode 100644
index 0000000..485c5ae
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint15.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint16.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint16.testcase
new file mode 100644
index 0000000..0532618
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint16.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint17.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint17.testcase
new file mode 100644
index 0000000..b650cfb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint17.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint2.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint2.testcase
new file mode 100644
index 0000000..d9f3757
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint2.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Int Network
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint3.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint3.testcase
new file mode 100644
index 0000000..8378281
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint3.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Double Network
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint4.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint4.testcase
new file mode 100644
index 0000000..6839add
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint4.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Blob Network
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint5.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint5.testcase
new file mode 100644
index 0000000..76ff112
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint5.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Text Network
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint6.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint6.testcase
new file mode 100644
index 0000000..748a5d0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint6.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint7.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint7.testcase
new file mode 100644
index 0000000..bb7f01f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint7.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint8.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint8.testcase
new file mode 100644
index 0000000..d78e20b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint8.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnetnodebypoint9.testcase b/test/sql_stmt_rttopo_tests/getnetnodebypoint9.testcase
new file mode 100644
index 0000000..4f833aa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnetnodebypoint9.testcase
@@ -0,0 +1,7 @@
+GetNetNodeByPoint - Int Geometry
+:memory: #use in-memory database
+SELECT GetNetNodeByPoint('network', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+GetNetNodeByPoint('network', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint1.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint1.testcase
new file mode 100644
index 0000000..4950207
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint1.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - NULL Topology
+:memory: #use in-memory database
+SELECT GetNodeByPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint10.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint10.testcase
new file mode 100644
index 0000000..7662fce
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint10.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Double Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint11.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint11.testcase
new file mode 100644
index 0000000..ee6eae1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint11.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint12.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint12.testcase
new file mode 100644
index 0000000..dcaa861
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint12.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Text Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint13.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint13.testcase
new file mode 100644
index 0000000..ae93c82
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint13.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint14.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint14.testcase
new file mode 100644
index 0000000..44fdb55
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint14.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint15.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint15.testcase
new file mode 100644
index 0000000..97e35f3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint15.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint16.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint16.testcase
new file mode 100644
index 0000000..c7cd209
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint16.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint17.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint17.testcase
new file mode 100644
index 0000000..7446066
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint17.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint2.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint2.testcase
new file mode 100644
index 0000000..6e4445f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint2.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Int Topology
+:memory: #use in-memory database
+SELECT GetNodeByPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint3.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint3.testcase
new file mode 100644
index 0000000..0c5e72f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint3.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Double Topology
+:memory: #use in-memory database
+SELECT GetNodeByPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint4.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint4.testcase
new file mode 100644
index 0000000..90623bd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint4.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Blob Topology
+:memory: #use in-memory database
+SELECT GetNodeByPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint5.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint5.testcase
new file mode 100644
index 0000000..d178ea6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint5.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Text Topology
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint6.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint6.testcase
new file mode 100644
index 0000000..04ab5f6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint6.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint7.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint7.testcase
new file mode 100644
index 0000000..86bf2ec
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint7.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint8.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint8.testcase
new file mode 100644
index 0000000..7399c4d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint8.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/getnodebypoint9.testcase b/test/sql_stmt_rttopo_tests/getnodebypoint9.testcase
new file mode 100644
index 0000000..ceae0c3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/getnodebypoint9.testcase
@@ -0,0 +1,7 @@
+GetNodeByPoint - Int Geometry
+:memory: #use in-memory database
+SELECT GetNodeByPoint('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+GetNodeByPoint('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer1.testcase b/test/sql_stmt_rttopo_tests/inittopolayer1.testcase
new file mode 100644
index 0000000..8135c59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer(NULL, NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer(NULL, NULL, 'table', 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer10.testcase b/test/sql_stmt_rttopo_tests/inittopolayer10.testcase
new file mode 100644
index 0000000..7a1790f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer11.testcase b/test/sql_stmt_rttopo_tests/inittopolayer11.testcase
new file mode 100644
index 0000000..8fb55aa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - INT ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer12.testcase b/test/sql_stmt_rttopo_tests/inittopolayer12.testcase
new file mode 100644
index 0000000..f64d3b4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Double ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 1.2, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 1.2, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer13.testcase b/test/sql_stmt_rttopo_tests/inittopolayer13.testcase
new file mode 100644
index 0000000..1eccbfa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - BLOB ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer14.testcase b/test/sql_stmt_rttopo_tests/inittopolayer14.testcase
new file mode 100644
index 0000000..aaadc7e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - NULL TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 'table', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer15.testcase b/test/sql_stmt_rttopo_tests/inittopolayer15.testcase
new file mode 100644
index 0000000..3cb580b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Double TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 'table', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 'table', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer16.testcase b/test/sql_stmt_rttopo_tests/inittopolayer16.testcase
new file mode 100644
index 0000000..d3b0631
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - BLOB TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 'table', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 'table', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer17.testcase b/test/sql_stmt_rttopo_tests/inittopolayer17.testcase
new file mode 100644
index 0000000..c84f10d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Text TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 'table', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer2.testcase b/test/sql_stmt_rttopo_tests/inittopolayer2.testcase
new file mode 100644
index 0000000..e88bb6c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer(1, NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer(1, NULL, 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer3.testcase b/test/sql_stmt_rttopo_tests/inittopolayer3.testcase
new file mode 100644
index 0000000..7a01852
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer(1.5, NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer(1.5, NULL, 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer4.testcase b/test/sql_stmt_rttopo_tests/inittopolayer4.testcase
new file mode 100644
index 0000000..feed6d5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer(zeroblob(4), NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer(zeroblob(4), NULL, 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer5.testcase b/test/sql_stmt_rttopo_tests/inittopolayer5.testcase
new file mode 100644
index 0000000..2cd9e5d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', NULL, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', NULL, 'table', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer6.testcase b/test/sql_stmt_rttopo_tests/inittopolayer6.testcase
new file mode 100644
index 0000000..ea181cc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', 'a', 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', 'a', 'table', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer7.testcase b/test/sql_stmt_rttopo_tests/inittopolayer7.testcase
new file mode 100644
index 0000000..7ca3f00
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', 1, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', 1, 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer8.testcase b/test/sql_stmt_rttopo_tests/inittopolayer8.testcase
new file mode 100644
index 0000000..6fe7872
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', 1.2, 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', 1.2, 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/inittopolayer9.testcase b/test/sql_stmt_rttopo_tests/inittopolayer9.testcase
new file mode 100644
index 0000000..7618cd0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/inittopolayer9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_InitTopoLayer - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_InitTopoLayer('topology', zeroblob(4), 'table', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_InitTopoLayer('topology', zeroblob(4), 'table', 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed1.testcase b/test/sql_stmt_rttopo_tests/linesnapseed1.testcase
new file mode 100644
index 0000000..551fa38
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed10.testcase b/test/sql_stmt_rttopo_tests/linesnapseed10.testcase
new file mode 100644
index 0000000..4bcb69f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed11.testcase b/test/sql_stmt_rttopo_tests/linesnapseed11.testcase
new file mode 100644
index 0000000..7132e95
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - TEXT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 'dist');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 'dist')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed12.testcase b/test/sql_stmt_rttopo_tests/linesnapseed12.testcase
new file mode 100644
index 0000000..083766c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - BLOB distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', zeroblob(5));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', zeroblob(5))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed13.testcase b/test/sql_stmt_rttopo_tests/linesnapseed13.testcase
new file mode 100644
index 0000000..6e22eea
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed14.testcase b/test/sql_stmt_rttopo_tests/linesnapseed14.testcase
new file mode 100644
index 0000000..b422891
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 'topo', 1.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed15.testcase b/test/sql_stmt_rttopo_tests/linesnapseed15.testcase
new file mode 100644
index 0000000..ba269c2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - point instead of line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('POINT(1 1)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('POINT((1 1)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed16.testcase b/test/sql_stmt_rttopo_tests/linesnapseed16.testcase
new file mode 100644
index 0000000..8fe522d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - multilinestring instead of linestring
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('MULTILINESTRING((1 1, 1 2), (2 2, 3 3))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('MULTILINESTRING((1 1, 1 2), (2 2, 3 3))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed17.testcase b/test/sql_stmt_rttopo_tests/linesnapseed17.testcase
new file mode 100644
index 0000000..d725c00
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - polygon instead of line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed2.testcase b/test/sql_stmt_rttopo_tests/linesnapseed2.testcase
new file mode 100644
index 0000000..014a974
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed3.testcase b/test/sql_stmt_rttopo_tests/linesnapseed3.testcase
new file mode 100644
index 0000000..cf22970
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1.1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), 1.1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed4.testcase b/test/sql_stmt_rttopo_tests/linesnapseed4.testcase
new file mode 100644
index 0000000..b56b301
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(ST_GeomFromText('LINESTRING(1 1, 1 2)'), zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed5.testcase b/test/sql_stmt_rttopo_tests/linesnapseed5.testcase
new file mode 100644
index 0000000..4a4a5fc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - NULL line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(NULL, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(NULL, 'topo', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed6.testcase b/test/sql_stmt_rttopo_tests/linesnapseed6.testcase
new file mode 100644
index 0000000..90d8cb1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - INT line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed7.testcase b/test/sql_stmt_rttopo_tests/linesnapseed7.testcase
new file mode 100644
index 0000000..4dc6eee
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - DOUBLE line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(1.1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(1.1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed8.testcase b/test/sql_stmt_rttopo_tests/linesnapseed8.testcase
new file mode 100644
index 0000000..03115fd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - TEXT line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed('line', 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed('line', 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/linesnapseed9.testcase b/test/sql_stmt_rttopo_tests/linesnapseed9.testcase
new file mode 100644
index 0000000..40de20c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/linesnapseed9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapLineToSeed - invalid BLOB line
+:memory: #use in-memory database
+SELECT TopoGeo_SnapLineToSeed(zeroblob(100), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapLineToSeed(zeroblob(100), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo1.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo1.testcase
new file mode 100644
index 0000000..c95a27b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo1.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - NULL Network
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo(NULL, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo(NULL, 'topology')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo2.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo2.testcase
new file mode 100644
index 0000000..e20461b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo2.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - Int Network
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo(1, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo(1, 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo3.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo3.testcase
new file mode 100644
index 0000000..bb6bd55
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo3.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - Double Network
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo(1.5, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo(1.5, 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo4.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo4.testcase
new file mode 100644
index 0000000..311fd93
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo4.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - Blob Network
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo(zeroblob(4), 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo(zeroblob(4), 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo5.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo5.testcase
new file mode 100644
index 0000000..77ea01c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo5.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - Text Network
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo('network', 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo('network', 'topology')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo6.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo6.testcase
new file mode 100644
index 0000000..be84039
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo6.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - NULL Topology
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo7.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo7.testcase
new file mode 100644
index 0000000..077e891
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo7.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - INT Topology
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo('network', 1);
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo('network', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo8.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo8.testcase
new file mode 100644
index 0000000..3b664c6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo8.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - Double Topology
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo('network', 1.2);
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo('network', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/loginetfromtgeo9.testcase b/test/sql_stmt_rttopo_tests/loginetfromtgeo9.testcase
new file mode 100644
index 0000000..3e201ce
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/loginetfromtgeo9.testcase
@@ -0,0 +1,7 @@
+ST_LogiNetFromTGeo - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_LogiNetFromTGeo('network', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_LogiNetFromTGeo('network', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal1.testcase b/test/sql_stmt_rttopo_tests/modedgeheal1.testcase
new file mode 100644
index 0000000..eb891ad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal1.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - NULL Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal(NULL, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal(NULL, 1, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal10.testcase b/test/sql_stmt_rttopo_tests/modedgeheal10.testcase
new file mode 100644
index 0000000..1ed6227
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal10.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - NULL Edge #2
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal11.testcase b/test/sql_stmt_rttopo_tests/modedgeheal11.testcase
new file mode 100644
index 0000000..5edb338
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal11.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Double Edge #2
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1, 2.4);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1, 2.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal12.testcase b/test/sql_stmt_rttopo_tests/modedgeheal12.testcase
new file mode 100644
index 0000000..0fffaaa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal12.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Text Edge #2
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1, 'to');
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1, 'to')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal13.testcase b/test/sql_stmt_rttopo_tests/modedgeheal13.testcase
new file mode 100644
index 0000000..3a1227f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal13.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - BLOB Edge #2
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal2.testcase b/test/sql_stmt_rttopo_tests/modedgeheal2.testcase
new file mode 100644
index 0000000..8aae8cc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal2.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Int Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal(1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal(1, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal3.testcase b/test/sql_stmt_rttopo_tests/modedgeheal3.testcase
new file mode 100644
index 0000000..e077bc8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal3.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Double Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal(1.2, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal(1.2, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal4.testcase b/test/sql_stmt_rttopo_tests/modedgeheal4.testcase
new file mode 100644
index 0000000..f35a324
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal4.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal(zeroblob(4), 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal(zeroblob(4), 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal5.testcase b/test/sql_stmt_rttopo_tests/modedgeheal5.testcase
new file mode 100644
index 0000000..35803cb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal5.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Text Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1, 2)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal6.testcase b/test/sql_stmt_rttopo_tests/modedgeheal6.testcase
new file mode 100644
index 0000000..26671ba
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal6.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - NULL Edge #1
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', NULL, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', NULL, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal7.testcase b/test/sql_stmt_rttopo_tests/modedgeheal7.testcase
new file mode 100644
index 0000000..a283ff1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal7.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Double Edge #1
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 1.3, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 1.3, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal8.testcase b/test/sql_stmt_rttopo_tests/modedgeheal8.testcase
new file mode 100644
index 0000000..59873b0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal8.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - Text Edge #1
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', 'from', 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', 'from', 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgeheal9.testcase b/test/sql_stmt_rttopo_tests/modedgeheal9.testcase
new file mode 100644
index 0000000..2361b34
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgeheal9.testcase
@@ -0,0 +1,7 @@
+ModEdgeHeal - BLOB Edge #1
+:memory: #use in-memory database
+SELECT ST_ModEdgeHeal('topology', zeroblob(4), 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeHeal('topology', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit1.testcase b/test/sql_stmt_rttopo_tests/modedgesplit1.testcase
new file mode 100644
index 0000000..aaa1635
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit1.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - NULL Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit10.testcase b/test/sql_stmt_rttopo_tests/modedgesplit10.testcase
new file mode 100644
index 0000000..fd54863
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit10.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Double Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit11.testcase b/test/sql_stmt_rttopo_tests/modedgesplit11.testcase
new file mode 100644
index 0000000..64e8fcc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit11.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit12.testcase b/test/sql_stmt_rttopo_tests/modedgesplit12.testcase
new file mode 100644
index 0000000..9031702
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit12.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Text Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', 'face', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', 'face', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit13.testcase b/test/sql_stmt_rttopo_tests/modedgesplit13.testcase
new file mode 100644
index 0000000..e57d1b4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit13.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', 'face', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', 'face', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit14.testcase b/test/sql_stmt_rttopo_tests/modedgesplit14.testcase
new file mode 100644
index 0000000..7e2f92a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit14.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Linestring Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit15.testcase b/test/sql_stmt_rttopo_tests/modedgesplit15.testcase
new file mode 100644
index 0000000..3e6d98a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit15.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit16.testcase b/test/sql_stmt_rttopo_tests/modedgesplit16.testcase
new file mode 100644
index 0000000..49ac09f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit16.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit2.testcase b/test/sql_stmt_rttopo_tests/modedgesplit2.testcase
new file mode 100644
index 0000000..61dc9ff
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit2.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Int Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit3.testcase b/test/sql_stmt_rttopo_tests/modedgesplit3.testcase
new file mode 100644
index 0000000..102facf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit3.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Double Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit4.testcase b/test/sql_stmt_rttopo_tests/modedgesplit4.testcase
new file mode 100644
index 0000000..ee952c5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit4.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Blob Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit5.testcase b/test/sql_stmt_rttopo_tests/modedgesplit5.testcase
new file mode 100644
index 0000000..6e7aa58
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit5.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Text Topology
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit6.testcase b/test/sql_stmt_rttopo_tests/modedgesplit6.testcase
new file mode 100644
index 0000000..c872950
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit6.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Double Face
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit7.testcase b/test/sql_stmt_rttopo_tests/modedgesplit7.testcase
new file mode 100644
index 0000000..319313c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit7.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - BLOB Face
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit8.testcase b/test/sql_stmt_rttopo_tests/modedgesplit8.testcase
new file mode 100644
index 0000000..a2760c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit8.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Text Face
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', 'face', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', 'face', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modedgesplit9.testcase b/test/sql_stmt_rttopo_tests/modedgesplit9.testcase
new file mode 100644
index 0000000..a64fab2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modedgesplit9.testcase
@@ -0,0 +1,7 @@
+ModEdgeSplit - Int Geometry
+:memory: #use in-memory database
+SELECT ST_ModEdgeSplit('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModEdgeSplit('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit1.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit1.testcase
new file mode 100644
index 0000000..dcbf2c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit1.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - NULL Network
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit2.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit2.testcase
new file mode 100644
index 0000000..91f8d00
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit2.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Int Network
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit3.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit3.testcase
new file mode 100644
index 0000000..3cb14f6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit3.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Double Network
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit4.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit4.testcase
new file mode 100644
index 0000000..1df3abd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit4.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Blob Network
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit5.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit5.testcase
new file mode 100644
index 0000000..3e8f46b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit5.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Text Network
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit('net', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit('net', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit6.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit6.testcase
new file mode 100644
index 0000000..b304424
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit6.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Double Link
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit('net', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit('net', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit7.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit7.testcase
new file mode 100644
index 0000000..e92ebee
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit7.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - BLOB Link
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit('net', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit('net', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit8.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit8.testcase
new file mode 100644
index 0000000..8c50735
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit8.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Text Link
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit('net', 'link', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit('net', 'link', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modgeolinksplit9.testcase b/test/sql_stmt_rttopo_tests/modgeolinksplit9.testcase
new file mode 100644
index 0000000..726196e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modgeolinksplit9.testcase
@@ -0,0 +1,7 @@
+ModGeoLinkSplit - Int Geometry
+:memory: #use in-memory database
+SELECT ST_ModGeoLinkSplit('net', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModGeoLinkSplit('net', -1, 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal1.testcase b/test/sql_stmt_rttopo_tests/modlinkheal1.testcase
new file mode 100644
index 0000000..2d7f465
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal1.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - NULL Network
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal(NULL, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal(NULL, 1, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal10.testcase b/test/sql_stmt_rttopo_tests/modlinkheal10.testcase
new file mode 100644
index 0000000..b6ee63b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal10.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - NULL Link #2
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal11.testcase b/test/sql_stmt_rttopo_tests/modlinkheal11.testcase
new file mode 100644
index 0000000..cbcc4d7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal11.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Double Link #2
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 1, 2.4);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 1, 2.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal12.testcase b/test/sql_stmt_rttopo_tests/modlinkheal12.testcase
new file mode 100644
index 0000000..82c0ebd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal12.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Text Link #2
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 1, 'to');
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 1, 'to')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal13.testcase b/test/sql_stmt_rttopo_tests/modlinkheal13.testcase
new file mode 100644
index 0000000..d9ca1bb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal13.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - BLOB Link #2
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal2.testcase b/test/sql_stmt_rttopo_tests/modlinkheal2.testcase
new file mode 100644
index 0000000..dec1347
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal2.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Int Network
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal(1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal(1, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal3.testcase b/test/sql_stmt_rttopo_tests/modlinkheal3.testcase
new file mode 100644
index 0000000..8bccbae
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal3.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Double Network
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal(1.2, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal(1.2, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal4.testcase b/test/sql_stmt_rttopo_tests/modlinkheal4.testcase
new file mode 100644
index 0000000..3957a1c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal4.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - BLOB Network
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal(zeroblob(4), 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal(zeroblob(4), 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal5.testcase b/test/sql_stmt_rttopo_tests/modlinkheal5.testcase
new file mode 100644
index 0000000..7388e41
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal5.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Text Network
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('topology', 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('topology', 1, 2)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal6.testcase b/test/sql_stmt_rttopo_tests/modlinkheal6.testcase
new file mode 100644
index 0000000..36b10ac
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal6.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - NULL Link #1
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', NULL, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', NULL, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal7.testcase b/test/sql_stmt_rttopo_tests/modlinkheal7.testcase
new file mode 100644
index 0000000..3b3e712
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal7.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Double Link #1
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 1.3, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 1.3, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal8.testcase b/test/sql_stmt_rttopo_tests/modlinkheal8.testcase
new file mode 100644
index 0000000..b41c5fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal8.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - Text Link #1
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', 'from', 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', 'from', 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modlinkheal9.testcase b/test/sql_stmt_rttopo_tests/modlinkheal9.testcase
new file mode 100644
index 0000000..a5fa15e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modlinkheal9.testcase
@@ -0,0 +1,7 @@
+ModLinkHeal - BLOB Link #1
+:memory: #use in-memory database
+SELECT ST_ModLinkHeal('net', zeroblob(4), 2);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLinkHeal('net', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit1.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit1.testcase
new file mode 100644
index 0000000..1b94a61
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit1.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - NULL Network
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit2.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit2.testcase
new file mode 100644
index 0000000..7dbe0b9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit2.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Int Network
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit3.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit3.testcase
new file mode 100644
index 0000000..b486d16
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit3.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Double Network
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit4.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit4.testcase
new file mode 100644
index 0000000..6bf1b03
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit4.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Blob Network
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit5.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit5.testcase
new file mode 100644
index 0000000..7245920
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit5.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Text Network
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit('net', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit('net', -1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit6.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit6.testcase
new file mode 100644
index 0000000..1ffc813
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit6.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Double Link
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit('net', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit('net', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit7.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit7.testcase
new file mode 100644
index 0000000..414cdb7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit7.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - BLOB Link
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit('net', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit('net', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit8.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit8.testcase
new file mode 100644
index 0000000..c45c900
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit8.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - Text Link
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit('net', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit('net', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/modloglinksplit9.testcase b/test/sql_stmt_rttopo_tests/modloglinksplit9.testcase
new file mode 100644
index 0000000..0c7e453
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/modloglinksplit9.testcase
@@ -0,0 +1,7 @@
+ModLogLinkSplit - NULL Link
+:memory: #use in-memory database
+SELECT ST_ModLogLinkSplit('net', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ModLogLinkSplit('net', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode1.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode1.testcase
new file mode 100644
index 0000000..f7c1b0e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode1.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - NULL Network
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode2.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode2.testcase
new file mode 100644
index 0000000..1042f8b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode2.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - Int Network
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode3.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode3.testcase
new file mode 100644
index 0000000..fbf03db
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode3.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - Double Network
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode4.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode4.testcase
new file mode 100644
index 0000000..30808e6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode4.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - Blob Network
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode5.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode5.testcase
new file mode 100644
index 0000000..cb2f1a7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode5.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - Double Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode('net', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode('net', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode6.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode6.testcase
new file mode 100644
index 0000000..c835c93
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode6.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - BLOB Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode('net', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode('net', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode7.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode7.testcase
new file mode 100644
index 0000000..be88dc1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode7.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - Text Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode('net', 'node', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode('net', 'node', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode8.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode8.testcase
new file mode 100644
index 0000000..585a484
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode8.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - NULL Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode('net', NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNode('net', NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonetnode9.testcase b/test/sql_stmt_rttopo_tests/moveisonetnode9.testcase
new file mode 100644
index 0000000..865eea0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonetnode9.testcase
@@ -0,0 +1,7 @@
+MoveIsoNetNode - invalid network
+:memory: #use in-memory database
+SELECT ST_MoveIsoNetNode('net', 1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNetNetNode('net', 1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode1.testcase b/test/sql_stmt_rttopo_tests/moveisonode1.testcase
new file mode 100644
index 0000000..0842635
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode1.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - NULL Topology
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode10.testcase b/test/sql_stmt_rttopo_tests/moveisonode10.testcase
new file mode 100644
index 0000000..a1b38da
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode10.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Double Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode11.testcase b/test/sql_stmt_rttopo_tests/moveisonode11.testcase
new file mode 100644
index 0000000..46908c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode11.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode12.testcase b/test/sql_stmt_rttopo_tests/moveisonode12.testcase
new file mode 100644
index 0000000..1f22339
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode12.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Text Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', 'face', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', 'face', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode13.testcase b/test/sql_stmt_rttopo_tests/moveisonode13.testcase
new file mode 100644
index 0000000..8ed06c0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode13.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', 'face', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', 'face', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode14.testcase b/test/sql_stmt_rttopo_tests/moveisonode14.testcase
new file mode 100644
index 0000000..44f29c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode14.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Linestring Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode15.testcase b/test/sql_stmt_rttopo_tests/moveisonode15.testcase
new file mode 100644
index 0000000..031a66b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode15.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode16.testcase b/test/sql_stmt_rttopo_tests/moveisonode16.testcase
new file mode 100644
index 0000000..e3a061b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode16.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode17.testcase b/test/sql_stmt_rttopo_tests/moveisonode17.testcase
new file mode 100644
index 0000000..10b3b5f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode17.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - NULL Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode2.testcase b/test/sql_stmt_rttopo_tests/moveisonode2.testcase
new file mode 100644
index 0000000..50ad7cc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode2.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Int Topology
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode3.testcase b/test/sql_stmt_rttopo_tests/moveisonode3.testcase
new file mode 100644
index 0000000..f7c1a38
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode3.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Double Topology
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode4.testcase b/test/sql_stmt_rttopo_tests/moveisonode4.testcase
new file mode 100644
index 0000000..50e816e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode4.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Blob Topology
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode5.testcase b/test/sql_stmt_rttopo_tests/moveisonode5.testcase
new file mode 100644
index 0000000..00b59c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode5.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Text Topology
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode6.testcase b/test/sql_stmt_rttopo_tests/moveisonode6.testcase
new file mode 100644
index 0000000..4fbac34
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode6.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Double Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode7.testcase b/test/sql_stmt_rttopo_tests/moveisonode7.testcase
new file mode 100644
index 0000000..25b761b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode7.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - BLOB Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode8.testcase b/test/sql_stmt_rttopo_tests/moveisonode8.testcase
new file mode 100644
index 0000000..e90ac08
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode8.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Text Node
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', 'node', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', 'node', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/moveisonode9.testcase b/test/sql_stmt_rttopo_tests/moveisonode9.testcase
new file mode 100644
index 0000000..02e4276
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/moveisonode9.testcase
@@ -0,0 +1,7 @@
+MoveIsoNode - Int Geometry
+:memory: #use in-memory database
+SELECT ST_MoveIsoNode('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_MoveIsoNode('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/netexception1.testcase b/test/sql_stmt_rttopo_tests/netexception1.testcase
new file mode 100644
index 0000000..03e0e1b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/netexception1.testcase
@@ -0,0 +1,7 @@
+GetLastNetworkException - NULL Network
+:memory: #use in-memory database
+SELECT GetLastNetworkException(NULL);
+1 # rows (not including the header row)
+1 # columns
+GetLastNetworkException(NULL)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/netexception2.testcase b/test/sql_stmt_rttopo_tests/netexception2.testcase
new file mode 100644
index 0000000..3040e15
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/netexception2.testcase
@@ -0,0 +1,7 @@
+GetLastNetworkException - Undefined Network
+:memory: #use in-memory database
+SELECT GetLastNetworkException('net');
+1 # rows (not including the header row)
+1 # columns
+GetLastNetworkException('net')
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal1.testcase b/test/sql_stmt_rttopo_tests/newedgeheal1.testcase
new file mode 100644
index 0000000..41f166b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal1.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - NULL Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal(NULL, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal(NULL, 1, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal10.testcase b/test/sql_stmt_rttopo_tests/newedgeheal10.testcase
new file mode 100644
index 0000000..bf4e84a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal10.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - NULL Edge #2
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal11.testcase b/test/sql_stmt_rttopo_tests/newedgeheal11.testcase
new file mode 100644
index 0000000..767f0a2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal11.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Double Edge #2
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1, 2.4);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1, 2.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal12.testcase b/test/sql_stmt_rttopo_tests/newedgeheal12.testcase
new file mode 100644
index 0000000..aee15fc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal12.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Text Edge #2
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1, 'to');
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1, 'to')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal13.testcase b/test/sql_stmt_rttopo_tests/newedgeheal13.testcase
new file mode 100644
index 0000000..4724897
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal13.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - BLOB Edge #2
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal2.testcase b/test/sql_stmt_rttopo_tests/newedgeheal2.testcase
new file mode 100644
index 0000000..fdc57b5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal2.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Int Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal(1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal(1, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal3.testcase b/test/sql_stmt_rttopo_tests/newedgeheal3.testcase
new file mode 100644
index 0000000..56a64b2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal3.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Double Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal(1.2, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal(1.2, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal4.testcase b/test/sql_stmt_rttopo_tests/newedgeheal4.testcase
new file mode 100644
index 0000000..a3fcffe
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal4.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal(zeroblob(4), 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal(zeroblob(4), 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal5.testcase b/test/sql_stmt_rttopo_tests/newedgeheal5.testcase
new file mode 100644
index 0000000..7556a03
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal5.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Text Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1, 2)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal6.testcase b/test/sql_stmt_rttopo_tests/newedgeheal6.testcase
new file mode 100644
index 0000000..bb6ea7d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal6.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - NULL Edge #1
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', NULL, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', NULL, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal7.testcase b/test/sql_stmt_rttopo_tests/newedgeheal7.testcase
new file mode 100644
index 0000000..31d4f9d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal7.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Double Edge #1
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 1.3, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 1.3, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal8.testcase b/test/sql_stmt_rttopo_tests/newedgeheal8.testcase
new file mode 100644
index 0000000..f26aa50
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal8.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - Text Edge #1
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', 'from', 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', 'from', 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgeheal9.testcase b/test/sql_stmt_rttopo_tests/newedgeheal9.testcase
new file mode 100644
index 0000000..77b6146
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgeheal9.testcase
@@ -0,0 +1,7 @@
+NewEdgeHeal - BLOB Edge #1
+:memory: #use in-memory database
+SELECT ST_NewEdgeHeal('topology', zeroblob(4), 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgeHeal('topology', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit1.testcase b/test/sql_stmt_rttopo_tests/newedgessplit1.testcase
new file mode 100644
index 0000000..124f61e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit1.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - NULL Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit10.testcase b/test/sql_stmt_rttopo_tests/newedgessplit10.testcase
new file mode 100644
index 0000000..fb7ba59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit10.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Double Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit11.testcase b/test/sql_stmt_rttopo_tests/newedgessplit11.testcase
new file mode 100644
index 0000000..8eda94e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit11.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - NULL Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit12.testcase b/test/sql_stmt_rttopo_tests/newedgessplit12.testcase
new file mode 100644
index 0000000..e3ba519
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit12.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Text Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', 'face', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', 'face', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit13.testcase b/test/sql_stmt_rttopo_tests/newedgessplit13.testcase
new file mode 100644
index 0000000..4ecb492
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit13.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', 'face', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', 'face', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit14.testcase b/test/sql_stmt_rttopo_tests/newedgessplit14.testcase
new file mode 100644
index 0000000..2b84bcb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit14.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Linestring Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, GeomFromText('LINESTRING(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit15.testcase b/test/sql_stmt_rttopo_tests/newedgessplit15.testcase
new file mode 100644
index 0000000..48ae346
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit15.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Polygon Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit16.testcase b/test/sql_stmt_rttopo_tests/newedgessplit16.testcase
new file mode 100644
index 0000000..a3590d9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit16.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, GeomFromText('MULTIPOINT(0 0, 1 1)', 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit2.testcase b/test/sql_stmt_rttopo_tests/newedgessplit2.testcase
new file mode 100644
index 0000000..f711312
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit2.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Int Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit3.testcase b/test/sql_stmt_rttopo_tests/newedgessplit3.testcase
new file mode 100644
index 0000000..5ed4e63
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit3.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Double Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit4.testcase b/test/sql_stmt_rttopo_tests/newedgessplit4.testcase
new file mode 100644
index 0000000..6244de5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit4.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Blob Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit5.testcase b/test/sql_stmt_rttopo_tests/newedgessplit5.testcase
new file mode 100644
index 0000000..5d247df
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit5.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Text Topology
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit6.testcase b/test/sql_stmt_rttopo_tests/newedgessplit6.testcase
new file mode 100644
index 0000000..a6517ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit6.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Double Face
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit7.testcase b/test/sql_stmt_rttopo_tests/newedgessplit7.testcase
new file mode 100644
index 0000000..7e0d355
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit7.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - BLOB Face
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit8.testcase b/test/sql_stmt_rttopo_tests/newedgessplit8.testcase
new file mode 100644
index 0000000..122f2f5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit8.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Text Face
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', 'face', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', 'face', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newedgessplit9.testcase b/test/sql_stmt_rttopo_tests/newedgessplit9.testcase
new file mode 100644
index 0000000..b74e3d3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newedgessplit9.testcase
@@ -0,0 +1,7 @@
+NewEdgesSplit - Int Geometry
+:memory: #use in-memory database
+SELECT ST_NewEdgesSplit('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewEdgesSplit('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit1.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit1.testcase
new file mode 100644
index 0000000..a391f88
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit1.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - NULL Network
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit(NULL, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit(NULL, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit2.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit2.testcase
new file mode 100644
index 0000000..230bb22
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit2.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Int Network
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit(1, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit(1, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit3.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit3.testcase
new file mode 100644
index 0000000..1c0493e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit3.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Double Network
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit(1.5, -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit(1.5, -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit4.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit4.testcase
new file mode 100644
index 0000000..14d0527
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit4.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Blob Network
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit(zeroblob(4), -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit(zeroblob(4), -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit5.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit5.testcase
new file mode 100644
index 0000000..705f797
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit5.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Text Network
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit('net', -1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit('net', -1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit6.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit6.testcase
new file mode 100644
index 0000000..2c07e09
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit6.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Double Link
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit('net', 2.0, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit('net', 2.0, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit7.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit7.testcase
new file mode 100644
index 0000000..433fb36
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit7.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - BLOB Link
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit('net', zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit('net', zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit8.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit8.testcase
new file mode 100644
index 0000000..4370bd7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit8.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Text Link
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit('net', 'link', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit('net', 'link', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newgeolinksplit9.testcase b/test/sql_stmt_rttopo_tests/newgeolinksplit9.testcase
new file mode 100644
index 0000000..355e003
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newgeolinksplit9.testcase
@@ -0,0 +1,7 @@
+NewGeoLinkSplit - Int Geometry
+:memory: #use in-memory database
+SELECT ST_NewGeoLinkSplit('net', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewGeoLinkSplit('net', -1, 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal1.testcase b/test/sql_stmt_rttopo_tests/newlinkheal1.testcase
new file mode 100644
index 0000000..8b2a0f1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal1.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - NULL Network
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal(NULL, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal(NULL, 1, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal10.testcase b/test/sql_stmt_rttopo_tests/newlinkheal10.testcase
new file mode 100644
index 0000000..0c144ae
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal10.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - NULL Link #2
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal11.testcase b/test/sql_stmt_rttopo_tests/newlinkheal11.testcase
new file mode 100644
index 0000000..550a0e8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal11.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Double Link #2
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 1, 2.4);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 1, 2.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal12.testcase b/test/sql_stmt_rttopo_tests/newlinkheal12.testcase
new file mode 100644
index 0000000..03660a7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal12.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Text Link #2
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 1, 'to');
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 1, 'to')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal13.testcase b/test/sql_stmt_rttopo_tests/newlinkheal13.testcase
new file mode 100644
index 0000000..a666582
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal13.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - BLOB Link #2
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal2.testcase b/test/sql_stmt_rttopo_tests/newlinkheal2.testcase
new file mode 100644
index 0000000..480baa9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal2.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Int Network
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal(1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal(1, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal3.testcase b/test/sql_stmt_rttopo_tests/newlinkheal3.testcase
new file mode 100644
index 0000000..aba6ff0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal3.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Double Network
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal(1.2, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal(1.2, 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal4.testcase b/test/sql_stmt_rttopo_tests/newlinkheal4.testcase
new file mode 100644
index 0000000..aaf77d3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal4.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - BLOB Network
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal(zeroblob(4), 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal(zeroblob(4), 1, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal5.testcase b/test/sql_stmt_rttopo_tests/newlinkheal5.testcase
new file mode 100644
index 0000000..603fffb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal5.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Text Network
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('topology', 1, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('topology', 1, 2)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal6.testcase b/test/sql_stmt_rttopo_tests/newlinkheal6.testcase
new file mode 100644
index 0000000..01d0f59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal6.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - NULL Link #1
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', NULL, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', NULL, 2)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal7.testcase b/test/sql_stmt_rttopo_tests/newlinkheal7.testcase
new file mode 100644
index 0000000..5cd9836
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal7.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Double Link #1
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 1.3, 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 1.3, 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal8.testcase b/test/sql_stmt_rttopo_tests/newlinkheal8.testcase
new file mode 100644
index 0000000..4ecdadc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal8.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - Text Link #1
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', 'from', 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', 'from', 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newlinkheal9.testcase b/test/sql_stmt_rttopo_tests/newlinkheal9.testcase
new file mode 100644
index 0000000..1db15ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newlinkheal9.testcase
@@ -0,0 +1,7 @@
+NewLinkHeal - BLOB Link #1
+:memory: #use in-memory database
+SELECT ST_NewLinkHeal('net', zeroblob(4), 2);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLinkHeal('net', zeroblob(4), 2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit1.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit1.testcase
new file mode 100644
index 0000000..8989063
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit1.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - NULL Network
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit2.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit2.testcase
new file mode 100644
index 0000000..e37e27a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit2.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Int Network
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit3.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit3.testcase
new file mode 100644
index 0000000..4c71376
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit3.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Double Network
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit4.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit4.testcase
new file mode 100644
index 0000000..cc81428
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit4.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Blob Network
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit5.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit5.testcase
new file mode 100644
index 0000000..eee079c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit5.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Text Network
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit('net', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit('net', -1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit6.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit6.testcase
new file mode 100644
index 0000000..6f31832
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit6.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Double Link
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit('net', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit('net', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit7.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit7.testcase
new file mode 100644
index 0000000..df05330
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit7.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - BLOB Link
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit('net', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit('net', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit8.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit8.testcase
new file mode 100644
index 0000000..1bf00b0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit8.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - Text Link
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit('net', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit('net', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/newloglinksplit9.testcase b/test/sql_stmt_rttopo_tests/newloglinksplit9.testcase
new file mode 100644
index 0000000..7beedcc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/newloglinksplit9.testcase
@@ -0,0 +1,7 @@
+NewLogLinkSplit - NULL Link
+:memory: #use in-memory database
+SELECT ST_NewLogLinkSplit('net', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_NewLogLinkSplit('net', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed1.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed1.testcase
new file mode 100644
index 0000000..507a209
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), NULL, 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed10.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed10.testcase
new file mode 100644
index 0000000..eba2400
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed11.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed11.testcase
new file mode 100644
index 0000000..bd87270
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - TEXT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 'dist');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 'dist')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed12.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed12.testcase
new file mode 100644
index 0000000..1539d13
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - BLOB distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', zeroblob(5));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', zeroblob(5))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed13.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed13.testcase
new file mode 100644
index 0000000..bca060d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed14.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed14.testcase
new file mode 100644
index 0000000..74c3ac9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE distance
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 'topo', 1.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed15.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed15.testcase
new file mode 100644
index 0000000..23cf1e8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - linestring instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('LINESTRING(1 1, 2 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('LINESTRING(1 1, 2 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed16.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed16.testcase
new file mode 100644
index 0000000..c9fb959
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - multipoint instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('MULTIPOINT(1 1, 1 2)'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('MULTIPOINT(1 1, 1 2)'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed17.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed17.testcase
new file mode 100644
index 0000000..c0d376c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - polygon instead of point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(ST_GeomFromText('POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))'), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed2.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed2.testcase
new file mode 100644
index 0000000..00f04c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed3.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed3.testcase
new file mode 100644
index 0000000..c3d9f74
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1.1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), 1.1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed4.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed4.testcase
new file mode 100644
index 0000000..f410c7f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - BLOB Topology
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(MakePoint(1, 2), zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(MakePoint(1, 2), zeroblob(4), 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed5.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed5.testcase
new file mode 100644
index 0000000..cd8e949
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - NULL point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(NULL, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(NULL, 'topo', 1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed6.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed6.testcase
new file mode 100644
index 0000000..ea3a364
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - INT point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed7.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed7.testcase
new file mode 100644
index 0000000..5c68795
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - DOUBLE point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(1.1, 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(1.1, 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed8.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed8.testcase
new file mode 100644
index 0000000..8f55f9c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - TEXT point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed('point', 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed('point', 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/pointsnapseed9.testcase b/test/sql_stmt_rttopo_tests/pointsnapseed9.testcase
new file mode 100644
index 0000000..d2dafc1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/pointsnapseed9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SnapPointToSeed - invalid BLOB point
+:memory: #use in-memory database
+SELECT TopoGeo_SnapPointToSeed(zeroblob(100), 'topo', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SnapPointToSeed(zeroblob(100), 'topo', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface1.testcase b/test/sql_stmt_rttopo_tests/remedgemodface1.testcase
new file mode 100644
index 0000000..b3eeac2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface1.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - NULL Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface2.testcase b/test/sql_stmt_rttopo_tests/remedgemodface2.testcase
new file mode 100644
index 0000000..dccb6a3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface2.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Int Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface3.testcase b/test/sql_stmt_rttopo_tests/remedgemodface3.testcase
new file mode 100644
index 0000000..a5858c1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface3.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Double Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface4.testcase b/test/sql_stmt_rttopo_tests/remedgemodface4.testcase
new file mode 100644
index 0000000..9cbf9e3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface4.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Blob Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface5.testcase b/test/sql_stmt_rttopo_tests/remedgemodface5.testcase
new file mode 100644
index 0000000..2556f97
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface5.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Text Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace('topology', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace('topology', -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface6.testcase b/test/sql_stmt_rttopo_tests/remedgemodface6.testcase
new file mode 100644
index 0000000..8ab6394
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface6.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Double Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace('topology', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace('topology', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface7.testcase b/test/sql_stmt_rttopo_tests/remedgemodface7.testcase
new file mode 100644
index 0000000..71d0500
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface7.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - BLOB Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface8.testcase b/test/sql_stmt_rttopo_tests/remedgemodface8.testcase
new file mode 100644
index 0000000..04328ce
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface8.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - Text Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace('topology', 'edge');
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace('topology', 'edge')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgemodface9.testcase b/test/sql_stmt_rttopo_tests/remedgemodface9.testcase
new file mode 100644
index 0000000..6390b52
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgemodface9.testcase
@@ -0,0 +1,7 @@
+RemEdgeModFace - NULL Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeModFace('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeModFace('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface1.testcase b/test/sql_stmt_rttopo_tests/remedgenewface1.testcase
new file mode 100644
index 0000000..17b1300
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface1.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - NULL Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface2.testcase b/test/sql_stmt_rttopo_tests/remedgenewface2.testcase
new file mode 100644
index 0000000..a065541
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface2.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Int Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface3.testcase b/test/sql_stmt_rttopo_tests/remedgenewface3.testcase
new file mode 100644
index 0000000..767e48a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface3.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Double Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface4.testcase b/test/sql_stmt_rttopo_tests/remedgenewface4.testcase
new file mode 100644
index 0000000..492e936
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface4.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Blob Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface5.testcase b/test/sql_stmt_rttopo_tests/remedgenewface5.testcase
new file mode 100644
index 0000000..b268527
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface5.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Text Topology
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace('topology', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace('topology', -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface6.testcase b/test/sql_stmt_rttopo_tests/remedgenewface6.testcase
new file mode 100644
index 0000000..d596e79
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface6.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Double Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace('topology', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace('topology', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface7.testcase b/test/sql_stmt_rttopo_tests/remedgenewface7.testcase
new file mode 100644
index 0000000..913a44e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface7.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - BLOB Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface8.testcase b/test/sql_stmt_rttopo_tests/remedgenewface8.testcase
new file mode 100644
index 0000000..b80b42d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface8.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - Text Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace('topology', 'edge');
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace('topology', 'edge')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remedgenewface9.testcase b/test/sql_stmt_rttopo_tests/remedgenewface9.testcase
new file mode 100644
index 0000000..a964533
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remedgenewface9.testcase
@@ -0,0 +1,7 @@
+RemEdgeNewFace - NULL Edge
+:memory: #use in-memory database
+SELECT ST_RemEdgeNewFace('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemEdgeNewFace('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge1.testcase b/test/sql_stmt_rttopo_tests/remisoedge1.testcase
new file mode 100644
index 0000000..ad8da8f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge1.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - NULL Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge2.testcase b/test/sql_stmt_rttopo_tests/remisoedge2.testcase
new file mode 100644
index 0000000..82aa5ef
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge2.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Int Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge3.testcase b/test/sql_stmt_rttopo_tests/remisoedge3.testcase
new file mode 100644
index 0000000..c0b1ccf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge3.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Double Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge4.testcase b/test/sql_stmt_rttopo_tests/remisoedge4.testcase
new file mode 100644
index 0000000..ddfd736
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge4.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Blob Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge5.testcase b/test/sql_stmt_rttopo_tests/remisoedge5.testcase
new file mode 100644
index 0000000..b8ff5b2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge5.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Text Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge('topology', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge('topology', -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge6.testcase b/test/sql_stmt_rttopo_tests/remisoedge6.testcase
new file mode 100644
index 0000000..5b658ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge6.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Double Edge
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge('topology', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge('topology', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge7.testcase b/test/sql_stmt_rttopo_tests/remisoedge7.testcase
new file mode 100644
index 0000000..9820468
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge7.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - BLOB RemIsoEdge
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge8.testcase b/test/sql_stmt_rttopo_tests/remisoedge8.testcase
new file mode 100644
index 0000000..682345a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge8.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - Text Edge
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge('topology', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge('topology', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisoedge9.testcase b/test/sql_stmt_rttopo_tests/remisoedge9.testcase
new file mode 100644
index 0000000..02b650a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisoedge9.testcase
@@ -0,0 +1,7 @@
+RemIsoEdge - NULL Edge
+:memory: #use in-memory database
+SELECT ST_RemIsoEdge('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoEdge('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode1.testcase b/test/sql_stmt_rttopo_tests/remisonetnode1.testcase
new file mode 100644
index 0000000..85372d5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode1.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - NULL Network
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode2.testcase b/test/sql_stmt_rttopo_tests/remisonetnode2.testcase
new file mode 100644
index 0000000..6ede979
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode2.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Int Network
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode3.testcase b/test/sql_stmt_rttopo_tests/remisonetnode3.testcase
new file mode 100644
index 0000000..5e97f6e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode3.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Double Network
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode4.testcase b/test/sql_stmt_rttopo_tests/remisonetnode4.testcase
new file mode 100644
index 0000000..6eeeb9e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode4.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Blob Network
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode5.testcase b/test/sql_stmt_rttopo_tests/remisonetnode5.testcase
new file mode 100644
index 0000000..770504c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode5.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Text Network
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode('net', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode('net', -1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode6.testcase b/test/sql_stmt_rttopo_tests/remisonetnode6.testcase
new file mode 100644
index 0000000..f4fed59
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode6.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Double Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode('net', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode('net', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode7.testcase b/test/sql_stmt_rttopo_tests/remisonetnode7.testcase
new file mode 100644
index 0000000..af024b5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode7.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - BLOB Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode('net', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode('net', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode8.testcase b/test/sql_stmt_rttopo_tests/remisonetnode8.testcase
new file mode 100644
index 0000000..a50ce79
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode8.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - Text Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode('net', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode('net', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonetnode9.testcase b/test/sql_stmt_rttopo_tests/remisonetnode9.testcase
new file mode 100644
index 0000000..cd06989
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonetnode9.testcase
@@ -0,0 +1,7 @@
+RemIsoNetNode - NULL Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNetNode('net', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNetNode('net', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode1.testcase b/test/sql_stmt_rttopo_tests/remisonode1.testcase
new file mode 100644
index 0000000..d20b34d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode1.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - NULL Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoNode(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode2.testcase b/test/sql_stmt_rttopo_tests/remisonode2.testcase
new file mode 100644
index 0000000..6a4fe5e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode2.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Int Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoNode(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode3.testcase b/test/sql_stmt_rttopo_tests/remisonode3.testcase
new file mode 100644
index 0000000..b8ff5c8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode3.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Double Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoNode(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode4.testcase b/test/sql_stmt_rttopo_tests/remisonode4.testcase
new file mode 100644
index 0000000..76a69f1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode4.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Blob Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoNode(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode5.testcase b/test/sql_stmt_rttopo_tests/remisonode5.testcase
new file mode 100644
index 0000000..80bc722
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode5.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Text Topology
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/remisonode6.testcase b/test/sql_stmt_rttopo_tests/remisonode6.testcase
new file mode 100644
index 0000000..1c09b86
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode6.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Double Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode7.testcase b/test/sql_stmt_rttopo_tests/remisonode7.testcase
new file mode 100644
index 0000000..990d91a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode7.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - BLOB Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode8.testcase b/test/sql_stmt_rttopo_tests/remisonode8.testcase
new file mode 100644
index 0000000..baac281
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode8.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - Text Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', 'node')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remisonode9.testcase b/test/sql_stmt_rttopo_tests/remisonode9.testcase
new file mode 100644
index 0000000..3d2debb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remisonode9.testcase
@@ -0,0 +1,7 @@
+RemIsoNode - NULL Node
+:memory: #use in-memory database
+SELECT ST_RemIsoNode('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemIsoNode('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink1.testcase b/test/sql_stmt_rttopo_tests/remlink1.testcase
new file mode 100644
index 0000000..41c9c53
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink1.testcase
@@ -0,0 +1,7 @@
+RemoveLink - NULL Network
+:memory: #use in-memory database
+SELECT ST_RemoveLink(NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink(NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink2.testcase b/test/sql_stmt_rttopo_tests/remlink2.testcase
new file mode 100644
index 0000000..459897d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink2.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Int Network
+:memory: #use in-memory database
+SELECT ST_RemoveLink(1, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink(1, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink3.testcase b/test/sql_stmt_rttopo_tests/remlink3.testcase
new file mode 100644
index 0000000..363e373
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink3.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Double Network
+:memory: #use in-memory database
+SELECT ST_RemoveLink(1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink(1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink4.testcase b/test/sql_stmt_rttopo_tests/remlink4.testcase
new file mode 100644
index 0000000..a741deb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink4.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Blob Network
+:memory: #use in-memory database
+SELECT ST_RemoveLink(zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink(zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink5.testcase b/test/sql_stmt_rttopo_tests/remlink5.testcase
new file mode 100644
index 0000000..dcbb9f9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink5.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Text Network
+:memory: #use in-memory database
+SELECT ST_RemoveLink('net', -1);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink('net', -1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/remlink6.testcase b/test/sql_stmt_rttopo_tests/remlink6.testcase
new file mode 100644
index 0000000..5dde887
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink6.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Double Link
+:memory: #use in-memory database
+SELECT ST_RemoveLink('net', 2.0);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink('net', 2.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink7.testcase b/test/sql_stmt_rttopo_tests/remlink7.testcase
new file mode 100644
index 0000000..e4bc021
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink7.testcase
@@ -0,0 +1,7 @@
+RemoveLink - BLOB Link
+:memory: #use in-memory database
+SELECT ST_RemoveLink('net', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink('net', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink8.testcase b/test/sql_stmt_rttopo_tests/remlink8.testcase
new file mode 100644
index 0000000..fc515be
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink8.testcase
@@ -0,0 +1,7 @@
+RemoveLink - Text Link
+:memory: #use in-memory database
+SELECT ST_RemoveLink('net', 'node');
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink('net', 'link')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/remlink9.testcase b/test/sql_stmt_rttopo_tests/remlink9.testcase
new file mode 100644
index 0000000..e3acb93
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/remlink9.testcase
@@ -0,0 +1,7 @@
+RemoveLink - NULL Link
+:memory: #use in-memory database
+SELECT ST_RemoveLink('net', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_RemoveLink('net', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer1.testcase b/test/sql_stmt_rttopo_tests/removetopolayer1.testcase
new file mode 100644
index 0000000..7b9ffc0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer(NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer(NULL, 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer2.testcase b/test/sql_stmt_rttopo_tests/removetopolayer2.testcase
new file mode 100644
index 0000000..a2e83c7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer(1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer(1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer3.testcase b/test/sql_stmt_rttopo_tests/removetopolayer3.testcase
new file mode 100644
index 0000000..708234f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer(1.5, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer(1.5, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer4.testcase b/test/sql_stmt_rttopo_tests/removetopolayer4.testcase
new file mode 100644
index 0000000..1cad3b3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer(zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer(zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer5.testcase b/test/sql_stmt_rttopo_tests/removetopolayer5.testcase
new file mode 100644
index 0000000..4aa0521
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer6.testcase b/test/sql_stmt_rttopo_tests/removetopolayer6.testcase
new file mode 100644
index 0000000..5b2fd17
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - TEXT TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer('topology', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer('topology', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer7.testcase b/test/sql_stmt_rttopo_tests/removetopolayer7.testcase
new file mode 100644
index 0000000..b8d42a5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - INT TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer('topology', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer8.testcase b/test/sql_stmt_rttopo_tests/removetopolayer8.testcase
new file mode 100644
index 0000000..cd7ac72
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - Double TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer('topology', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer('topology', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/removetopolayer9.testcase b/test/sql_stmt_rttopo_tests/removetopolayer9.testcase
new file mode 100644
index 0000000..6ba9aa3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/removetopolayer9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveTopoLayer - BLOB TopoLayer
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveTopoLayer('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveTopoLayer('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom1.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom1.testcase
new file mode 100644
index 0000000..7ed93db
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom1.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - NULL Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom(NULL, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom(NULL, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom10.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom10.testcase
new file mode 100644
index 0000000..de21dcf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom10.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - non existing Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom2.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom2.testcase
new file mode 100644
index 0000000..5aa2b53
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom2.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Int Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom(1, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom(1, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom3.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom3.testcase
new file mode 100644
index 0000000..c0cf1f7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom3.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Double Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom(1.5, MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom(1.5, MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom4.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom4.testcase
new file mode 100644
index 0000000..26be2d3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom4.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - BLOB Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom(zeroblob(4), MakePoint(1, 2, 4326));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom(zeroblob(4), MakePoint(1, 2, 4326))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom5.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom5.testcase
new file mode 100644
index 0000000..3479c68
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom5.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - NULL GeomCollection
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom6.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom6.testcase
new file mode 100644
index 0000000..fdbba22
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom6.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Int GeomCollection
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', 1);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom7.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom7.testcase
new file mode 100644
index 0000000..8c07947
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom7.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Double GeomCollection
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', 1.4);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', 1.4)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom8.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom8.testcase
new file mode 100644
index 0000000..b6071eb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom8.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Text GeomCollection
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', 'geom');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', 'geom')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromgeom9.testcase b/test/sql_stmt_rttopo_tests/spatnetfromgeom9.testcase
new file mode 100644
index 0000000..5c3aa37
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromgeom9.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromGeom - Invalid BLOB GeomCollection
+:memory: #use in-memory database
+SELECT ST_SpatNetFromGeom('network', zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromGeom('network', zeroblob(100))
+SQL/MM Spatial exception - not a Geometry.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo1.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo1.testcase
new file mode 100644
index 0000000..82b07f7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo1.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - NULL Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo(NULL, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo(NULL, 'topology')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo2.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo2.testcase
new file mode 100644
index 0000000..722d125
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo2.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - Int Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo(1, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo(1, 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo3.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo3.testcase
new file mode 100644
index 0000000..65494d0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo3.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - Double Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo(1.5, 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo(1.5, 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo4.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo4.testcase
new file mode 100644
index 0000000..00d4f65
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo4.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - Blob Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo(zeroblob(4), 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo(zeroblob(4), 'topology')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo5.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo5.testcase
new file mode 100644
index 0000000..f14f158
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo5.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - Text Network
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo('network', 'topology');
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo('network', 'topology')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo6.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo6.testcase
new file mode 100644
index 0000000..739504f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo6.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - NULL Topology
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo7.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo7.testcase
new file mode 100644
index 0000000..100f6df
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo7.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - INT Topology
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo('network', 1);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo('network', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo8.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo8.testcase
new file mode 100644
index 0000000..1fec323
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo8.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - Double Topology
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo('network', 1.2);
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo('network', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/spatnetfromtgeo9.testcase b/test/sql_stmt_rttopo_tests/spatnetfromtgeo9.testcase
new file mode 100644
index 0000000..44aaaa3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/spatnetfromtgeo9.testcase
@@ -0,0 +1,7 @@
+ST_SpatNetFromTGeo - BLOB Topology
+:memory: #use in-memory database
+SELECT ST_SpatNetFromTGeo('network', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_SpatNetFromTGeo('network', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topoexception1.testcase b/test/sql_stmt_rttopo_tests/topoexception1.testcase
new file mode 100644
index 0000000..a2976e5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topoexception1.testcase
@@ -0,0 +1,7 @@
+GetLastTopologyException - NULL Topology
+:memory: #use in-memory database
+SELECT GetLastTopologyException(NULL);
+1 # rows (not including the header row)
+1 # columns
+GetLastTopologyException(NULL)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topoexception2.testcase b/test/sql_stmt_rttopo_tests/topoexception2.testcase
new file mode 100644
index 0000000..e69c4df
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topoexception2.testcase
@@ -0,0 +1,7 @@
+GetLastTopologyException - Undefined Topology
+:memory: #use in-memory database
+SELECT GetLastTopologyException('topo');
+1 # rows (not including the header row)
+1 # columns
+GetLastTopologyException('topo')
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline1.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline1.testcase
new file mode 100644
index 0000000..b6da0cf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString(NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString(NULL, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline10.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline10.testcase
new file mode 100644
index 0000000..b9e1915
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Double Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline11.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline11.testcase
new file mode 100644
index 0000000..67eb924
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - NULL Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline12.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline12.testcase
new file mode 100644
index 0000000..934408c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Text Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline13.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline13.testcase
new file mode 100644
index 0000000..e83dd61
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline14.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline14.testcase
new file mode 100644
index 0000000..bc81b54
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Point Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', MakePoint(0, 1, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', MakePoint(0, 1, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline15.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline15.testcase
new file mode 100644
index 0000000..ea910a1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Polygon Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline16.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline16.testcase
new file mode 100644
index 0000000..ca97b7e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - MULTILINESTRING Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('MULTILINESTRING((0 0, 1 1), (2 2, 3 3))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('MULTILINESTRING((0 0, 1 1), (2 2, 3 3))', 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline17.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline17.testcase
new file mode 100644
index 0000000..bb4b904
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - NULL Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline2.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline2.testcase
new file mode 100644
index 0000000..4526320
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString(1, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString(1, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline3.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline3.testcase
new file mode 100644
index 0000000..b4ebf7b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString(1.5, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString(1.5, GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline4.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline4.testcase
new file mode 100644
index 0000000..a86106a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString(zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString(zeroblob(4), GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline5.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline5.testcase
new file mode 100644
index 0000000..4cd0506
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline6.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline6.testcase
new file mode 100644
index 0000000..7cf1dc9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Double Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline7.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline7.testcase
new file mode 100644
index 0000000..2a66724
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - BLOB Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline8.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline8.testcase
new file mode 100644
index 0000000..8fbc554
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Text Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddline9.testcase b/test/sql_stmt_rttopo_tests/topogeoaddline9.testcase
new file mode 100644
index 0000000..e5b4568
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddline9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddLineString - Int Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddLineString('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddLineString('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint1.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint1.testcase
new file mode 100644
index 0000000..d5bcaa3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint(NULL, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint(NULL, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint10.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint10.testcase
new file mode 100644
index 0000000..6d50a0c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Double Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', 1.1, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', 1.1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint11.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint11.testcase
new file mode 100644
index 0000000..8e016e2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - NULL Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint12.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint12.testcase
new file mode 100644
index 0000000..1d821fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Text Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', 'geom', 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', 'geom', 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint13.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint13.testcase
new file mode 100644
index 0000000..08f2709
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint14.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint14.testcase
new file mode 100644
index 0000000..4e19c85
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Linestring Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', GeomFromText('LINESTRING(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint15.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint15.testcase
new file mode 100644
index 0000000..900cee5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Polygon Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint16.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint16.testcase
new file mode 100644
index 0000000..26c064b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - MULTIPOINT Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', GeomFromText('MULTIPOINT(0 0, 1 1)', 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint17.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint17.testcase
new file mode 100644
index 0000000..c80d7e1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - NULL Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint2.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint2.testcase
new file mode 100644
index 0000000..f79b317
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint(1, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint(1, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint3.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint3.testcase
new file mode 100644
index 0000000..758497f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint(1.5, MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint(1.5, MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint4.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint4.testcase
new file mode 100644
index 0000000..3fdfc99
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint(zeroblob(4), MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint(zeroblob(4),MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint5.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint5.testcase
new file mode 100644
index 0000000..ca42c35
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint6.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint6.testcase
new file mode 100644
index 0000000..a1a3e27
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Double Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 0.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 0.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint7.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint7.testcase
new file mode 100644
index 0000000..1433bd5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - BLOB Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint8.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint8.testcase
new file mode 100644
index 0000000..313e59a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Text Tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 'tol');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', MakePoint(1, 2, 4326), 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoaddpoint9.testcase b/test/sql_stmt_rttopo_tests/topogeoaddpoint9.testcase
new file mode 100644
index 0000000..44c659b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoaddpoint9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_AddPoint - Int Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_AddPoint('topology', -1, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_AddPoint('topology', -1, 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone1.testcase b/test/sql_stmt_rttopo_tests/topogeoclone1.testcase
new file mode 100644
index 0000000..f498e9d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - NULL Topology (origin)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone('a', NULL, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone('a', NULL, 'destination')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone10.testcase b/test/sql_stmt_rttopo_tests/topogeoclone10.testcase
new file mode 100644
index 0000000..8c1983f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Double db-prefix
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(1.5, 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone11.testcase b/test/sql_stmt_rttopo_tests/topogeoclone11.testcase
new file mode 100644
index 0000000..1371a6d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - BLOB db-prefix
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(zeroblob(4), 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(zeroblob(4), 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone12.testcase b/test/sql_stmt_rttopo_tests/topogeoclone12.testcase
new file mode 100644
index 0000000..d3d0060
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Integer db-prefix
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(1, 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(1, 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone2.testcase b/test/sql_stmt_rttopo_tests/topogeoclone2.testcase
new file mode 100644
index 0000000..9375da1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Int Topology (origin)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone('a', 1, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone('a', 1, 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone3.testcase b/test/sql_stmt_rttopo_tests/topogeoclone3.testcase
new file mode 100644
index 0000000..034ba4d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Double Topology (origin)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 1.5, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 1.5, 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone4.testcase b/test/sql_stmt_rttopo_tests/topogeoclone4.testcase
new file mode 100644
index 0000000..1aca175
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Blob Topology (origin)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, zeroblob(4), 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, zeroblob(4), 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone5.testcase b/test/sql_stmt_rttopo_tests/topogeoclone5.testcase
new file mode 100644
index 0000000..43f3ff2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Text Topology (origin)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 'topology', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'topology', 'destination')
+SQL/MM Spatial exception - invalid topology name (origin).
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone6.testcase b/test/sql_stmt_rttopo_tests/topogeoclone6.testcase
new file mode 100644
index 0000000..04530ad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - NULL Topology (destination)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 'origin', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'origin', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone7.testcase b/test/sql_stmt_rttopo_tests/topogeoclone7.testcase
new file mode 100644
index 0000000..e5125d0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - INT Topology (destination)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 'origin', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'origin', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone8.testcase b/test/sql_stmt_rttopo_tests/topogeoclone8.testcase
new file mode 100644
index 0000000..309920b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - Double Topology (destination)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 'origin', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'origin', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoclone9.testcase b/test/sql_stmt_rttopo_tests/topogeoclone9.testcase
new file mode 100644
index 0000000..b791857
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoclone9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_Clone - BLOB Topology (destination)
+:memory: #use in-memory database
+SELECT TopoGeo_Clone(NULL, 'origin', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_Clone(NULL, 'origin', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext1.testcase b/test/sql_stmt_rttopo_tests/topogeofromext1.testcase
new file mode 100644
index 0000000..04d3919
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(NULL, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(NULL, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext10.testcase b/test/sql_stmt_rttopo_tests/topogeofromext10.testcase
new file mode 100644
index 0000000..14805d9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, NULL, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, NULL, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext11.testcase b/test/sql_stmt_rttopo_tests/topogeofromext11.testcase
new file mode 100644
index 0000000..508cdd2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 1, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 1, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext12.testcase b/test/sql_stmt_rttopo_tests/topogeofromext12.testcase
new file mode 100644
index 0000000..c036c67
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 1.2, NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 1.2, NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext13.testcase b/test/sql_stmt_rttopo_tests/topogeofromext13.testcase
new file mode 100644
index 0000000..d71c6f3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, zeroblob(4), NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, zeroblob(4), NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext14.testcase b/test/sql_stmt_rttopo_tests/topogeofromext14.testcase
new file mode 100644
index 0000000..f95af26
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 'column', 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 'column', 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext15.testcase b/test/sql_stmt_rttopo_tests/topogeofromext15.testcase
new file mode 100644
index 0000000..06dd6c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext16.testcase b/test/sql_stmt_rttopo_tests/topogeofromext16.testcase
new file mode 100644
index 0000000..a16c09b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1.2, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', 1.2, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext17.testcase b/test/sql_stmt_rttopo_tests/topogeofromext17.testcase
new file mode 100644
index 0000000..79f383a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', zeroblob(4), 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', zeroblob(4), 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext18.testcase b/test/sql_stmt_rttopo_tests/topogeofromext18.testcase
new file mode 100644
index 0000000..0283e4b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, NULL, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, NULL, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext19.testcase b/test/sql_stmt_rttopo_tests/topogeofromext19.testcase
new file mode 100644
index 0000000..bcc8d1a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 'zero', 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 'zero', 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext2.testcase b/test/sql_stmt_rttopo_tests/topogeofromext2.testcase
new file mode 100644
index 0000000..939e2e5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(1, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(1, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext20.testcase b/test/sql_stmt_rttopo_tests/topogeofromext20.testcase
new file mode 100644
index 0000000..830c9cf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, zeroblob(4), 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, zeroblob(4), 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext21.testcase b/test/sql_stmt_rttopo_tests/topogeofromext21.testcase
new file mode 100644
index 0000000..82e6984
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext22.testcase b/test/sql_stmt_rttopo_tests/topogeofromext22.testcase
new file mode 100644
index 0000000..a85143d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', NULL, -1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext23.testcase b/test/sql_stmt_rttopo_tests/topogeofromext23.testcase
new file mode 100644
index 0000000..4acb649
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext24.testcase b/test/sql_stmt_rttopo_tests/topogeofromext24.testcase
new file mode 100644
index 0000000..701166c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 'abc', -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', 'abc', -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext25.testcase b/test/sql_stmt_rttopo_tests/topogeofromext25.testcase
new file mode 100644
index 0000000..3c9841c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext26.testcase b/test/sql_stmt_rttopo_tests/topogeofromext26.testcase
new file mode 100644
index 0000000..4d36cf3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Integer line-max-points / Integer max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext27.testcase b/test/sql_stmt_rttopo_tests/topogeofromext27.testcase
new file mode 100644
index 0000000..c7c668b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext27.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext28.testcase b/test/sql_stmt_rttopo_tests/topogeofromext28.testcase
new file mode 100644
index 0000000..a5b3005
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext28.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext29.testcase b/test/sql_stmt_rttopo_tests/topogeofromext29.testcase
new file mode 100644
index 0000000..d82f47d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext29.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 'abc');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 'abc')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext3.testcase b/test/sql_stmt_rttopo_tests/topogeofromext3.testcase
new file mode 100644
index 0000000..57fde09
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(1.5, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(1.5, NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext30.testcase b/test/sql_stmt_rttopo_tests/topogeofromext30.testcase
new file mode 100644
index 0000000..539ffb4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext30.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 5000.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview', -1, 5000.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext31.testcase b/test/sql_stmt_rttopo_tests/topogeofromext31.testcase
new file mode 100644
index 0000000..2bd77a9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext31.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbinview')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext32.testcase b/test/sql_stmt_rttopo_tests/topogeofromext32.testcase
new file mode 100644
index 0000000..ab999bd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext32.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext33.testcase b/test/sql_stmt_rttopo_tests/topogeofromext33.testcase
new file mode 100644
index 0000000..44faf67
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext33.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext34.testcase b/test/sql_stmt_rttopo_tests/topogeofromext34.testcase
new file mode 100644
index 0000000..44faf67
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext34.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext35.testcase b/test/sql_stmt_rttopo_tests/topogeofromext35.testcase
new file mode 100644
index 0000000..df9b7e5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext35.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB dustbin-table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, zeroblob(5), 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, zeroblob(5), 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext36.testcase b/test/sql_stmt_rttopo_tests/topogeofromext36.testcase
new file mode 100644
index 0000000..13cff06
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext36.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - NULL dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, NULL, 'dustbin')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext37.testcase b/test/sql_stmt_rttopo_tests/topogeofromext37.testcase
new file mode 100644
index 0000000..41b5cb8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext37.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1, 'dustbin')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext38.testcase b/test/sql_stmt_rttopo_tests/topogeofromext38.testcase
new file mode 100644
index 0000000..9fe19b4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext38.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - DOUBLE dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 1.2, 'dustbin')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext39.testcase b/test/sql_stmt_rttopo_tests/topogeofromext39.testcase
new file mode 100644
index 0000000..444f207
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext39.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB dustbin-view
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0.001, 'dustbin', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext4.testcase b/test/sql_stmt_rttopo_tests/topogeofromext4.testcase
new file mode 100644
index 0000000..6b7e4ec
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt(zeroblob(4), NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt(zeroblob(4), NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext5.testcase b/test/sql_stmt_rttopo_tests/topogeofromext5.testcase
new file mode 100644
index 0000000..296e6bc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', NULL, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext6.testcase b/test/sql_stmt_rttopo_tests/topogeofromext6.testcase
new file mode 100644
index 0000000..c6ec216
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 'a', 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 'a', 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext7.testcase b/test/sql_stmt_rttopo_tests/topogeofromext7.testcase
new file mode 100644
index 0000000..05633fa
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 1, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 1, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext8.testcase b/test/sql_stmt_rttopo_tests/topogeofromext8.testcase
new file mode 100644
index 0000000..f31fb11
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', 1.2, 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', 1.2, 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromext9.testcase b/test/sql_stmt_rttopo_tests/topogeofromext9.testcase
new file mode 100644
index 0000000..00003f1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromext9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTableExt - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTableExt('topology', zeroblob(4), 'table', NULL, 0, 'dustbin', 'dustbinview');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTableExt('topology', zeroblob(4), 'table', NULL, 0, 'dustbin', 'dustbinview')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable1.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable1.testcase
new file mode 100644
index 0000000..ea4bea7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable(NULL, NULL, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable(NULL, NULL, 'table', NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable10.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable10.testcase
new file mode 100644
index 0000000..1017f3f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - NULL table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, NULL, NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, NULL, NULL, 0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable11.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable11.testcase
new file mode 100644
index 0000000..a91cc93
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - INT table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 1, NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 1, NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable12.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable12.testcase
new file mode 100644
index 0000000..a1ccbb8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 1.2, NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 1.2, NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable13.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable13.testcase
new file mode 100644
index 0000000..94118b5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB table
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, zeroblob(4), NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, zeroblob(4), NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable14.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable14.testcase
new file mode 100644
index 0000000..e7991de
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', 'column', 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', 'column', 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable15.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable15.testcase
new file mode 100644
index 0000000..bf0d69c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', 1, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', 1, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable16.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable16.testcase
new file mode 100644
index 0000000..1ea21ac
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', 1.2, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', 1.2, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable17.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable17.testcase
new file mode 100644
index 0000000..6a60bca
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', zeroblob(4), 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', zeroblob(4), 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable18.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable18.testcase
new file mode 100644
index 0000000..e4074c4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - NULL tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable19.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable19.testcase
new file mode 100644
index 0000000..38dc5cc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Text tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 'zero');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 'zero')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable2.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable2.testcase
new file mode 100644
index 0000000..8828f3c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable(1, NULL, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable(1, NULL, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable20.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable20.testcase
new file mode 100644
index 0000000..3347c0b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable21.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable21.testcase
new file mode 100644
index 0000000..70cb5b6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0.001);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0.001)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable22.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable22.testcase
new file mode 100644
index 0000000..59076ac
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - NULL line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, NULL, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable23.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable23.testcase
new file mode 100644
index 0000000..d7b7e6b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, 1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, 1.5, -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable24.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable24.testcase
new file mode 100644
index 0000000..4bce35b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Text line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, 'abc', -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, 'abc', -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable25.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable25.testcase
new file mode 100644
index 0000000..2bfb9cd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB line-max-points
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, zeroblob(4), -1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable26.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable26.testcase
new file mode 100644
index 0000000..0a441e6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Integer line-max-points / Integer max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, -1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable27.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable27.testcase
new file mode 100644
index 0000000..4b247f9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable27.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - NULL max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable28.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable28.testcase
new file mode 100644
index 0000000..6bdea96
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable28.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable29.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable29.testcase
new file mode 100644
index 0000000..58e3652
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable29.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Text max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, 'abc');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, 'abc')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable3.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable3.testcase
new file mode 100644
index 0000000..dddf22f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable(1.5, NULL, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable(1.5, NULL, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable30.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable30.testcase
new file mode 100644
index 0000000..7cfbd47
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable30.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double max-length
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, 5000.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0, -1, 5000.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable4.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable4.testcase
new file mode 100644
index 0000000..7e463bb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable(zeroblob(4), NULL, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable(zeroblob(4), NULL, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable5.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable5.testcase
new file mode 100644
index 0000000..caca4ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', NULL, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable6.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable6.testcase
new file mode 100644
index 0000000..5fdcf7c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', 'a', 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', 'a', 'table', NULL, 0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable7.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable7.testcase
new file mode 100644
index 0000000..c07275a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', 1, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', 1, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable8.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable8.testcase
new file mode 100644
index 0000000..2ad854a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', 1.2, 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', 1.2, 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeofromtable9.testcase b/test/sql_stmt_rttopo_tests/topogeofromtable9.testcase
new file mode 100644
index 0000000..41332ce
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeofromtable9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_FromGeoTable - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_FromGeoTable('topology', zeroblob(4), 'table', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_FromGeoTable('topology', zeroblob(4), 'table', NULL, 0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremoveedges1.testcase b/test/sql_stmt_rttopo_tests/topogeoremoveedges1.testcase
new file mode 100644
index 0000000..fdf8ff2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremoveedges1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges (NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges (NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremoveedges2.testcase b/test/sql_stmt_rttopo_tests/topogeoremoveedges2.testcase
new file mode 100644
index 0000000..8a93453
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremoveedges2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremoveedges3.testcase b/test/sql_stmt_rttopo_tests/topogeoremoveedges3.testcase
new file mode 100644
index 0000000..70abd5b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremoveedges3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremoveedges4.testcase b/test/sql_stmt_rttopo_tests/topogeoremoveedges4.testcase
new file mode 100644
index 0000000..a23acfe
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremoveedges4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremoveedges5.testcase b/test/sql_stmt_rttopo_tests/topogeoremoveedges5.testcase
new file mode 100644
index 0000000..04c8421
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremoveedges5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingEdges - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingEdges('topology');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingEdges('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovenodes1.testcase b/test/sql_stmt_rttopo_tests/topogeoremovenodes1.testcase
new file mode 100644
index 0000000..82d7324
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovenodes1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes (NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes (NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovenodes2.testcase b/test/sql_stmt_rttopo_tests/topogeoremovenodes2.testcase
new file mode 100644
index 0000000..4df1972
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovenodes2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovenodes3.testcase b/test/sql_stmt_rttopo_tests/topogeoremovenodes3.testcase
new file mode 100644
index 0000000..91e3269
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovenodes3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovenodes4.testcase b/test/sql_stmt_rttopo_tests/topogeoremovenodes4.testcase
new file mode 100644
index 0000000..5c05d7e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovenodes4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovenodes5.testcase b/test/sql_stmt_rttopo_tests/topogeoremovenodes5.testcase
new file mode 100644
index 0000000..025d426
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovenodes5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveDanglingNodes - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveDanglingNodes('topology');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveDanglingNodes('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall1.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall1.testcase
new file mode 100644
index 0000000..be44fa1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces (NULL, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces (NULL, 0.1)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall2.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall2.testcase
new file mode 100644
index 0000000..bb53191
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(1, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(1, NULL, 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall3.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall3.testcase
new file mode 100644
index 0000000..32fc4a3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(1.5, 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(1.5, 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall4.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall4.testcase
new file mode 100644
index 0000000..6491ed4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces(zeroblob(4), 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces(zeroblob(4), 0.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall5.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall5.testcase
new file mode 100644
index 0000000..2888d1d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 0.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 0.1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall6.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall6.testcase
new file mode 100644
index 0000000..a0cc081
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - TEXT min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 'a');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 'a')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall7.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall7.testcase
new file mode 100644
index 0000000..1f7b146
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - INT min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall8.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall8.testcase
new file mode 100644
index 0000000..d3da8a6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - NULL min-area
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoremovesmall9.testcase b/test/sql_stmt_rttopo_tests/topogeoremovesmall9.testcase
new file mode 100644
index 0000000..faad353
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoremovesmall9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_RemoveSmallFaces - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_RemoveSmallFaces('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_RemoveSmallFaces('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline1.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline1.testcase
new file mode 100644
index 0000000..72731ab
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Ok #1
+:memory: #use in-memory database
+SELECT AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 1, 2 3)', 4326), 512, -1));
+1 # rows (not including the header row)
+1 # columns
+AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 1, 2 3)', 4326), 512, -1))
+MULTILINESTRING((0 1, 2 3))
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline10.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline10.testcase
new file mode 100644
index 0000000..48b1b6e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Text max points
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), 'alpha', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), 'alpha', 1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline11.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline11.testcase
new file mode 100644
index 0000000..fd0c2bf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - BLOB max points
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), zeroblob(4), -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), zeroblob(4), -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline12.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline12.testcase
new file mode 100644
index 0000000..5709b22
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - NULL max-length
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, NULL)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline13.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline13.testcase
new file mode 100644
index 0000000..13ef75d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - TEXT max-length
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, 'abc');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, 'abc')
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline14.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline14.testcase
new file mode 100644
index 0000000..3a62028
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - BLOB max-length
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), -1, zeroblob(4))
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline15.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline15.testcase
new file mode 100644
index 0000000..e2c781c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Int max-length
+:memory: #use in-memory database
+SELECT AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGM(1 2 3, 4 5 6)', 4326), -1, 1000));
+1 # rows (not including the header row)
+1 # columns
+AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGM(1 2 3, 4 5 6)', 4326), -1, 1000))
+MULTILINESTRING M((1 2 3, 4 5 6))
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline16.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline16.testcase
new file mode 100644
index 0000000..072c581
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Double max-length
+:memory: #use in-memory database
+SELECT AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGZM(1 2 3 4, 5 6 7 8)', 4326), -1, 1000.0));
+1 # rows (not including the header row)
+1 # columns
+AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGZM(1 2 3 4, 5 6 7 8)', 4326), -1, 1000.0))
+MULTILINESTRING ZM((1 2 3 4, 5 6 7 8))
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline2.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline2.testcase
new file mode 100644
index 0000000..aed6875
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Ok #2
+:memory: #use in-memory database
+SELECT AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGZ(1 2 3, 4 5 6)', 4326), -1, -1));
+1 # rows (not including the header row)
+1 # columns
+AsText(TopoGeo_SubdivideLines(GeomFromText('LINESTRINGZ(1 2 3, 4 5 6)', 4326), -1, -1))
+MULTILINESTRING Z((1 2 3, 4 5 6))
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline3.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline3.testcase
new file mode 100644
index 0000000..1661aa3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - NULL Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(NULL, -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(NULL, -1, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline4.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline4.testcase
new file mode 100644
index 0000000..a52a879
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Integer Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(1, -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(1, -1, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline5.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline5.testcase
new file mode 100644
index 0000000..b49eb92
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Double Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(1.2, -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(1.2, -1, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline6.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline6.testcase
new file mode 100644
index 0000000..82678d5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Text Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines('alpha', -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines('alpha', -1, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline7.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline7.testcase
new file mode 100644
index 0000000..af3730b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(zeroblob(100), -1, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(zeroblob(100), -1, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline8.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline8.testcase
new file mode 100644
index 0000000..33b93ef
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - NULL max points
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), NULL, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), NULL, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeosplitline9.testcase b/test/sql_stmt_rttopo_tests/topogeosplitline9.testcase
new file mode 100644
index 0000000..a97d19d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeosplitline9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_SubdivideLines - Double max points
+:memory: #use in-memory database
+SELECT TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), 1.5, -1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_SubdivideLines(GeomFromText('LINESTRING(0 0, 1 1)', 4326), 1.5, -1)
+(NULL)
diff --git a/test/sql_stmt_rttopo_tests/topogeototable1.testcase b/test/sql_stmt_rttopo_tests/topogeototable1.testcase
new file mode 100644
index 0000000..60b4495
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable(NULL, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable(NULL, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable10.testcase b/test/sql_stmt_rttopo_tests/topogeototable10.testcase
new file mode 100644
index 0000000..d8b6229
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, NULL, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, NULL, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable11.testcase b/test/sql_stmt_rttopo_tests/topogeototable11.testcase
new file mode 100644
index 0000000..1245ca7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - INT ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 1, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 1, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable12.testcase b/test/sql_stmt_rttopo_tests/topogeototable12.testcase
new file mode 100644
index 0000000..5361297
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 1.2, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 1.2, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable13.testcase b/test/sql_stmt_rttopo_tests/topogeototable13.testcase
new file mode 100644
index 0000000..1a16772
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - BLOB ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, zeroblob(4), NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, zeroblob(4), NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable14.testcase b/test/sql_stmt_rttopo_tests/topogeototable14.testcase
new file mode 100644
index 0000000..132507c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', 'column', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', 'column', 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable15.testcase b/test/sql_stmt_rttopo_tests/topogeototable15.testcase
new file mode 100644
index 0000000..981413a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', 1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', 1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable16.testcase b/test/sql_stmt_rttopo_tests/topogeototable16.testcase
new file mode 100644
index 0000000..31aeadf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', 1.2, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', 1.2, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable17.testcase b/test/sql_stmt_rttopo_tests/topogeototable17.testcase
new file mode 100644
index 0000000..f9322e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable18.testcase b/test/sql_stmt_rttopo_tests/topogeototable18.testcase
new file mode 100644
index 0000000..8c834e6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - NULL out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable19.testcase b/test/sql_stmt_rttopo_tests/topogeototable19.testcase
new file mode 100644
index 0000000..54d9890
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable2.testcase b/test/sql_stmt_rttopo_tests/topogeototable2.testcase
new file mode 100644
index 0000000..09af1db
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable(1, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable(1, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable20.testcase b/test/sql_stmt_rttopo_tests/topogeototable20.testcase
new file mode 100644
index 0000000..3982876
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - BLOB out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable21.testcase b/test/sql_stmt_rttopo_tests/topogeototable21.testcase
new file mode 100644
index 0000000..5e5a17d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Text out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable22.testcase b/test/sql_stmt_rttopo_tests/topogeototable22.testcase
new file mode 100644
index 0000000..1d3cc5a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Text with-spatial-index
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 'tol');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable23.testcase b/test/sql_stmt_rttopo_tests/topogeototable23.testcase
new file mode 100644
index 0000000..a4ce09f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - BLOB with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable24.testcase b/test/sql_stmt_rttopo_tests/topogeototable24.testcase
new file mode 100644
index 0000000..0b86fc5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable25.testcase b/test/sql_stmt_rttopo_tests/topogeototable25.testcase
new file mode 100644
index 0000000..a20cb4a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - NULL with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable26.testcase b/test/sql_stmt_rttopo_tests/topogeototable26.testcase
new file mode 100644
index 0000000..627ffde
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Integer with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable3.testcase b/test/sql_stmt_rttopo_tests/topogeototable3.testcase
new file mode 100644
index 0000000..9a9e8ba
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable(1.5, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable(1.5, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable4.testcase b/test/sql_stmt_rttopo_tests/topogeototable4.testcase
new file mode 100644
index 0000000..55ff8f7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable(zeroblob(4), NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable(zeroblob(4), NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable5.testcase b/test/sql_stmt_rttopo_tests/topogeototable5.testcase
new file mode 100644
index 0000000..b690195
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable6.testcase b/test/sql_stmt_rttopo_tests/topogeototable6.testcase
new file mode 100644
index 0000000..e1c3d1f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', 'a', 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', 'a', 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable7.testcase b/test/sql_stmt_rttopo_tests/topogeototable7.testcase
new file mode 100644
index 0000000..2b7481e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', 1, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', 1, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable8.testcase b/test/sql_stmt_rttopo_tests/topogeototable8.testcase
new file mode 100644
index 0000000..3b45f2b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', 1.2, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', 1.2, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototable9.testcase b/test/sql_stmt_rttopo_tests/topogeototable9.testcase
new file mode 100644
index 0000000..cdd6ea5
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototable9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTable - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTable('topology', zeroblob(4), 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTable('topology', zeroblob(4), 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen1.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen1.testcase
new file mode 100644
index 0000000..252bc45
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - NULL Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize(NULL, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize(NULL, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen10.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen10.testcase
new file mode 100644
index 0000000..0cbf2ad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, NULL, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, NULL, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen11.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen11.testcase
new file mode 100644
index 0000000..3dcb763
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen11.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - INT ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 1, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 1, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen12.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen12.testcase
new file mode 100644
index 0000000..a2267fd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen12.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 1.2, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 1.2, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen13.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen13.testcase
new file mode 100644
index 0000000..8f91e47
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen13.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB ref-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, zeroblob(4), NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, zeroblob(4), NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen14.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen14.testcase
new file mode 100644
index 0000000..8092da4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen14.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Text Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 'column', 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 'column', 'out', 10.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen15.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen15.testcase
new file mode 100644
index 0000000..7b2a10c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen15.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Int Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 1, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 1, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen16.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen16.testcase
new file mode 100644
index 0000000..fd2d4ba
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen16.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 1.2, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', 1.2, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen17.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen17.testcase
new file mode 100644
index 0000000..1ace95c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen17.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB Column
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', zeroblob(4), 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', zeroblob(4), 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen18.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen18.testcase
new file mode 100644
index 0000000..b4c884e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen18.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - NULL out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, NULL, 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, NULL, 10.0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen19.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen19.testcase
new file mode 100644
index 0000000..fd5bd99
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen19.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 1.2, 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 1.2, 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen2.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen2.testcase
new file mode 100644
index 0000000..160a29e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Int Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize(1, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize(1, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen20.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen20.testcase
new file mode 100644
index 0000000..4c33efe
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen20.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, zeroblob(4), 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, zeroblob(4), 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen21.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen21.testcase
new file mode 100644
index 0000000..35883b4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen21.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Text out-table
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen22.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen22.testcase
new file mode 100644
index 0000000..d96d166
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen22.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Text tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 'no', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 'no', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen23.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen23.testcase
new file mode 100644
index 0000000..1aa5729
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen23.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB toleramce
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen24.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen24.testcase
new file mode 100644
index 0000000..50fe582
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen24.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double toleramce
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen25.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen25.testcase
new file mode 100644
index 0000000..9a1a387
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen25.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - NULL toleramce
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen26.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen26.testcase
new file mode 100644
index 0000000..c11a0c7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen26.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Integer tolerance
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen27.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen27.testcase
new file mode 100644
index 0000000..1047d47
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen27.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Text with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen28.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen28.testcase
new file mode 100644
index 0000000..6fea726
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen28.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen29.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen29.testcase
new file mode 100644
index 0000000..877b421
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen29.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen3.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen3.testcase
new file mode 100644
index 0000000..55f02a8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize(1.5, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize(1.5, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen30.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen30.testcase
new file mode 100644
index 0000000..339faf6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen30.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - NULL with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen31.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen31.testcase
new file mode 100644
index 0000000..6514231
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen31.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Integer with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0, 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen4.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen4.testcase
new file mode 100644
index 0000000..fe2cb70
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Blob Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize(zeroblob(4), NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize(zeroblob(4), NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen5.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen5.testcase
new file mode 100644
index 0000000..b7e9aff
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Text Topology
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen6.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen6.testcase
new file mode 100644
index 0000000..a6199ee
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', 'a', 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', 'a', 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen7.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen7.testcase
new file mode 100644
index 0000000..d49056b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - INT prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', 1, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', 1, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen8.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen8.testcase
new file mode 100644
index 0000000..851d114
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - Double prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', 1.2, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', 1.2, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeototablegen9.testcase b/test/sql_stmt_rttopo_tests/topogeototablegen9.testcase
new file mode 100644
index 0000000..df7dc73
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeototablegen9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_ToGeoTableGeneralize - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoGeo_ToGeoTableGeneralize('topology', zeroblob(4), 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_ToGeoTableGeneralize('topology', zeroblob(4), 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds1.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds1.testcase
new file mode 100644
index 0000000..203927e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds1.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - NULL Topology 
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds(NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds10.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds10.testcase
new file mode 100644
index 0000000..33719b7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds10.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Text mode
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology', 'mode');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology', 'mode')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds2.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds2.testcase
new file mode 100644
index 0000000..4a557ef
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds2.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Int Topology 
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds(1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds3.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds3.testcase
new file mode 100644
index 0000000..fafb139
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds3.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Double Topology 
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds4.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds4.testcase
new file mode 100644
index 0000000..509d030
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds4.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Blob Topology 
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds5.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds5.testcase
new file mode 100644
index 0000000..86b59b6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds5.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Text Topology 
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology');
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds6.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds6.testcase
new file mode 100644
index 0000000..c5e6f7e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds6.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - NULL mode
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds7.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds7.testcase
new file mode 100644
index 0000000..12af1d7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds7.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Int mode
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology', 1)
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds8.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds8.testcase
new file mode 100644
index 0000000..65fff87
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds8.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Double mode
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology', 1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology', 1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topogeoupdateseeds9.testcase b/test/sql_stmt_rttopo_tests/topogeoupdateseeds9.testcase
new file mode 100644
index 0000000..7d6035e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topogeoupdateseeds9.testcase
@@ -0,0 +1,7 @@
+TopoGeo_UpdateSeeds - Blob mode
+:memory: #use in-memory database
+SELECT TopoGeo_UpdateSeeds('topology', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoGeo_UpdateSeeds('topology', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/topomettotable25.testcase b/test/sql_stmt_rttopo_tests/topomettotable25.testcase
new file mode 100644
index 0000000..7c08529
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/topomettotable25.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - NULL with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone1.testcase b/test/sql_stmt_rttopo_tests/toponetclone1.testcase
new file mode 100644
index 0000000..f49d6b9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone1.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - NULL Network (origin)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, NULL, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, NULL, 'destination')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone10.testcase b/test/sql_stmt_rttopo_tests/toponetclone10.testcase
new file mode 100644
index 0000000..e6c730f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone10.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Double db-prefix
+:memory: #use in-memory database
+SELECT TopoNet_Clone(1.5, 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(1.5, 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone11.testcase b/test/sql_stmt_rttopo_tests/toponetclone11.testcase
new file mode 100644
index 0000000..ae7d778
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone11.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Integer db-prefix
+:memory: #use in-memory database
+SELECT TopoNet_Clone(1, 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(1, 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone12.testcase b/test/sql_stmt_rttopo_tests/toponetclone12.testcase
new file mode 100644
index 0000000..b5262fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone12.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - BLOB db-prefix
+:memory: #use in-memory database
+SELECT TopoNet_Clone(zeroblob(4), 'origin', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(zeroblob(4), 'origin', 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone2.testcase b/test/sql_stmt_rttopo_tests/toponetclone2.testcase
new file mode 100644
index 0000000..0b52f15
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone2.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Int Network (origin)
+:memory: #use in-memory database
+SELECT TopoNet_Clone("a", 1, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone("a", 1, 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone3.testcase b/test/sql_stmt_rttopo_tests/toponetclone3.testcase
new file mode 100644
index 0000000..71f38a1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone3.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Double Network (origin)
+:memory: #use in-memory database
+SELECT TopoNet_Clone("a", 1.5, 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone("a", 1.5, 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone4.testcase b/test/sql_stmt_rttopo_tests/toponetclone4.testcase
new file mode 100644
index 0000000..1856c72
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone4.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Blob Network (origin)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, zeroblob(4), 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, zeroblob(4), 'destination')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone5.testcase b/test/sql_stmt_rttopo_tests/toponetclone5.testcase
new file mode 100644
index 0000000..b6ba2c3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone5.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Text Network (origin)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, 'topology', 'destination');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, 'topology', 'destination')
+SQL/MM Spatial exception - invalid network name (origin).
diff --git a/test/sql_stmt_rttopo_tests/toponetclone6.testcase b/test/sql_stmt_rttopo_tests/toponetclone6.testcase
new file mode 100644
index 0000000..451cbb9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone6.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - NULL Network (destination)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, 'origin', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, 'origin', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone7.testcase b/test/sql_stmt_rttopo_tests/toponetclone7.testcase
new file mode 100644
index 0000000..38cae34
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone7.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - INT Network (destination)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, 'origin', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, 'origin', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone8.testcase b/test/sql_stmt_rttopo_tests/toponetclone8.testcase
new file mode 100644
index 0000000..94cf346
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone8.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - Double Network (destination)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, 'origin', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, 'origin', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetclone9.testcase b/test/sql_stmt_rttopo_tests/toponetclone9.testcase
new file mode 100644
index 0000000..b07e124
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetclone9.testcase
@@ -0,0 +1,7 @@
+TopoNet_Clone - BLOB Network (destination)
+:memory: #use in-memory database
+SELECT TopoNet_Clone(NULL, 'origin', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_Clone(NULL, 'origin', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable1.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable1.testcase
new file mode 100644
index 0000000..e0d6e1c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable1.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - NULL Network
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable(NULL, NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable(NULL, NULL, 'table', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable10.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable10.testcase
new file mode 100644
index 0000000..209a13a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable10.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - NULL table
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, NULL, NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable11.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable11.testcase
new file mode 100644
index 0000000..6c392f4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable11.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - INT table
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 1, NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable12.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable12.testcase
new file mode 100644
index 0000000..06f1e4b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable12.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Double table
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 1.2, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 1.2, NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable13.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable13.testcase
new file mode 100644
index 0000000..e5b614e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable13.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - BLOB table
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, zeroblob(4), NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, zeroblob(4), NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable14.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable14.testcase
new file mode 100644
index 0000000..2ad8b75
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable14.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Text Column
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 'table', 'column');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 'table', 'column')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable15.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable15.testcase
new file mode 100644
index 0000000..8df3cd6
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable15.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Int Column
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 'table', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 'table', 1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable16.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable16.testcase
new file mode 100644
index 0000000..6d1b014
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable16.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Double Column
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 'table', 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 'table', 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable17.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable17.testcase
new file mode 100644
index 0000000..6c9196b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable17.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - BLOB Column
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 'table', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 'table', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable2.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable2.testcase
new file mode 100644
index 0000000..e628315
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable2.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Int Network
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable(1, NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable(1, NULL, 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable3.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable3.testcase
new file mode 100644
index 0000000..8cb16cf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable3.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Double Network
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable(1.5, NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable(1.5, NULL, 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable4.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable4.testcase
new file mode 100644
index 0000000..c6c4554
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable4.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Blob Network
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable(zeroblob(4), NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable(zeroblob(4), NULL, 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable5.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable5.testcase
new file mode 100644
index 0000000..38b1055
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable5.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Text Network
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', NULL, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', NULL, 'table', NULL)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable6.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable6.testcase
new file mode 100644
index 0000000..d127d9a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable6.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', 'a', 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', 'a', 'table', NULL)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable7.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable7.testcase
new file mode 100644
index 0000000..950d49f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable7.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - INT prefix
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', 1, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', 1, 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable8.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable8.testcase
new file mode 100644
index 0000000..f621d03
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable8.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - Double prefix
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', 1.2, 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', 1.2, 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetfromtable9.testcase b/test/sql_stmt_rttopo_tests/toponetfromtable9.testcase
new file mode 100644
index 0000000..2c3661f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetfromtable9.testcase
@@ -0,0 +1,7 @@
+TopoNet_FromGeoTable - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoNet_FromGeoTable('network', zeroblob(4), 'table', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_FromGeoTable('network', zeroblob(4), 'table', NULL)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable1.testcase b/test/sql_stmt_rttopo_tests/toponettotable1.testcase
new file mode 100644
index 0000000..b4353dc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable1.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - NULL Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable(NULL, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable(NULL, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable10.testcase b/test/sql_stmt_rttopo_tests/toponettotable10.testcase
new file mode 100644
index 0000000..5f592b8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable10.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, NULL, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, NULL, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable11.testcase b/test/sql_stmt_rttopo_tests/toponettotable11.testcase
new file mode 100644
index 0000000..c7fb39e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable11.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - INT ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 1, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 1, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable12.testcase b/test/sql_stmt_rttopo_tests/toponettotable12.testcase
new file mode 100644
index 0000000..766e211
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable12.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 1.2, NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 1.2, NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable13.testcase b/test/sql_stmt_rttopo_tests/toponettotable13.testcase
new file mode 100644
index 0000000..b400604
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable13.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - BLOB table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, zeroblob(4), NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, zeroblob(4), NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable14.testcase b/test/sql_stmt_rttopo_tests/toponettotable14.testcase
new file mode 100644
index 0000000..c98d582
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable14.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Text Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', 'column', 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', 'column', 'out')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable15.testcase b/test/sql_stmt_rttopo_tests/toponettotable15.testcase
new file mode 100644
index 0000000..af3680c
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable15.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Int Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', 1, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', 1, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable16.testcase b/test/sql_stmt_rttopo_tests/toponettotable16.testcase
new file mode 100644
index 0000000..4940282
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable16.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', 1.2, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', 1.2, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable17.testcase b/test/sql_stmt_rttopo_tests/toponettotable17.testcase
new file mode 100644
index 0000000..f322e21
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable17.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - BLOB Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', zeroblob(4), 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', zeroblob(4), 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable18.testcase b/test/sql_stmt_rttopo_tests/toponettotable18.testcase
new file mode 100644
index 0000000..289a5a4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable18.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - NULL out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('topology', NULL, 'table', NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('topology', NULL, 'table', NULL, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable19.testcase b/test/sql_stmt_rttopo_tests/toponettotable19.testcase
new file mode 100644
index 0000000..cf53e38
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable19.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('topology', NULL, 'table', NULL, 1.2);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('topology', NULL, 'table', NULL, 1.2)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable2.testcase b/test/sql_stmt_rttopo_tests/toponettotable2.testcase
new file mode 100644
index 0000000..4ff910e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable2.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Int Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable(1, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable(1, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable20.testcase b/test/sql_stmt_rttopo_tests/toponettotable20.testcase
new file mode 100644
index 0000000..f9c8376
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable20.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - BLOB out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('topology', NULL, 'table', NULL, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('topology', NULL, 'table', NULL, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable21.testcase b/test/sql_stmt_rttopo_tests/toponettotable21.testcase
new file mode 100644
index 0000000..fed7ebb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable21.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Text out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable22.testcase b/test/sql_stmt_rttopo_tests/toponettotable22.testcase
new file mode 100644
index 0000000..b71ab30
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable22.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Text with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable23.testcase b/test/sql_stmt_rttopo_tests/toponettotable23.testcase
new file mode 100644
index 0000000..4f61322
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable23.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - BLOB with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable24.testcase b/test/sql_stmt_rttopo_tests/toponettotable24.testcase
new file mode 100644
index 0000000..67bfc92
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable24.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable25.testcase b/test/sql_stmt_rttopo_tests/toponettotable25.testcase
new file mode 100644
index 0000000..11dd2e9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable25.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL with-spatial-index
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable26.testcase b/test/sql_stmt_rttopo_tests/toponettotable26.testcase
new file mode 100644
index 0000000..3cd3858
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable26.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Integer with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out', 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable3.testcase b/test/sql_stmt_rttopo_tests/toponettotable3.testcase
new file mode 100644
index 0000000..54fd361
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable3.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable(1.5, NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable(1.5, NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable4.testcase b/test/sql_stmt_rttopo_tests/toponettotable4.testcase
new file mode 100644
index 0000000..421f9c7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable4.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Blob Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable(zeroblob(4), NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable(zeroblob(4), NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable5.testcase b/test/sql_stmt_rttopo_tests/toponettotable5.testcase
new file mode 100644
index 0000000..cd6386a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable5.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Text Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', NULL, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable6.testcase b/test/sql_stmt_rttopo_tests/toponettotable6.testcase
new file mode 100644
index 0000000..79656f3
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable6.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', 'a', 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', 'a', 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable7.testcase b/test/sql_stmt_rttopo_tests/toponettotable7.testcase
new file mode 100644
index 0000000..18af3a1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable7.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - INT prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', 1, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', 1, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable8.testcase b/test/sql_stmt_rttopo_tests/toponettotable8.testcase
new file mode 100644
index 0000000..58b2bdf
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable8.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - Double prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', 1.2, 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', 1.2, 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotable9.testcase b/test/sql_stmt_rttopo_tests/toponettotable9.testcase
new file mode 100644
index 0000000..5a21c54
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotable9.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTable - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTable('network', zeroblob(4), 'table', NULL, 'out');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTable('network', zeroblob(4), 'table', NULL, 'out')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen1.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen1.testcase
new file mode 100644
index 0000000..f5abafb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen1.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize(NULL, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize(NULL, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen10.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen10.testcase
new file mode 100644
index 0000000..3ff2992
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen10.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, NULL, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, NULL, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen11.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen11.testcase
new file mode 100644
index 0000000..6a149d1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen11.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - INT ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 1, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 1, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen12.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen12.testcase
new file mode 100644
index 0000000..fe3a22e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen12.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double ref-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 1.2, NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 1.2, NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen13.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen13.testcase
new file mode 100644
index 0000000..61545dd
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen13.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, zeroblob(4), NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, zeroblob(4), NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen14.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen14.testcase
new file mode 100644
index 0000000..05f2b03
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen14.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Text Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 'column', 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 'column', 'out', 10.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen15.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen15.testcase
new file mode 100644
index 0000000..c5ba512
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen15.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Int Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 1, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 1, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen16.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen16.testcase
new file mode 100644
index 0000000..b9dbb5b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen16.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 1.2, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', 1.2, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen17.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen17.testcase
new file mode 100644
index 0000000..c105792
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen17.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB Column
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', zeroblob(4), 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', zeroblob(4), 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen18.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen18.testcase
new file mode 100644
index 0000000..da8cb3b
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen18.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, NULL, 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, NULL, 10.0)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen19.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen19.testcase
new file mode 100644
index 0000000..592d050
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen19.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 1.2, 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, 1.2, 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen2.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen2.testcase
new file mode 100644
index 0000000..024a5c2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen2.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Int Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize(1, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize(1, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen20.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen20.testcase
new file mode 100644
index 0000000..a72a9c1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen20.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, zeroblob(4), 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('topology', NULL, 'table', NULL, zeroblob(4), 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen21.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen21.testcase
new file mode 100644
index 0000000..8ae8e47
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen21.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Text out-table
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen22.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen22.testcase
new file mode 100644
index 0000000..6854830
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen22.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Text tolerance
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 'tol');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 'tol')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen23.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen23.testcase
new file mode 100644
index 0000000..24a5da8
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen23.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB tolerance
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen24.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen24.testcase
new file mode 100644
index 0000000..c319b08
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen24.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double tolerance
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 1.1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen25.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen25.testcase
new file mode 100644
index 0000000..c21ef06
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen25.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL tolerance
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen26.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen26.testcase
new file mode 100644
index 0000000..85c576a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen26.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Integer tolerance
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen27.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen27.testcase
new file mode 100644
index 0000000..67d3610
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen27.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Text with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 'no');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 'no')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen28.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen28.testcase
new file mode 100644
index 0000000..01da82f
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen28.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen29.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen29.testcase
new file mode 100644
index 0000000..000e4d9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen29.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 1.1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 1.1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen3.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen3.testcase
new file mode 100644
index 0000000..977bd56
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen3.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize(1.5, NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize(1.5, NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen30.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen30.testcase
new file mode 100644
index 0000000..b972b01
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen30.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Integer with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen31.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen31.testcase
new file mode 100644
index 0000000..e19ce4d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen31.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - NULL with-spatial-inxed
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0, NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen4.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen4.testcase
new file mode 100644
index 0000000..a05733a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen4.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Blob Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize(zeroblob(4), NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize(zeroblob(4), NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen5.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen5.testcase
new file mode 100644
index 0000000..58cfe5e
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen5.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Text Network
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', NULL, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen6.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen6.testcase
new file mode 100644
index 0000000..857af60
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen6.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - TEXT prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', 'a', 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', 'a', 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen7.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen7.testcase
new file mode 100644
index 0000000..a528d56
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen7.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - INT prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', 1, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', 1, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen8.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen8.testcase
new file mode 100644
index 0000000..510e1e4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen8.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - Double prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', 1.2, 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', 1.2, 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponettotablegen9.testcase b/test/sql_stmt_rttopo_tests/toponettotablegen9.testcase
new file mode 100644
index 0000000..e0cc314
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponettotablegen9.testcase
@@ -0,0 +1,7 @@
+TopoNet_ToGeoTableGeneralize - BLOB prefix
+:memory: #use in-memory database
+SELECT TopoNet_ToGeoTableGeneralize('network', zeroblob(4), 'table', NULL, 'out', 10.0);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_ToGeoTableGeneralize('network', zeroblob(4), 'table', NULL, 'out', 10.0)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds1.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds1.testcase
new file mode 100644
index 0000000..1afb288
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds1.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - NULL Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds10.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds10.testcase
new file mode 100644
index 0000000..ea72c22
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds10.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Text mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 'mode');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 'mode')
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds2.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds2.testcase
new file mode 100644
index 0000000..e4f4ae1
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds2.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Int Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds3.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds3.testcase
new file mode 100644
index 0000000..913c437
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds3.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Double Network
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds4.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds4.testcase
new file mode 100644
index 0000000..d58f2f4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds4.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Blob Network 
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds5.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds5.testcase
new file mode 100644
index 0000000..866d9c7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds5.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Text Network 
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network');
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds6.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds6.testcase
new file mode 100644
index 0000000..0fa98fb
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds6.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - NULL mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', NULL);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds7.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds7.testcase
new file mode 100644
index 0000000..8f06aad
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds7.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Int mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 1);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 1)
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds8.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds8.testcase
new file mode 100644
index 0000000..d2fdc3a
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds8.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Double mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', 1.5);
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', 1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/toponetupdateseeds9.testcase b/test/sql_stmt_rttopo_tests/toponetupdateseeds9.testcase
new file mode 100644
index 0000000..856e2ea
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/toponetupdateseeds9.testcase
@@ -0,0 +1,7 @@
+TopoNet_UpdateSeeds - Blob mode
+:memory: #use in-memory database
+SELECT TopoNet_UpdateSeeds('network', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+TopoNet_UpdateSeeds('network', zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validatetopogeo1.testcase b/test/sql_stmt_rttopo_tests/validatetopogeo1.testcase
new file mode 100644
index 0000000..633bef2
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validatetopogeo1.testcase
@@ -0,0 +1,7 @@
+ST_ValidateTopoGeo - NULL Topology
+:memory: #use in-memory database
+SELECT ST_ValidateTopoGeo(NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidateTopoGeo(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/validatetopogeo2.testcase b/test/sql_stmt_rttopo_tests/validatetopogeo2.testcase
new file mode 100644
index 0000000..8c426fc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validatetopogeo2.testcase
@@ -0,0 +1,7 @@
+ST_ValidateTopoGeo - Int Topology
+:memory: #use in-memory database
+SELECT ST_ValidateTopoGeo(1);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidateTopoGeo(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validatetopogeo3.testcase b/test/sql_stmt_rttopo_tests/validatetopogeo3.testcase
new file mode 100644
index 0000000..fb9a6c9
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validatetopogeo3.testcase
@@ -0,0 +1,7 @@
+ST_ValidateTopoGeo - Double Topology
+:memory: #use in-memory database
+SELECT ST_ValidateTopoGeo(1.5);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidateTopoGeo(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validatetopogeo4.testcase b/test/sql_stmt_rttopo_tests/validatetopogeo4.testcase
new file mode 100644
index 0000000..32aa6dc
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validatetopogeo4.testcase
@@ -0,0 +1,7 @@
+ST_ValidateTopoGeo - Blob Topology
+:memory: #use in-memory database
+SELECT ST_ValidateTopoGeo(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ValidateTopoGeo(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validatetopogeo5.testcase b/test/sql_stmt_rttopo_tests/validatetopogeo5.testcase
new file mode 100644
index 0000000..03dc517
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validatetopogeo5.testcase
@@ -0,0 +1,7 @@
+ST_ValidateTopoGeo - Text Topology
+:memory: #use in-memory database
+SELECT ST_ValidateTopoGeo('topology');
+1 # rows (not including the header row)
+1 # columns
+ST_ValidateTopoGeo('topology')
+SQL/MM Spatial exception - invalid topology name.
diff --git a/test/sql_stmt_rttopo_tests/validlogicalnet1.testcase b/test/sql_stmt_rttopo_tests/validlogicalnet1.testcase
new file mode 100644
index 0000000..3c84be4
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validlogicalnet1.testcase
@@ -0,0 +1,7 @@
+ST_ValidLogicalNet - NULL Network
+:memory: #use in-memory database
+SELECT ST_ValidLogicalNet(NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidLogicalNet(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/validlogicalnet2.testcase b/test/sql_stmt_rttopo_tests/validlogicalnet2.testcase
new file mode 100644
index 0000000..3f0647d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validlogicalnet2.testcase
@@ -0,0 +1,7 @@
+ST_ValidLogicalNet - Int Network
+:memory: #use in-memory database
+SELECT ST_ValidLogicalNet(1);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidLogicalNet(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validlogicalnet3.testcase b/test/sql_stmt_rttopo_tests/validlogicalnet3.testcase
new file mode 100644
index 0000000..f0a0183
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validlogicalnet3.testcase
@@ -0,0 +1,7 @@
+ST_ValidLogicalNet - Double Network
+:memory: #use in-memory database
+SELECT ST_ValidLogicalNet(1.5);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidLogicalNet(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validlogicalnet4.testcase b/test/sql_stmt_rttopo_tests/validlogicalnet4.testcase
new file mode 100644
index 0000000..67afea7
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validlogicalnet4.testcase
@@ -0,0 +1,7 @@
+ST_ValidLogicalNet - Blob Network
+:memory: #use in-memory database
+SELECT ST_ValidLogicalNet(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ValidLogicalNet(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validlogicalnet5.testcase b/test/sql_stmt_rttopo_tests/validlogicalnet5.testcase
new file mode 100644
index 0000000..cbdf692
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validlogicalnet5.testcase
@@ -0,0 +1,7 @@
+ST_ValidLogicalNet - Text Network
+:memory: #use in-memory database
+SELECT ST_ValidLogicalNet('network');
+1 # rows (not including the header row)
+1 # columns
+ST_ValidLogicalNet('network')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_rttopo_tests/validspatialnet1.testcase b/test/sql_stmt_rttopo_tests/validspatialnet1.testcase
new file mode 100644
index 0000000..f9b23e0
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validspatialnet1.testcase
@@ -0,0 +1,7 @@
+ST_ValidSpatialNet - NULL Network
+:memory: #use in-memory database
+SELECT ST_ValidSpatialNet(NULL);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidSpatialNet(NULL)
+SQL/MM Spatial exception - null argument.
diff --git a/test/sql_stmt_rttopo_tests/validspatialnet2.testcase b/test/sql_stmt_rttopo_tests/validspatialnet2.testcase
new file mode 100644
index 0000000..e2dd299
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validspatialnet2.testcase
@@ -0,0 +1,7 @@
+ST_ValidSpatialNet - Int Network
+:memory: #use in-memory database
+SELECT ST_ValidSpatialNet(1);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidSpatialNet(1)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validspatialnet3.testcase b/test/sql_stmt_rttopo_tests/validspatialnet3.testcase
new file mode 100644
index 0000000..981eb2d
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validspatialnet3.testcase
@@ -0,0 +1,7 @@
+ST_ValidSpatialNet - Double Network
+:memory: #use in-memory database
+SELECT ST_ValidSpatialNet(1.5);
+1 # rows (not including the header row)
+1 # columns
+ST_ValidSpatialNet(1.5)
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validspatialnet4.testcase b/test/sql_stmt_rttopo_tests/validspatialnet4.testcase
new file mode 100644
index 0000000..9c1bb57
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validspatialnet4.testcase
@@ -0,0 +1,7 @@
+ST_ValidSpatialNet - Blob Network
+:memory: #use in-memory database
+SELECT ST_ValidSpatialNet(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+ST_ValidSpatialNet(zeroblob(4))
+SQL/MM Spatial exception - invalid argument.
diff --git a/test/sql_stmt_rttopo_tests/validspatialnet5.testcase b/test/sql_stmt_rttopo_tests/validspatialnet5.testcase
new file mode 100644
index 0000000..f83be65
--- /dev/null
+++ b/test/sql_stmt_rttopo_tests/validspatialnet5.testcase
@@ -0,0 +1,7 @@
+ST_ValidSpatialNet - Text Network
+:memory: #use in-memory database
+SELECT ST_ValidSpatialNet('network');
+1 # rows (not including the header row)
+1 # columns
+ST_ValidSpatialNet('network')
+SQL/MM Spatial exception - invalid network name.
diff --git a/test/sql_stmt_tests/Makefile.am b/test/sql_stmt_tests/Makefile.am
index a7b8a3e..c76c3a7 100644
--- a/test/sql_stmt_tests/Makefile.am
+++ b/test/sql_stmt_tests/Makefile.am
@@ -916,6 +916,15 @@ EXTRA_DIST = addpoint10.testcase \
 	fromgml7.testcase \
 	fromgml8.testcase \
 	fromgml9.testcase \
+	fromgmlexp1.testcase \
+	fromgmlexp2.testcase \
+	fromgmlexp3.testcase \
+	fromgmlexp4.testcase \
+	fromgmlexp5.testcase \
+	fromgmlexp6.testcase \
+	fromgmlexp7.testcase \
+	fromgmlexp8.testcase \
+	fromgmlexp9.testcase \
 	fromWkb10.testcase \
 	fromWkb11.testcase \
 	fromWkb12.testcase \
@@ -942,6 +951,33 @@ EXTRA_DIST = addpoint10.testcase \
 	fromWkb7.testcase \
 	fromWkb8.testcase \
 	fromWkb9.testcase \
+	fromgeojsonexp1.testcase \
+	fromgeojsonexp2.testcase \
+	fromgeojsonexp3.testcase \
+	fromgeojsonexp4.testcase \
+	fromgeojsonexp5.testcase \
+	fromgeojsonexp6.testcase \
+	fromgeojsonexp7.testcase \
+	fromgeojsonexp8.testcase \
+	fromgeojsonexp9.testcase \
+	fromwktexp1.testcase \
+	fromwktexp2.testcase \
+	fromwktexp3.testcase \
+	fromwktexp4.testcase \
+	fromwktexp5.testcase \
+	fromwktexp6.testcase \
+	fromwktexp7.testcase \
+	fromwktexp8.testcase \
+	fromwktexp9.testcase \
+	fromewktexp1.testcase \
+	fromewktexp2.testcase \
+	fromewktexp3.testcase \
+	fromewktexp4.testcase \
+	fromewktexp5.testcase \
+	fromewktexp6.testcase \
+	fromewktexp7.testcase \
+	fromewktexp8.testcase \
+	fromewktexp9.testcase \
 	ft_m.testcase \
 	fullnamefrompath1.testcase \
 	fullnamefrompath2.testcase \
@@ -1073,6 +1109,15 @@ EXTRA_DIST = addpoint10.testcase \
 	geomfromkml7.testcase \
 	geomfromkml8.testcase \
 	geomfromkml9.testcase \
+	geomfromkmlexp1.testcase \
+	geomfromkmlexp2.testcase \
+	geomfromkmlexp3.testcase \
+	geomfromkmlexp4.testcase \
+	geomfromkmlexp5.testcase \
+	geomfromkmlexp6.testcase \
+	geomfromkmlexp7.testcase \
+	geomfromkmlexp8.testcase \
+	geomfromkmlexp9.testcase \
 	geomfromtext10.testcase \
 	geomfromtext11.testcase \
 	geomfromtext12.testcase \
diff --git a/test/sql_stmt_tests/Makefile.in b/test/sql_stmt_tests/Makefile.in
index b47092a..d3a0435 100644
--- a/test/sql_stmt_tests/Makefile.in
+++ b/test/sql_stmt_tests/Makefile.in
@@ -1168,6 +1168,15 @@ EXTRA_DIST = addpoint10.testcase \
 	fromgml7.testcase \
 	fromgml8.testcase \
 	fromgml9.testcase \
+	fromgmlexp1.testcase \
+	fromgmlexp2.testcase \
+	fromgmlexp3.testcase \
+	fromgmlexp4.testcase \
+	fromgmlexp5.testcase \
+	fromgmlexp6.testcase \
+	fromgmlexp7.testcase \
+	fromgmlexp8.testcase \
+	fromgmlexp9.testcase \
 	fromWkb10.testcase \
 	fromWkb11.testcase \
 	fromWkb12.testcase \
@@ -1194,6 +1203,33 @@ EXTRA_DIST = addpoint10.testcase \
 	fromWkb7.testcase \
 	fromWkb8.testcase \
 	fromWkb9.testcase \
+	fromgeojsonexp1.testcase \
+	fromgeojsonexp2.testcase \
+	fromgeojsonexp3.testcase \
+	fromgeojsonexp4.testcase \
+	fromgeojsonexp5.testcase \
+	fromgeojsonexp6.testcase \
+	fromgeojsonexp7.testcase \
+	fromgeojsonexp8.testcase \
+	fromgeojsonexp9.testcase \
+	fromwktexp1.testcase \
+	fromwktexp2.testcase \
+	fromwktexp3.testcase \
+	fromwktexp4.testcase \
+	fromwktexp5.testcase \
+	fromwktexp6.testcase \
+	fromwktexp7.testcase \
+	fromwktexp8.testcase \
+	fromwktexp9.testcase \
+	fromewktexp1.testcase \
+	fromewktexp2.testcase \
+	fromewktexp3.testcase \
+	fromewktexp4.testcase \
+	fromewktexp5.testcase \
+	fromewktexp6.testcase \
+	fromewktexp7.testcase \
+	fromewktexp8.testcase \
+	fromewktexp9.testcase \
 	ft_m.testcase \
 	fullnamefrompath1.testcase \
 	fullnamefrompath2.testcase \
@@ -1325,6 +1361,15 @@ EXTRA_DIST = addpoint10.testcase \
 	geomfromkml7.testcase \
 	geomfromkml8.testcase \
 	geomfromkml9.testcase \
+	geomfromkmlexp1.testcase \
+	geomfromkmlexp2.testcase \
+	geomfromkmlexp3.testcase \
+	geomfromkmlexp4.testcase \
+	geomfromkmlexp5.testcase \
+	geomfromkmlexp6.testcase \
+	geomfromkmlexp7.testcase \
+	geomfromkmlexp8.testcase \
+	geomfromkmlexp9.testcase \
 	geomfromtext10.testcase \
 	geomfromtext11.testcase \
 	geomfromtext12.testcase \
diff --git a/test/sql_stmt_tests/atmtransform10.testcase b/test/sql_stmt_tests/atmtransform10.testcase
new file mode 100644
index 0000000..f9b9d90
--- /dev/null
+++ b/test/sql_stmt_tests/atmtransform10.testcase
@@ -0,0 +1,7 @@
+ATM_Transform() - invalid Srid
+:memory: #use in-memory database
+SELECT AsEWKT(ATM_Transform(GeomFromText('POINT(0 0)', 32632), ATM_Create(), 32633.0));
+1 # rows (not including the header row)
+1 # columns
+AsEWKT(ATM_Transform(GeomFromText('POINT(0 0)', 32632), ATM_Create(), 32633.0));
+(NULL)
diff --git a/test/sql_stmt_tests/atmtransform9.testcase b/test/sql_stmt_tests/atmtransform9.testcase
new file mode 100644
index 0000000..89eb870
--- /dev/null
+++ b/test/sql_stmt_tests/atmtransform9.testcase
@@ -0,0 +1,7 @@
+ATM_Transform() - 4326 Srid
+:memory: #use in-memory database
+SELECT AsEWKT(ATM_Transform(GeomFromText('POINT(0 0)', 32632), ATM_Create(), 32633));
+1 # rows (not including the header row)
+1 # columns
+AsEWKT(ATM_Transform(GeomFromText('POINT(0 0)', 32632), ATM_Create(), 32633));
+SRID=32633;POINT(0 0)
diff --git a/test/sql_stmt_tests/fromewktexp1.testcase b/test/sql_stmt_tests/fromewktexp1.testcase
new file mode 100644
index 0000000..ac4d04e
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp1.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-1
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1 .2 .3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1 .2 .3)'))
+POINT Z(0.1 0.2 0.3)
diff --git a/test/sql_stmt_tests/fromewktexp2.testcase b/test/sql_stmt_tests/fromewktexp2.testcase
new file mode 100644
index 0000000..5b5a893
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp2.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-2
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1 -.2 +.3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1 -.2 +.3)'))
+POINT Z(0.1 -0.2 0.3)
diff --git a/test/sql_stmt_tests/fromewktexp3.testcase b/test/sql_stmt_tests/fromewktexp3.testcase
new file mode 100644
index 0000000..8e266e4
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp3.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-3
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 .2e2 .3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 .2e2 .3E3)'))
+POINT Z(1 20 300)
diff --git a/test/sql_stmt_tests/fromewktexp4.testcase b/test/sql_stmt_tests/fromewktexp4.testcase
new file mode 100644
index 0000000..a509ad2
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp4.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-4
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 .2e-2 .3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 .2e-2 .3E+3)'))
+POINT Z(1 0.002 300)
diff --git a/test/sql_stmt_tests/fromewktexp5.testcase b/test/sql_stmt_tests/fromewktexp5.testcase
new file mode 100644
index 0000000..0823d50
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp5.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-5
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 +.2e-2 -.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 +.2e-2 -.3E+3)'))
+POINT Z(1 0.002 -300)
diff --git a/test/sql_stmt_tests/fromewktexp6.testcase b/test/sql_stmt_tests/fromewktexp6.testcase
new file mode 100644
index 0000000..1d7b65a
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp6.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-6
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 +.2e2 -.3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(.1e1 +.2e2 -.3E3)'))
+POINT Z(1 20 -300)
diff --git a/test/sql_stmt_tests/fromewktexp7.testcase b/test/sql_stmt_tests/fromewktexp7.testcase
new file mode 100644
index 0000000..f13b9df
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp7.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-7
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 2.2e2 3.3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 2.2e2 3.3E3)'))
+POINT Z(11 220 3300)
diff --git a/test/sql_stmt_tests/fromewktexp8.testcase b/test/sql_stmt_tests/fromewktexp8.testcase
new file mode 100644
index 0000000..7feddcf
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp8.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-8
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 2.2e-2 3.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 2.2e-2 3.3E+3)'))
+POINT Z(11 0.022 3300)
diff --git a/test/sql_stmt_tests/fromewktexp9.testcase b/test/sql_stmt_tests/fromewktexp9.testcase
new file mode 100644
index 0000000..0c56a4f
--- /dev/null
+++ b/test/sql_stmt_tests/fromewktexp9.testcase
@@ -0,0 +1,7 @@
+From EWKT - PointZ Exp-9
+:memory:
+SELECT AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 +2.2e-2 -3.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromEWKT('SRID=4326;POINT(1.1e1 +2.2e-2 -3.3E+3)'))
+POINT Z(11 0.022 -3300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp1.testcase b/test/sql_stmt_tests/fromgeojsonexp1.testcase
new file mode 100644
index 0000000..58e155e
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp1.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-1
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1,.2,.3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1,.2,.3]}'))
+POINT Z(0.1 0.2 0.3)
diff --git a/test/sql_stmt_tests/fromgeojsonexp2.testcase b/test/sql_stmt_tests/fromgeojsonexp2.testcase
new file mode 100644
index 0000000..5ce4376
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp2.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-2
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1,-.2,+.3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1,-.2,+.3]}'))
+POINT Z(0.1 -0.2 0.3)
diff --git a/test/sql_stmt_tests/fromgeojsonexp3.testcase b/test/sql_stmt_tests/fromgeojsonexp3.testcase
new file mode 100644
index 0000000..aaae64c
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp3.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-3
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,.2e2,.3E3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,.2e2,.3E3]}'))
+POINT Z(1 20 300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp4.testcase b/test/sql_stmt_tests/fromgeojsonexp4.testcase
new file mode 100644
index 0000000..b02e6b9
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp4.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-4
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,.2e-2,.3E+3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,.2e-2,.3E+3]}'))
+POINT Z(1 0.002 300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp5.testcase b/test/sql_stmt_tests/fromgeojsonexp5.testcase
new file mode 100644
index 0000000..d1046d9
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp5.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-5
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,+.2e-2,-.3E+3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,+.2e-2,-.3E+3]}'))
+POINT Z(1 0.002 -300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp6.testcase b/test/sql_stmt_tests/fromgeojsonexp6.testcase
new file mode 100644
index 0000000..ec734a1
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp6.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-6
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,+.2e2,-.3E3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[.1e1,+.2e2,-.3E3]}'))
+POINT Z(1 20 -300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp7.testcase b/test/sql_stmt_tests/fromgeojsonexp7.testcase
new file mode 100644
index 0000000..bd0c023
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp7.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-7
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,2.2e2,3.3E3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,2.2e2,3.3E3]}'))
+POINT Z(11 220 3300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp8.testcase b/test/sql_stmt_tests/fromgeojsonexp8.testcase
new file mode 100644
index 0000000..f501c94
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp8.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-8
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,2.2e-2,3.3E+3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,2.2e-2,3.3E+3]}'))
+POINT Z(11 0.022 3300)
diff --git a/test/sql_stmt_tests/fromgeojsonexp9.testcase b/test/sql_stmt_tests/fromgeojsonexp9.testcase
new file mode 100644
index 0000000..6e2a81d
--- /dev/null
+++ b/test/sql_stmt_tests/fromgeojsonexp9.testcase
@@ -0,0 +1,7 @@
+From GeoJSON - PointZ Exp-9
+:memory:
+SELECT AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,+2.2e-2,-3.3E+3]}'));
+1 # rows
+1 # column
+AsText(GeomFromGeoJSON('{"type":"Point","coordinates":[1.1e1,+2.2e-2,-3.3E+3]}'))
+POINT Z(11 0.022 -3300)
diff --git a/test/sql_stmt_tests/fromgmlexp1.testcase b/test/sql_stmt_tests/fromgmlexp1.testcase
new file mode 100644
index 0000000..fd455ee
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp1.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-1
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1,.2,.3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1,.2,.3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(0.1 0.2 0.3)
diff --git a/test/sql_stmt_tests/fromgmlexp2.testcase b/test/sql_stmt_tests/fromgmlexp2.testcase
new file mode 100644
index 0000000..295c3c2
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp2.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-2
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1,-.2,+.3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1,-.2,+.3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(0.1 -0.2 0.3)
diff --git a/test/sql_stmt_tests/fromgmlexp3.testcase b/test/sql_stmt_tests/fromgmlexp3.testcase
new file mode 100644
index 0000000..8db1920
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp3.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-3
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,.2e2,.3E3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,.2e2,.3E3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(1 20 300)
diff --git a/test/sql_stmt_tests/fromgmlexp4.testcase b/test/sql_stmt_tests/fromgmlexp4.testcase
new file mode 100644
index 0000000..0b88c9d
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp4.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-4
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,.2e-2,.3E+3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,.2e-2,.3E+3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(1 0.002 300)
diff --git a/test/sql_stmt_tests/fromgmlexp5.testcase b/test/sql_stmt_tests/fromgmlexp5.testcase
new file mode 100644
index 0000000..eae0c27
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp5.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-5
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,+.2e2,-.3E3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,+.2e2,-.3E3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(1 20 -300)
diff --git a/test/sql_stmt_tests/fromgmlexp6.testcase b/test/sql_stmt_tests/fromgmlexp6.testcase
new file mode 100644
index 0000000..582657e
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp6.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-6
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,+.2e2,-.3E3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>.1e1,+.2e2,-.3E3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(1 20 -300)
diff --git a/test/sql_stmt_tests/fromgmlexp7.testcase b/test/sql_stmt_tests/fromgmlexp7.testcase
new file mode 100644
index 0000000..37271b8
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp7.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-7
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,2.2e2,3.3E3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,2.2e2,3.3E3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(11 220 3300)
diff --git a/test/sql_stmt_tests/fromgmlexp8.testcase b/test/sql_stmt_tests/fromgmlexp8.testcase
new file mode 100644
index 0000000..b6aacb3
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp8.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-8
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,2.2e-2,3.3E+3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,2.2e-2,3.3E+3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(11 0.022 3300)
diff --git a/test/sql_stmt_tests/fromgmlexp9.testcase b/test/sql_stmt_tests/fromgmlexp9.testcase
new file mode 100644
index 0000000..e866206
--- /dev/null
+++ b/test/sql_stmt_tests/fromgmlexp9.testcase
@@ -0,0 +1,7 @@
+FromGML - Point Exp-9
+:memory: #use in-memory database
+SELECT AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,+2.2e-2,-3.3E+3</gml:coordinates></gml:Point>'));
+1 # rows (not including the header row)
+1 # columns
+AsEwkt(GeomFromGml('<gml:Point srsName="urn:ogc:def:crs:EPSG:4326"><gml:coordinates>1.1e1,+2.2e-2,-3.3E+3</gml:coordinates></gml:Point>')):0
+SRID=4326;POINT(11 0.022 -3300)
diff --git a/test/sql_stmt_tests/fromwktexp1.testcase b/test/sql_stmt_tests/fromwktexp1.testcase
new file mode 100644
index 0000000..c9feed0
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp1.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-1
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1 .2 .3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1 .2 .3)'))
+POINT Z(0.1 0.2 0.3)
diff --git a/test/sql_stmt_tests/fromwktexp2.testcase b/test/sql_stmt_tests/fromwktexp2.testcase
new file mode 100644
index 0000000..d88f7b2
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp2.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-2
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1 -.2 +.3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1 -.2 +.3)'))
+POINT Z(0.1 -0.2 0.3)
diff --git a/test/sql_stmt_tests/fromwktexp3.testcase b/test/sql_stmt_tests/fromwktexp3.testcase
new file mode 100644
index 0000000..42e43b3
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp3.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-3
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1e1 .2e2 .3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1e1 .2e2 .3E3)'))
+POINT Z(1 20 300)
diff --git a/test/sql_stmt_tests/fromwktexp4.testcase b/test/sql_stmt_tests/fromwktexp4.testcase
new file mode 100644
index 0000000..518c9cc
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp4.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-4
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1e1 .2e-2 .3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1e1 .2e-2 .3E+3)'))
+POINT Z(1 0.002 300)
diff --git a/test/sql_stmt_tests/fromwktexp5.testcase b/test/sql_stmt_tests/fromwktexp5.testcase
new file mode 100644
index 0000000..83eef88
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp5.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-5
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1e1 +.2e-2 -.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1e1 +.2e-2 -.3E+3)'))
+POINT Z(1 0.002 -300)
diff --git a/test/sql_stmt_tests/fromwktexp6.testcase b/test/sql_stmt_tests/fromwktexp6.testcase
new file mode 100644
index 0000000..dc42903
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp6.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-6
+:memory:
+SELECT AsText(GeomFromText('POINTZ(.1e1 +.2e2 -.3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(.1e1 +.2e2 -.3E3)'))
+POINT Z(1 20 -300)
diff --git a/test/sql_stmt_tests/fromwktexp7.testcase b/test/sql_stmt_tests/fromwktexp7.testcase
new file mode 100644
index 0000000..7b9c7c6
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp7.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-7
+:memory:
+SELECT AsText(GeomFromText('POINTZ(1.1e1 2.2e2 3.3E3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(1.1e1 2.2e2 3.3E3)'))
+POINT Z(11 220 3300)
diff --git a/test/sql_stmt_tests/fromwktexp8.testcase b/test/sql_stmt_tests/fromwktexp8.testcase
new file mode 100644
index 0000000..217fa50
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp8.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-8
+:memory:
+SELECT AsText(GeomFromText('POINTZ(1.1e1 2.2e-2 3.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(1.1e1 2.2e-2 3.3E+3)'))
+POINT Z(11 0.022 3300)
diff --git a/test/sql_stmt_tests/fromwktexp9.testcase b/test/sql_stmt_tests/fromwktexp9.testcase
new file mode 100644
index 0000000..628309c
--- /dev/null
+++ b/test/sql_stmt_tests/fromwktexp9.testcase
@@ -0,0 +1,7 @@
+From Text - PointZ Exp-9
+:memory:
+SELECT AsText(GeomFromText('POINTZ(1.1e1 +2.2e-2 -3.3E+3)'));
+1 # rows
+1 # column
+AsText(GeomFromText('POINTZ(1.1e1 +2.2e-2 -3.3E+3)'))
+POINT Z(11 0.022 -3300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp1.testcase b/test/sql_stmt_tests/geomfromkmlexp1.testcase
new file mode 100644
index 0000000..3d15182
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp1.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-1
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1,.2,.3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1,.2,.3</coordinates></Point>")))
+POINT Z(0.1 0.2 0.3)
diff --git a/test/sql_stmt_tests/geomfromkmlexp2.testcase b/test/sql_stmt_tests/geomfromkmlexp2.testcase
new file mode 100644
index 0000000..67f1f45
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp2.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-2
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1,-.2,+.3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1,-.2,+.3</coordinates></Point>")))
+POINT Z(0.1 -0.2 0.3)
diff --git a/test/sql_stmt_tests/geomfromkmlexp3.testcase b/test/sql_stmt_tests/geomfromkmlexp3.testcase
new file mode 100644
index 0000000..11fe2f6
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp3.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-3
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1e1,.2e2,.3E3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1e1,.2e2,.3E3</coordinates></Point>")))
+POINT Z(1 20 300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp4.testcase b/test/sql_stmt_tests/geomfromkmlexp4.testcase
new file mode 100644
index 0000000..19dbe52
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp4.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-4
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1e1,.2e-2,.3E+3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1e1,.2e-2,.3E+3</coordinates></Point>")))
+POINT Z(1 0.002 300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp5.testcase b/test/sql_stmt_tests/geomfromkmlexp5.testcase
new file mode 100644
index 0000000..5a9610f
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp5.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-5
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1e1,+.2e-2,-.3E+3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1e1,+.2e-2,-.3E+3</coordinates></Point>")))
+POINT Z(1 0.002 -300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp6.testcase b/test/sql_stmt_tests/geomfromkmlexp6.testcase
new file mode 100644
index 0000000..5189e58
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp6.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-6
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>.1e1,+.2e2,-.3E3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>.1e1,+.2e2,-.3E3</coordinates></Point>")))
+POINT Z(1 20 -300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp7.testcase b/test/sql_stmt_tests/geomfromkmlexp7.testcase
new file mode 100644
index 0000000..15e6b1c
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp7.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-7
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>1.1e1,2.2e2,3.3E3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>1.1e1,2.2e2,3.3E3</coordinates></Point>")))
+POINT Z(11 220 3300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp8.testcase b/test/sql_stmt_tests/geomfromkmlexp8.testcase
new file mode 100644
index 0000000..5df34b5
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp8.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-8
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>1.1e1,2.2e-2,3.3E+3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>1.1e1,2.2e-2,3.3E+3</coordinates></Point>")))
+POINT Z(11 0.022 3300)
diff --git a/test/sql_stmt_tests/geomfromkmlexp9.testcase b/test/sql_stmt_tests/geomfromkmlexp9.testcase
new file mode 100644
index 0000000..9d24e55
--- /dev/null
+++ b/test/sql_stmt_tests/geomfromkmlexp9.testcase
@@ -0,0 +1,7 @@
+From KML - Point Exp-9
+:memory:
+SELECT AsText(GeomFromKML("<Point><coordinates>1.1e1,+2.2e-2,-3.3E+3</coordinates></Point>"))
+1 # rows
+1 # column
+AsText(GeomFromKML("<Point><coordinates>1.1e1,+2.2e-2,-3.3E+3</coordinates></Point>")))
+POINT Z(11 0.022 -3300)
diff --git a/test/sql_stmt_voronoj1_tests/Makefile b/test/sql_stmt_voronoj1_tests/Makefile
new file mode 100644
index 0000000..961f961
--- /dev/null
+++ b/test/sql_stmt_voronoj1_tests/Makefile
@@ -0,0 +1,468 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_voronoj1_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_voronoj1_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_voronoj1_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_voronoj1_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = voronoj10.testcase \
+	voronoj11.testcase \
+	voronoj12.testcase \
+	voronoj13.testcase \
+	voronoj14.testcase \
+	voronoj15.testcase \
+	voronoj16.testcase \
+	voronoj17.testcase \
+	voronoj18.testcase \
+	voronoj19.testcase \
+	voronoj1.testcase \
+	voronoj20.testcase \
+	voronoj2.testcase \
+	voronoj3.testcase \
+	voronoj4.testcase \
+	voronoj5.testcase \
+	voronoj6.testcase \
+	voronoj8.testcase \
+	voronoj9.testcase 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_voronoj1_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_voronoj1_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/sql_stmt_voronoj2_tests/Makefile b/test/sql_stmt_voronoj2_tests/Makefile
new file mode 100644
index 0000000..5281c72
--- /dev/null
+++ b/test/sql_stmt_voronoj2_tests/Makefile
@@ -0,0 +1,468 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# test/sql_stmt_voronoj2_tests/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/libspatialite
+pkgincludedir = $(includedir)/libspatialite
+pkglibdir = $(libdir)/libspatialite
+pkglibexecdir = $(libexecdir)/libspatialite
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+subdir = test/sql_stmt_voronoj2_tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = aclocal-1.15
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = ar
+AS = as
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.15
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /usr/bin/grep -E
+EXEEXT = 
+FGREP = /usr/bin/grep -F
+GEOSCONFIG = /usr/local/bin/geos-config
+GEOS_CFLAGS = -I/usr/local/include
+GEOS_LDFLAGS = -L/usr/local/lib
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lrttopo -lfreexl -lproj -lsqlite3 -lz -lsqlite3  -L/usr/local/lib -lgeos_c
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBXML2_CFLAGS = -I/usr/include/libxml2 
+LIBXML2_LIBS = -lxml2 
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAINT = #
+MAKEINFO = makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /usr/bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = libspatialite
+PACKAGE_BUGREPORT = a.furieri at lqt.it
+PACKAGE_NAME = libspatialite
+PACKAGE_STRING = libspatialite 4.4.0-RC0
+PACKAGE_TARNAME = libspatialite
+PACKAGE_URL = 
+PACKAGE_VERSION = 4.4.0-RC0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = 
+PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
+RANLIB = ranlib
+SED = /usr/bin/sed
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 4.4.0-RC0
+abs_builddir = /home/sandro/fossil/libspatialite/test/sql_stmt_voronoj2_tests
+abs_srcdir = /home/sandro/fossil/libspatialite/test/sql_stmt_voronoj2_tests
+abs_top_builddir = /home/sandro/fossil/libspatialite
+abs_top_srcdir = /home/sandro/fossil/libspatialite
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias = 
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias = 
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/sandro/fossil/libspatialite/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+EXTRA_DIST = voronoj10.testcase \
+	voronoj11.testcase \
+	voronoj12.testcase \
+	voronoj13.testcase \
+	voronoj14.testcase \
+	voronoj15.testcase \
+	voronoj16.testcase \
+	voronoj17.testcase \
+	voronoj18.testcase \
+	voronoj19.testcase \
+	voronoj1.testcase \
+	voronoj20.testcase \
+	voronoj2.testcase \
+	voronoj3.testcase \
+	voronoj4.testcase \
+	voronoj5.testcase \
+	voronoj6.testcase \
+	voronoj8.testcase \
+	voronoj9.testcase 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/sql_stmt_voronoj2_tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/sql_stmt_voronoj2_tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/test-legacy-3.0.1.sqlite b/test/test-legacy-3.0.1.sqlite
index cf08c4e..540f524 100644
Binary files a/test/test-legacy-3.0.1.sqlite and b/test/test-legacy-3.0.1.sqlite differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/spatialite.git



More information about the Pkg-grass-devel mailing list