FullExtent property showing NaN for ShapeFileTable layers

2775
1
Jump to solution
10-21-2014 07:49 AM
LukePatterson
New Contributor III

The table Extent property is showing Envelope [XMin=NaN, YMin=NaN, XMax=NaN, YMax=NaN, Wkid=3857]. This is also what the FullExtent of the layer shows. I've tried with several different files. It's evident that the map can determine the full extent since it loads the layer at the full extent. In addition, I can load the layer as a dynamic map service layer and query the metadata to determine the full extent. Is there another way to get at this information when directly loading a shapefile?

Note: I see the same issue when using GeodatabaseFeatureTable

0 Kudos
1 Solution

Accepted Solutions
JenniferNery
Esri Regular Contributor

Hi Mike,

Thank you for reporting this bug. I'm able to reproduce the issue.

You can however, do the following to get the FullExtent.

                var table = await ShapefileTable.OpenAsync(@"C:\Users\jenn6286\Downloads\states_21basic\states.shp");

                var features = await table.QueryAsync(new QueryFilter(){WhereClause= "1=1"});

                if (features != null)

                {

                    Envelope fullExtent = GeometryEngine.Union(from f in features

                                                               where f.Geometry != null

                                                               select f.Geometry).Extent;

                }

If you wanted current extent, you can use SpatialQueryFilter with Geometry=MapView.Extent.

View solution in original post

0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor

Hi Mike,

Thank you for reporting this bug. I'm able to reproduce the issue.

You can however, do the following to get the FullExtent.

                var table = await ShapefileTable.OpenAsync(@"C:\Users\jenn6286\Downloads\states_21basic\states.shp");

                var features = await table.QueryAsync(new QueryFilter(){WhereClause= "1=1"});

                if (features != null)

                {

                    Envelope fullExtent = GeometryEngine.Union(from f in features

                                                               where f.Geometry != null

                                                               select f.Geometry).Extent;

                }

If you wanted current extent, you can use SpatialQueryFilter with Geometry=MapView.Extent.

0 Kudos