Could not find geometry dimensions
See original GitHub issueALL software version info
Geoviews 1.9.1, Python 3.8
Description of expected behavior and the observed behavior
I would like to plot some points from a GeoPandas Dataframe, but i have this error : ### Could not find geometry dimensions##
import geoviews as gv
import holoviews as hv
import pandas as pd
import geopandas as gpd
from geoviews import opts
from sqlalchemy import create_engine
engine = create_engine('postgresql://docker:docker@127.0.0.1:25432/mobilitydb')
sql="Select pa,traja,mmsia from filtered where nm_a is not null and geometrytype(pa)='POINT'"
query=gpd.read_postgis(sql,engine,geom_col='pa')
query.head()
projected_df = query.to_crs('EPSG:4326')
projected_df.hvplot()
When I try with Linestrings geometries instead on Points it seems to work:
So if some knows how to solve that, I’m in. I saw that someone else also got this error : #https://github.com/geopandas/geopandas/issues/1967
The error report is quite long:
--------------------------------------------------------------------------
DataError Traceback (most recent call last)
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\IPython\core\formatters.py in __call__(self, obj, include, exclude)
968
969 if method is not None:
--> 970 return method(include=include, exclude=exclude)
971 return None
972 else:
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\dimension.py in _repr_mimebundle_(self, include, exclude)
1315 combined and returned.
1316 """
-> 1317 return Store.render(self)
1318
1319
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\options.py in render(cls, obj)
1403 data, metadata = {}, {}
1404 for hook in hooks:
-> 1405 ret = hook(obj)
1406 if ret is None:
1407 continue
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in pprint_display(obj)
280 if not ip.display_formatter.formatters['text/plain'].pprint:
281 return None
--> 282 return display(obj, raw_output=True)
283
284
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in display(obj, raw_output, **kwargs)
250 elif isinstance(obj, (CompositeOverlay, ViewableElement)):
251 with option_state(obj):
--> 252 output = element_display(obj)
253 elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):
254 with option_state(obj):
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in wrapped(element)
144 try:
145 max_frames = OutputSettings.options['max_frames']
--> 146 mimebundle = fn(element, max_frames=max_frames)
147 if mimebundle is None:
148 return {}, {}
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in element_display(element, max_frames)
190 return None
191
--> 192 return render(element)
193
194
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in render(obj, **kwargs)
66 renderer = renderer.instance(fig='png')
67
---> 68 return renderer.components(obj, **kwargs)
69
70
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\renderer.py in components(self, obj, fmt, comm, **kwargs)
408 doc = Document()
409 with config.set(embed=embed):
--> 410 model = plot.layout._render_model(doc, comm)
411 if embed:
412 return render_model(model, comm)
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\viewable.py in _render_model(self, doc, comm)
425 if comm is None:
426 comm = state._comm_manager.get_server_comm()
--> 427 model = self.get_root(doc, comm)
428
429 if config.embed:
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\viewable.py in get_root(self, doc, comm, preprocess)
482 """
483 doc = init_doc(doc)
--> 484 root = self._get_model(doc, comm=comm)
485 if preprocess:
486 self._preprocess(root)
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\layout\base.py in _get_model(self, doc, root, parent, comm)
111 if root is None:
112 root = model
--> 113 objects = self._get_objects(model, [], doc, root, comm)
114 props = dict(self._init_params(), objects=objects)
115 model.update(**self._process_param_change(props))
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\layout\base.py in _get_objects(self, model, old_objects, doc, root, comm)
101 else:
102 try:
--> 103 child = pane._get_model(doc, root, model, comm)
104 except RerenderError:
105 return self._get_objects(model, current_objects[:i], doc, root, comm)
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\pane\holoviews.py in _get_model(self, doc, root, parent, comm)
237 plot = self.object
238 else:
--> 239 plot = self._render(doc, comm, root)
240
241 plot.pane = self
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\panel\pane\holoviews.py in _render(self, doc, comm, root)
302 kwargs['comm'] = comm
303
--> 304 return renderer.get_plot(self.object, **kwargs)
305
306 def _cleanup(self, root):
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\bokeh\renderer.py in get_plot(self_or_cls, obj, doc, renderer, **kwargs)
71 combining the bokeh model with another plot.
72 """
---> 73 plot = super(BokehRenderer, self_or_cls).get_plot(obj, doc, renderer, **kwargs)
74 if plot.document is None:
75 plot.document = Document() if self_or_cls.notebook_context else curdoc()
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\renderer.py in get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
241 init_key = tuple(v if d is None else d for v, d in
242 zip(plot.keys[0], defaults))
--> 243 plot.update(init_key)
244 else:
245 plot = obj
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\plot.py in update(self, key)
980 def update(self, key):
981 if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 982 return self.initialize_plot()
983 item = self.__getitem__(key)
984 self.traverse(lambda x: setattr(x, '_updated', True))
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\plotting\bokeh\plot.py in initialize_plot(self, ranges, plot, plots, source)
111 def initialize_plot(self, ranges=None, plot=None, plots=None, source=None):
112 opts = {} if isinstance(self, HvOverlayPlot) else {'source': source}
--> 113 fig = super(GeoPlot, self).initialize_plot(ranges, plot, plots, **opts)
114 if self.geographic and self.show_bounds and not self.overlaid:
115 from . import GeoShapePlot
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\bokeh\element.py in initialize_plot(self, ranges, plot, plots, source)
1405 self.handles['plot'] = plot
1406
-> 1407 self._init_glyphs(plot, element, ranges, source)
1408 if not self.overlaid:
1409 self._update_plot(key, plot, style_element)
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\plotting\bokeh\element.py in _init_glyphs(self, plot, element, ranges, source)
1349 else:
1350 style = self.style[self.cyclic_index]
-> 1351 data, mapping, style = self.get_data(element, ranges, style)
1352 current_id = element._plot_id
1353
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\plotting\bokeh\plot.py in get_data(self, element, ranges, style)
170 def get_data(self, element, ranges, style):
171 if self._project_operation and self.geographic:
--> 172 element = self._project_operation(element, projection=self.projection)
173 return super(GeoPlot, self).get_data(element, ranges, style)
174
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\param\parameterized.py in __new__(class_, *args, **params)
3019 inst = class_.instance()
3020 inst.param._set_name(class_.__name__)
-> 3021 return inst.__call__(*args,**params)
3022
3023 def __call__(self,*args,**kw):
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\operation.py in __call__(self, element, **kwargs)
218 kwargs['link_dataset'] = self._propagate_dataset
219 kwargs['link_inputs'] = self.p.link_inputs
--> 220 return element.apply(self, **kwargs)
221
222
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\accessors.py in pipelined_call(*args, **kwargs)
43
44 try:
---> 45 result = __call__(*args, **kwargs)
46
47 if not in_method:
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\accessors.py in __call__(self, apply_function, streams, link_inputs, link_dataset, dynamic, per_element, **kwargs)
202 if hasattr(apply_function, 'dynamic'):
203 inner_kwargs['dynamic'] = False
--> 204 new_obj = apply_function(self._obj, **inner_kwargs)
205 if (link_dataset and isinstance(self._obj, Dataset) and
206 isinstance(new_obj, Dataset) and new_obj._dataset is None):
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\operation.py in __call__(self, element, **kwargs)
212 elif ((self._per_element and isinstance(element, Element)) or
213 (not self._per_element and isinstance(element, ViewableElement))):
--> 214 return self._apply(element)
215 elif 'streams' not in kwargs:
216 kwargs['streams'] = self.p.streams
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\operation.py in _apply(self, element, key)
139 if not in_method:
140 element._in_method = True
--> 141 ret = self._process(element, key)
142 if hasattr(element, '_in_method') and not in_method:
143 element._in_method = in_method
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\operation\projection.py in _process(self, element, key)
38
39 def _process(self, element, key=None):
---> 40 return element.map(self._process_element, self.supported_types)
41
42
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in pipelined_fn(*args, **kwargs)
203
204 try:
--> 205 result = method_fn(*args, **kwargs)
206 if PipelineMeta.disable:
207 return result
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in map(self, *args, **kwargs)
1220
1221 def map(self, *args, **kwargs):
-> 1222 return super(Dataset, self).map(*args, **kwargs)
1223 map.__doc__ = LabelledData.map.__doc__
1224
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\dimension.py in map(self, map_fn, specs, clone)
708 return deep_mapped
709 else:
--> 710 return map_fn(self) if applies else self
711
712
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\operation\projection.py in _process_element(self, element)
161 return element.clone(crs=self.p.projection)
162 xdim, ydim = element.dimensions()[:2]
--> 163 xs, ys = (element.dimension_values(i) for i in range(2))
164 coordinates = self.p.projection.transform_points(element.crs, xs, ys)
165 mask = np.isfinite(coordinates[:, 0])
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\operation\projection.py in <genexpr>(.0)
161 return element.clone(crs=self.p.projection)
162 xdim, ydim = element.dimensions()[:2]
--> 163 xs, ys = (element.dimension_values(i) for i in range(2))
164 coordinates = self.p.projection.transform_points(element.crs, xs, ys)
165 mask = np.isfinite(coordinates[:, 0])
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in pipelined_fn(*args, **kwargs)
203
204 try:
--> 205 result = method_fn(*args, **kwargs)
206 if PipelineMeta.disable:
207 return result
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in dimension_values(self, dimension, expanded, flat)
1103 """
1104 dim = self.get_dimension(dimension, strict=True)
-> 1105 values = self.interface.values(self, dim, expanded, flat)
1106 if dim.nodata is not None:
1107 # Ensure nodata applies to boolean data in py2
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\data\geopandas.py in values(cls, dataset, dimension, expanded, flat, compute, keep_index)
375 values = []
376 geom_type = data.geom_type.iloc[0]
--> 377 ds = dataset.clone(data.iloc[0].to_dict(), datatype=['geom_dictionary'])
378 for i, row in data.iterrows():
379 ds.data = row.to_dict()
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\element\geo.py in clone(self, data, shared_data, new_type, *args, **overrides)
115 if 'crs' not in overrides and (not new_type or isinstance(new_type, _Element)):
116 overrides['crs'] = self.crs
--> 117 return super(_Element, self).clone(data, shared_data, new_type,
118 *args, **overrides)
119
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in clone(self, data, shared_data, new_type, link, *args, **overrides)
1209 overrides['dataset'] = self.dataset
1210
-> 1211 return super(Dataset, self).clone(
1212 data, shared_data, new_type, *args, **overrides
1213 )
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\dimension.py in clone(self, data, shared_data, new_type, link, *args, **overrides)
574 # Apply name mangling for __ attribute
575 pos_args = getattr(self, '_' + type(self).__name__ + '__pos_params', [])
--> 576 return clone_type(data, *args, **{k:v for k,v in settings.items()
577 if k not in pos_args})
578
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\geoviews\element\geo.py in __init__(self, data, kdims, vdims, **kwargs)
108 elif isinstance(data, _Element):
109 kwargs['crs'] = data.crs
--> 110 super(_Element, self).__init__(data, kdims=kdims, vdims=vdims, **kwargs)
111
112
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\element\selection.py in __init__(self, *args, **kwargs)
19
20 def __init__(self, *args, **kwargs):
---> 21 super(SelectionIndexExpr, self).__init__(*args, **kwargs)
22 self._index_skip = False
23
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\__init__.py in __init__(self, data, kdims, vdims, **kwargs)
339
340 validate_vdims = kwargs.pop('_validate_vdims', True)
--> 341 initialized = Interface.initialize(type(self), data, kdims, vdims,
342 datatype=kwargs.get('datatype'))
343 (data, self.interface, dims, extra_kws) = initialized
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\holoviews\core\data\interface.py in initialize(cls, eltype, data, kdims, vdims, datatype)
269 % (intfc.__name__, e))
270 error = ' '.join([error, priority_error])
--> 271 raise six.reraise(DataError, DataError(error, intfc), sys.exc_info()[2])
272 raise DataError(error)
273
D:\Programmes\WPy64-3950\python-3.9.5.amd64\lib\site-packages\six.py in reraise(tp, value, tb)
717 if value.__traceback__ is not tb:
718 raise value.with_traceback(tb)
--> 719 raise value
720 finally:
721 value = None
DataError: None of the available storage backends were able to support the supplied data format. GeomDictInterface raised following error:
Could not find geometry dimensions
GeomDictInterface expects tabular data, for more information on supported datatypes see http://holoviews.org/user_guide/Tabular_Datasets.html
:Points [Longitude,Latitude]
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
PostGIS/QGIS Error geometry has Z dimension when snapping
I am working with QGIS 2.14 and PostGIS 2.3 (for a PostgreSQL 9.5), and I am hitting a strange error. I have a...
Read more >Error Message - Dangling Geometry - SolidWorks Web Help
This sketch contains dimensions or relations to model geometry which no longer exists. Consider: Deleting the dangling sketch entities (shown dashed and in ......
Read more >Dimensions not displayed for sketch geometry in drawing ...
Issue: Users reported that when you use the General Dimension command in a drawing in Inventor 2016, no dimensions are displayed for sketch...
Read more >Error: could not find a side polygon [...] - Forums - CFD Online
How can I fix this? Or the only whay is to try to repair the .stl geometry? PS: I followed the tutorial for...
Read more >Error: ORA-13364: Layer Dimensionality does not match ...
Error: ORA-13364: Layer Dimensionality does not match geometry dimensions. Error Message. When performing a spatial query on feature classes that are stored ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, indeed changing column’s name to ‘geometry’ works for me !
fixed in https://github.com/holoviz/geoviews/pull/545