<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I use Spatialite400.dll? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015393#M5954</link>
    <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I was pleased to find&amp;nbsp;"C:\Program Files\ArcGIS\Pro\bin\spatialite400x.dll".&amp;nbsp; (I wasn't expecting it since there's no mention of spatialite in &lt;A href="https://www.esri.com/content/dam/esrisites/en-us/media/legal/open-source-acknowledgements/third-party-software-acknowledgements.pdf" target="_self"&gt;Esri's 3rd Party Acknowledgements doc&lt;/A&gt;.)&lt;/P&gt;&lt;P&gt;I'm able to load it as an extension in Db Browser; however, the &lt;A href="http://www.gaia-gis.it/gaia-sins/spatialite-sql-5.0.0.html#p9" target="_self"&gt;spatialite polygon queries&lt;/A&gt; all seem to return null.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 460px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3532iA506F64F89E2988E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&lt;/P&gt;&lt;P&gt;Thanks, Kirk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Jan 2021 18:33:16 GMT</pubDate>
    <dc:creator>KirkKuykendall1</dc:creator>
    <dc:date>2021-01-10T18:33:16Z</dc:date>
    <item>
      <title>How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015393#M5954</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I was pleased to find&amp;nbsp;"C:\Program Files\ArcGIS\Pro\bin\spatialite400x.dll".&amp;nbsp; (I wasn't expecting it since there's no mention of spatialite in &lt;A href="https://www.esri.com/content/dam/esrisites/en-us/media/legal/open-source-acknowledgements/third-party-software-acknowledgements.pdf" target="_self"&gt;Esri's 3rd Party Acknowledgements doc&lt;/A&gt;.)&lt;/P&gt;&lt;P&gt;I'm able to load it as an extension in Db Browser; however, the &lt;A href="http://www.gaia-gis.it/gaia-sins/spatialite-sql-5.0.0.html#p9" target="_self"&gt;spatialite polygon queries&lt;/A&gt; all seem to return null.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 460px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3532iA506F64F89E2988E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&lt;/P&gt;&lt;P&gt;Thanks, Kirk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 18:33:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015393#M5954</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-01-10T18:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015401#M5955</link>
      <description>&lt;P&gt;some historical discussion exists in the community... For example&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/data-management-ideas/sqlite-as-future-proof-backend-for-personal-geodabases/idi-p/924156" target="_blank"&gt;SQLite as future-proof backend for Personal Geodab... - GeoNet, The Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 22:13:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015401#M5955</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-10T22:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015646#M5965</link>
      <description>&lt;P&gt;Hi Kirk,&lt;/P&gt;&lt;P&gt;We have this working in-house, so it might be something with your environment or your database file. &amp;nbsp;You might want to open a tech support issue so that we can take a closer look.&lt;/P&gt;&lt;P&gt;(SpatialLite should be in the 3rd Party Acknowledgement doc)&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 18:04:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015646#M5965</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2021-01-11T18:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015662#M5970</link>
      <description>&lt;P&gt;Hi Kirk,&lt;/P&gt;&lt;P&gt;As you yourself already found out, the Mobile Geodatabase uses ESRI's own ST_Geometry implementation (the link and all sublinks you found in the ArcMap Help that hasn't yet been ported to the Pro Help: &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/what-is-the-st-geometry-storage-type.htm" target="_blank" rel="noopener"&gt;https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/what-is-the-st-geometry-storage-type.htm&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I have recently been experimenting with SQLite and ArcGIS Pro too, but using a different path. I use Python and arcpy to write out geometries to a SQLite database created with the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-sqlite-database.htm" target="_self"&gt;Create SQLite Database&lt;/A&gt; geoprocessing tool (also see &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/databases/work-with-sqlite-databases-in-arcgis-pro.htm" target="_self"&gt;this link&lt;/A&gt;). The data involved is coming from OpenStreetMap, and is stored in a PostgreSQL / PostGIS database, that is &lt;STRONG&gt;NOT&lt;/STRONG&gt; ESRI Enterprise Geodatabase enabled, just an ordinary spatial (PostGIS) database.&lt;/P&gt;&lt;P&gt;Note that the process described below DOES NOT work for the Mobile Geodatabase, just a plain SQLite database as created with the geoprocessing tool mentioned above, there appear to be additional dependencies that regulate data type validation that I haven't been able to figure out yet.&lt;/P&gt;&lt;P&gt;In order for the SQLite INSERT to work, I need to:&lt;/P&gt;&lt;P&gt;- Create a SQLite database using the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-sqlite-database.htm" target="_self"&gt;Create SQLite Database&lt;/A&gt; geoprocessing tool.&lt;/P&gt;&lt;P&gt;- Load the &lt;STRONG&gt;stgeometry_sqlite.dll&lt;/STRONG&gt; library that ESRI created and made available as a separate download on the &lt;STRONG&gt;My ESRI&lt;/STRONG&gt; website (unfortunately, this library appears not part of the standard Pro installation) in Python using the &lt;A href="https://docs.python.org/3.7/library/sqlite3.html" target="_self"&gt;sqlite3&lt;/A&gt; Python package that is part of the default install of Pro's Python environment (you need to use &lt;STRONG&gt;enable_load_extension &lt;/STRONG&gt;and &lt;STRONG&gt;load_extension&lt;/STRONG&gt; for that in the sqlite3 Python module).&lt;/P&gt;&lt;P data-unlink="true"&gt;- Create a table with &lt;STRONG&gt;CREATE TABLE&lt;/STRONG&gt; using a &lt;STRONG&gt;sqlite3&lt;/STRONG&gt; connection/cursor&lt;/P&gt;&lt;P data-unlink="true"&gt;- Add a geometry column to this table using the ESRI ST_Geometry library's &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/register-an-st-geometry-column.htm" target="_self"&gt;AddGeometryColumn&lt;/A&gt; function and &lt;STRONG&gt;sqlite3&lt;/STRONG&gt; cursor.&lt;/P&gt;&lt;P&gt;- To use PostGIS &lt;A href="https://postgis.net/docs/ST_AsBinary.html" target="_self"&gt;ST_AsBinary&lt;/A&gt; with a &lt;A href="https://www.psycopg.org/docs/" target="_self"&gt;psycopg2&lt;/A&gt; cursor to read the PostGIS database and extract the features as WKB.&lt;/P&gt;&lt;P data-unlink="true"&gt;- Insert the geometries using a &lt;A href="https://docs.python.org/3.7/library/sqlite3.html" target="_self"&gt;sqlite3&lt;/A&gt; database connection / cursor using &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-geomfromwkb.htm" target="_self"&gt;ST_GeomFromWKB&lt;/A&gt;. Note that ESRI's ST_Geometry library supports other options like &lt;STRONG&gt;ST_MPolyFromWKB&lt;/STRONG&gt; as well for dedicated geometry types, but I haven't succeeded in using these properly, and the &lt;STRONG&gt;ST_GeomFromWKB&lt;/STRONG&gt; "just works".&lt;/P&gt;&lt;P data-unlink="true"&gt;- Add a spatial index using the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-spatial-index.htm" target="_self"&gt;Add Spatial Index&lt;/A&gt; geoprocessing tool.&lt;/P&gt;&lt;P data-unlink="true"&gt;Note that implementing all of this &lt;STRONG&gt;was particular tough&lt;/STRONG&gt;, this is certainly not for the faint of heart! It took me the better part of two weeks to get it running.&lt;/P&gt;&lt;P data-unlink="true"&gt;However, on the bright side, I am now capable of exporting geometries to a SQLite database at a rate of just over &lt;STRONG&gt;100M&lt;/STRONG&gt; records / hour! (yes, my current OpenStreetMap database is that big...). This is probably about 5x the speed or more of using an &lt;STRONG&gt;arcpy.da.SearchCursor&lt;/STRONG&gt; and &lt;STRONG&gt;arcpy.da.InsertCursor&lt;/STRONG&gt; that could do the same thing. This speed difference was crucial for me. This database can subsequently be read by ArcGIS Pro again.&lt;/P&gt;&lt;P data-unlink="true"&gt;By the way, as alternative to &lt;A href="https://www.psycopg.org/docs/" target="_self"&gt;psycopg2&lt;/A&gt;, there is &lt;A href="https://github.com/mkleehammer/pyodbc/wiki" target="_self"&gt;pyodbc&lt;/A&gt;, which supports a far wider range of databases besides PostgreSQL (e.g. SQL Server, Oracle), but lacks for example server side cursors. Both Python DB API adapters have their strengths and weaknesses...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 17:11:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015662#M5970</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2021-01-12T17:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015693#M5971</link>
      <description>&lt;P&gt;Thought you might like this as well, ArcGIS Pro's Pairwise Dissolve tool dissolving a 379 M(!) record dataset of building geometries...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoBoeringa_0-1610393293452.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3586i28D8E3A4E34AC6CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoBoeringa_0-1610393293452.png" alt="MarcoBoeringa_0-1610393293452.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 19:31:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015693#M5971</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2021-01-11T19:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015712#M5972</link>
      <description>&lt;P&gt;Wow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fear the "lite" in Sqlite may have led people to think it can't do any heavy lifting.&lt;/P&gt;&lt;P&gt;How many cores is Pairwise_Dissolve using?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 20:18:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015712#M5972</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-01-11T20:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use Spatialite400.dll?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015724#M5974</link>
      <description>&lt;P&gt;The Pairwise Dissolve tool is actually just running on a modest 4C/8T Core i7 desktop (32GB RAM though). And I only set the geoprocessing environment to allow 75% 3C/6T usage of the processor, so as to not completely consume this limited CPU.&lt;/P&gt;&lt;P&gt;The database is running on a HP Z840 workstation though, a refurbished one that I recently acquired, and has dual Xeon E5-2680 v4 with 14C/28T each, so 28C/56T total.&lt;/P&gt;&lt;P&gt;This is some custom Python multi-threaded code I developed (unrelated to the SQLite stuff), that goes flat out at 100% usage on the database server generalizing geometries in PostGIS:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoBoeringa_1-1610435892657.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3618i7EE9462D12D8EFFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoBoeringa_1-1610435892657.png" alt="MarcoBoeringa_1-1610435892657.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 07:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-use-spatialite400-dll/m-p/1015724#M5974</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2021-01-12T07:18:26Z</dc:date>
    </item>
  </channel>
</rss>

