Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Simplified GeoDataFrame subsets cannot provide detailed geometry #768

Closed
forman opened this issue Sep 25, 2018 · 0 comments
Closed

Simplified GeoDataFrame subsets cannot provide detailed geometry #768

forman opened this issue Sep 25, 2018 · 0 comments

Comments

@forman
Copy link
Member

forman commented Sep 25, 2018

Expected behavior

We display points instead of original geometry for large GeoDataFrame resources (> 1000 rows). If users click such a point on the Globe, detailed geometries are reloaded.

This should also work for subsets of GeoDataFrame resources.

Actual behavior

Cate fails to reload geometries for GeoDataFrame subsets. On the web console we get the error:

RuntimeError {name: "RuntimeError", message: "Unsupported GeoJSON object type: undefined", stack: "Error↵    at new RuntimeError (D:\Projects\Webstor…de_modules\cesium\Source\ThirdParty\when.js:298:7"}
message: "Unsupported GeoJSON object type: undefined"
name: "RuntimeError"
stack: "Error↵    at new RuntimeError (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\Core\RuntimeError.js:42:19)↵    at load (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\DataSources\GeoJsonDataSource.js:868:19)↵    at D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\DataSources\GeoJsonDataSource.js:846:20↵    at Promise.then (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:196:34)↵    at D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:297:13↵    at processQueue (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:647:4)↵    at _resolve (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:333:4)↵    at promiseResolve (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:359:11)↵    at Promise.then (D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:196:34)↵    at D:\Projects\WebstormProjects\cate-desktop\app\node_modules\cesium\Source\ThirdParty\when.js:298:7"
__proto__: Error

The bug is due to the use of the feature ID as index into the GeoDataFrame instead of the original integer feature index.

Steps to reproduce the problem

  1. gdf_1 =read_geo_data_frame("my/large/shapefile.shp")
  2. res_1 = data_frame_subset(gdf=gdf_1, geometry="POLYGON ((...))", ...)
  3. click point of res_1

Specifications

Cate 2.0.dev1 ... 2.0.dev19

@forman forman self-assigned this Sep 25, 2018
@forman forman changed the title Simplified subset of GeoDataFrame fails to reload detailed geometry Simplified GeoDataFrame subsets fail cannot provide detailed geometry Sep 25, 2018
@forman forman changed the title Simplified GeoDataFrame subsets fail cannot provide detailed geometry Simplified GeoDataFrame subsets cannot provide detailed geometry Sep 25, 2018
@forman forman closed this as completed in 7d5717e Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant