Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 13, 2024
1 parent 7800cd3 commit f08ac32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sparqlunicorn_ontdoc/export/pages/geometryviewpage.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from rdflib import URIRef, Literal
from doc.docconfig import DocConfig
from doc.docutils import DocUtils
from doc.literalutils import LiteralUtils

import shapely.wkt
import shapely.geometry
import json




class GeometryViewPage:

def generatePageWidget(self,graph,templates,subject,f,uritotreeitem,geojsonrep,predobjmap,geocache,parameters={},onlybody=False):
Expand Down Expand Up @@ -54,14 +57,14 @@ def generateCollectionWidget(self,graph,templates,subject,f,uritotreeitem,featur
if geoinstance != None and isinstance(geoinstance[1], Literal) and (
str(geoinstance[0]) in DocConfig.geoproperties or str(
geoinstance[1].datatype) in DocConfig.geoliteraltypes):
geojsonrep = DocUtils.processLiteral(str(geoinstance[1]), str(geoinstance[1].datatype), "")
geojsonrep = LiteralUtils.processLiteral(str(geoinstance[1]), str(geoinstance[1].datatype), "")
uritotreeitem[str(subject)][-1]["type"] = "geocollection"
elif geoinstance != None and str(geoinstance[0]) in DocConfig.geopointerproperties:
uritotreeitem[str(subject)][-1]["type"] = "featurecollection"
for geotup in graph.predicate_objects(geoinstance[1], True):
if isinstance(geotup[1], Literal) and (str(geotup[0]) in DocConfig.geoproperties or str(
geotup[1].datatype) in DocConfig.geoliteraltypes):
geojsonrep = DocUtils.processLiteral(str(geotup[1]), str(geotup[1].datatype), "")
geojsonrep = LiteralUtils.processLiteral(str(geotup[1]), str(geotup[1].datatype), "")
if geojsonrep != None and "coordinates" in geojsonrep and len(geojsonrep["coordinates"]) > 0:
if uritotreeitem != None and str(memberid) in uritotreeitem:
featcoll["features"].append({"type": "Feature", 'id': str(memberid),
Expand Down

0 comments on commit f08ac32

Please sign in to comment.