<?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 Re: Adding GeoPackage Vector Layer Fails to determine extent in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/adding-geopackage-vector-layer-fails-to-determine/m-p/1603554#M94737</link>
    <description>&lt;P&gt;I finally solved this by making a connection to the GeoPackage first. Then using this connection to create the layer. I suspect that this avoids ArcPro making assumptions about the uri.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;CIMStandardDataConnection conn = new CIMStandardDataConnection();

conn.WorkspaceConnectionString = string.Format(@"DATABASE=C:/mydata/mygeopackage.gpkg");

conn.WorkspaceFactory = WorkspaceFactory.Sql;

conn.DatasetType = esriDatasetType.esriDTFeatureClass;

conn.Dataset = "vwReaches";

LayerCreationParams p = new LayerCreationParams(conn);

layer = LayerFactory.Instance.CreateLayer&amp;lt;ArcGIS.Desktop.Mapping.FeatureLayer&amp;gt;(p, parent as ILayerContainerEdit);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 02:14:21 GMT</pubDate>
    <dc:creator>PhilipBaileyUSU</dc:creator>
    <dc:date>2025-04-08T02:14:21Z</dc:date>
    <item>
      <title>Adding GeoPackage Vector Layer Fails to determine extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/adding-geopackage-vector-layer-fails-to-determine/m-p/1599239#M94357</link>
      <description>&lt;P&gt;I have a GeoPackage with a vector layer in it. The layer is in WGS84 projection and it has several features.&lt;BR /&gt;&lt;BR /&gt;When I add the layer to the active map using ArcCatalog, the layer displays correctly and the layer has the correct extent envelope displayed in the layer properties. I can right click on the layer and choose "zoom to extent" and ArcPro does indeed zoom to the layer.&lt;/P&gt;&lt;P&gt;But when I add the layer to the map using the following C# code the layer gets added to the map and displays OK, but the extent defaults to the maximum range of WGS84 (-180, 90, 180, -90).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;uri = new Uri("file:///C:/mydata/mygeopackage.gpkg/main.vwReaches")

Layer layer = LayerFactory.Instance.CreateLayer(uri, parent as ILayerContainerEdit, 0, "my layer");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I right click on the layer and choose "zoom to extent" ArcPro blinks and shifts slightly, but does not zoom to the correct extent.&lt;/P&gt;&lt;P&gt;Both methods produce identical layers in ArcGIS Pro. They possess the same SQL query. The only difference is that the layer added from code has the default WGS84 extent.&lt;/P&gt;&lt;P&gt;Any ideas please?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 00:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/adding-geopackage-vector-layer-fails-to-determine/m-p/1599239#M94357</guid>
      <dc:creator>PhilipBaileyUSU</dc:creator>
      <dc:date>2025-03-26T00:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding GeoPackage Vector Layer Fails to determine extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/adding-geopackage-vector-layer-fails-to-determine/m-p/1603554#M94737</link>
      <description>&lt;P&gt;I finally solved this by making a connection to the GeoPackage first. Then using this connection to create the layer. I suspect that this avoids ArcPro making assumptions about the uri.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;CIMStandardDataConnection conn = new CIMStandardDataConnection();

conn.WorkspaceConnectionString = string.Format(@"DATABASE=C:/mydata/mygeopackage.gpkg");

conn.WorkspaceFactory = WorkspaceFactory.Sql;

conn.DatasetType = esriDatasetType.esriDTFeatureClass;

conn.Dataset = "vwReaches";

LayerCreationParams p = new LayerCreationParams(conn);

layer = LayerFactory.Instance.CreateLayer&amp;lt;ArcGIS.Desktop.Mapping.FeatureLayer&amp;gt;(p, parent as ILayerContainerEdit);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 02:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/adding-geopackage-vector-layer-fails-to-determine/m-p/1603554#M94737</guid>
      <dc:creator>PhilipBaileyUSU</dc:creator>
      <dc:date>2025-04-08T02:14:21Z</dc:date>
    </item>
  </channel>
</rss>

