Geo-Spatial Data Repository of WeGovNow :: Documentation

Documentation and Examples of usage.

Table of Contents

General concept of the web service.

The concept was described in Deliverable 1.2, the extraction related to data quality concept and GSDR of WeGovNow is presented here.

Frontend description

gsdr frontend

  1. Select a pilot sites. Currently only San Dona Di Piave is available, funther Turin and Southwark will be added.
  2. One of the following datalayers are available:
    • OpenStreetMap.Current - review of OSM current data for a pilot site area.
    • OpenStreetMap.PublicSectorInformation - review of public sector information of a pilot site extracted from OSM data.
    • OnToMap.PublicSectorInformation - review of public sector information of provided by OnToMap.
    • OpenData.PublicSectorInformation - review of public sector information of provided by OpenData (Municipalities).
    • OpenStreetMap-OnToMap.PublicSectorInformation - comparison of OSM (PSI extraction) vs. OTM PSI data.
    • OpenStreetMap-OpenData.PublicSectorInformation - comparison of OSM (PSI extraction) vs. OpenData PSI.
  3. Map visualization types:
    • Features - represents data as separate square features.
    • Heatmap - represents data as field.
    • Tiles - represents data by tiles (features summarize data for current zoom level+3).
  4. Select an data attribute to display. The following attributes are available:
    • Quality(wbi) - aggregated data quality of a layer.
    • DGeNpt - number of points (Data Geometry Number of Points).
    • DGeLinNumb- number of lines (Data Geometry Number of Lines).
    • DGeLinLeng - lengths of lines (Data Geometry Line Lengths).
    • DGeAreNumb - number of polygons (Data Geometry Areas Number).
    • DGeAreLing - length of polygons' boundaries.
    • DGeAreArea - area of polygons.
    • DAt - number of attributes.
    • MUh - number of users' hits (Metadata User Hits).
    • MCoNco - contributors' activity, number of contributors (Metadata Contributors Number of Contributors).
    • MCoNcs - contributors' activity, number of changesets (Metadata Contributors Number of Changesets).
    • MTlAve - average version of features (Metadata Time Average Version)
    • MTlAti - average integer timestamp (Metadata Time Average Timestamp)
  5. Apply button - update map with respect to form parameters.
  6. A popup window - emerging by clicking on a map.
  7. Zooming control.
  8. Full screen and reset map rotation. A map could be rotated by Shift+LeftMouse on desktop computer, or by two fingers on a touch screen.

API description

Syntax

Keys

FROM AND OR NOT IN AS BETWEEN JOIN ON LIKE LIMIT SELECT WHERE HAVING GROUP__s__BY ORDER__s__BY SELECT__s__DISTINCT DESC ASC CASE WHEN THEN ELSE END
__s__  =  ' ' space  
___    =  '('
__v__  =  ''
__e__  =  '='
__ne__ =  '!='
__l__  =  '<'
__g__  =  '>'
__le__ =  '<='
__ge__  =  '>='
__a__  =  '+'
__r__  =  '-'
__m__  =  '*'
__d__  =  '/'
  

Values

___  =  ")" three underscore symbols
__s__  =  " " space
__p__  =  "%"
__c__  =  ","
__q__  =  "'"
__r__  =  "-"
__m__  =  "*"
  

Functions

SQLite core funtions

abs char coalesce glob hex ifnull instr last_insert_rowid length like lower ltrim ltrim max min nullif printf quote random randomblob replace round rtrim soundex sqlite_version substr trim typeof unicode unlikely upper zeroblob

SQLite Aggregate Functions

avg count count group_concat max min sum total

SQLite extension-functions.c

atan2 acosh asinh atanh difference cosh sinh tanh coth power square ceil floor replicate charindex leftstr rightstr ltrim rtrim trim replace reverse proper padl padr padc strfilter stdev variance mode median lower_quartile upper_quartile

SpatiaLite functions reference list

spatialite_version freexl_version proj4_version geos_version lwgeom_version libxml2_version HasIconv HasMathSQL HasGeoCallbacks HasProj HasGeos HasGeosAdvanced HasGeosTrunk HasGeosReentrant HasGeosOnlyReentrant HasLwGeom HasLibXML2 HasEpsg HasFreeXL HasGeoPackage HasGCP HasTopology CastToInteger CastToDouble CastToText CastToBlob ForceAsNull CreateUUID MD5Checksum MD5TotalChecksum EncodeURL DecodeURL FileExtFromPath GetGpkgMode GetGpkgAmphibiousMode GetDecimalPrecision Abs Acos Asin Atan Atan2 Ceil Cos Cot Degrees Exp Floor Ln Log Log2 Log10 PI Pow Radians Sign Sin Sqrt Stddev_pop Stddev_samp Tan Var_pop Var_samp CvtToKm CvtToDm CvtToCm CvtToMm CvtToKmi CvtToIn CvtToFt CvtToYd CvtToMi CvtToFath CvtToCh CvtToLink CvtToUsIn CvtToUsFt CvtToUsYd CvtToUsMi CvtToUsCh CvtToIndFt CvtToIndYd CvtToIndCh LongLatToDMS LongitudeFromDMS IsZipBlob IsPdfBlob IsGifBlob IsPngBlob IsTiffBlob IsJpegBlob IsExifBlob IsExifGpsBlob IsWebpBlob IsJP2Blob GetMimeType BlobFromFile BlobToFile ST_Point MakePoint MakePointZ MakePointM MakePointZM MakeLine MakeLine MakeLine MakeCircle MakeEllipse MakeArc MakeEllipticArc MakeCircularSector MakeEllipticSector MakeCircularStripe SquareGrid TriangularGrid HexagonalGrid BuildMbr BuildCircleMbr Extent ToGARS GARSMbr MbrMinX MbrMinY MbrMaxX MbrMaxY ST_MinZ ST_MaxZ ST_MinM ST_MaxM GeomFromText ST_WKTToSQL PointFromText LineFromText PolyFromText MPointFromText MLineFromText MPolyFromText GeomCollFromText BdPolyFromText BdMPolyFromText GeomFromWKB ST_WKBToSQL PointFromWKB LineFromWKB PolyFromWKB MPointFromWKB MLineFromWKB MPolyFromWKB GeomCollFromWKB BdPolyFromWKB BdMPolyFromWKB AsText AsWKT AsBinary AsSVG AsKml GeomFromKml AsGml GeomFromGML AsGeoJSON GeomFromGeoJSON AsEWKB GeomFromEWKB AsEWKT GeomFromEWKT AsFGF GeomFromFGF Dimension CoordDimension ST_NDims ST_Is3D ST_IsMeasured GeometryType SRID SetSRID IsEmpty IsSimple IsValid IsValidReason IsValidDetail Boundary Envelope ST_Expand ST_NPoints ST_NRings ST_Reverse ST_ForceLHR CastToPoint CastToLinestring CastToPolygon CastToMultiPoint CastToMultiLinestring CastToMultiPolygon CastToGeometryCollection CastToMulti CastToSingle CastToXY CastToXYZ CastToXYM CastToXYZM X Y Z M StartPoint EndPoint GLength Perimeter GeodesicLength GreatCircleLength IsClosed IsRing PointOnSurface Simplify SimplifyPreserveTopology NumPoints PointN AddPoint SetPoint SetStartPoint SetEndPoint RemovePoint Centroid Area ExteriorRing NumInteriorRing InteriorRingN NumGeometries GeometryN MbrEqual MbrDisjoint MbrTouches MbrWithin MbrOverlaps MbrIntersects ST_EnvIntersects MbrContains Equals Disjoint Touches Within Overlaps Crosses Intersects Contains Covers CoveredBy Relate Distance PtDistWithin Intersection Difference GUnion GUnion SymDifference Buffer ConvexHull HausdorffDistance OffsetCurve SingleSidedBuffer SharedPaths Line_Interpolate_Point Line_Interpolate_Equidistant_Points Line_Locate_Point Line_Substring ClosestPoint ShortestLine Snap Collect LineMerge BuildArea Polygonize MakePolygon UnaryUnion DissolveSegments DissolvePoints LinesFromRings LinesCutAtNodes RingsCutAtNodes CollectionExtract ExtractMultiPoint ExtractMultiLinestring ExtractMultiPolygon ST_Locate_Along_Measure ST_Locate_Between_Measures DelaunayTriangulation VoronojDiagram ConcaveHull MakeValid MakeValidDiscarded Segmentize Split SplitLeft SplitRight Azimuth Project SnapToGrid GeoHash AsX3D MaxDistance ST_3DDistance ST_3DMaxDistance ST_3dLength ST_Node SelfIntersections Transform SridFromAuthCRS ShiftCoords ST_Translate ST_Shift_Longitude NormalizeLonLat ScaleCoords RotateCoords ReflectCoords SwapCoords ATM_Create ATM_CreateTranslate ATM_CreateScale ATM_CreateRotate ATM_CreateXRoll ATM_CreateYRoll ATM_Multiply ATM_Translate ATM_Scale ATM_Rotate ATM_XRoll ATM_YRoll ATM_Determinant ATM_IsInvertible ATM_Invert ATM_IsValid ATM_AsText ATM_Transform GCP_Compute GCP_IsValid GCP_AsText GCP2ATM GCP_Transform SridIsGeographic SridIsProjected SridHasFlippedAxes SridGetSpheroid SridGetPrimeMeridian SridGetDatum SridGetUnit SridGetProjection SridGetAxis_1_Name SridGetAxis_1_Orientation SridGetAxis_2_Name SridGetAxis_2_Orientation

Tiles Common Framework Functions

tile2quadkey quadkey2tile tile2geo geo2tile getPixelSize getEpsilon tile2geom isIn isTouch polygonTileIntersect getTilesOfPolygon

Custom function

levenshteinDistance

Basic Interactive Examples

Simple request (1)

Returns 1

Simple request (1 2 3)

Select several values

Using AS and Special Processing of id

Combining SQL clause (AS in the example). Special processing of id name (see result).

Using of SQL functions

Returns number of elements in the table

Math equation

Constructing of GeoJSON data and tile based requiest

Special processing of the AsGeoJSON function

Obtaining quality assessment results

Special processing of an MBR request

Interactive Examples - Quick Quality Assessment

Text input improvement - Spelling check and autocomplete.

Complete Text Input Keys

The following SQL request allows to implement autocomplete functionality based on keys frequency.

URL: api.tcl?SELECT=txt,__count,txt,___&FROM=elements&JOIN=tags&ON=elements.id&__e__=tags.id&JOIN=keys&ON=keys.rowid&__e__=tags.key&WHERE=txt&LIKE=__q__YourString__p____q__&GROUP__s__BY=txt&ORDER__s__BY=__count,txt,___&DESC&LIMIT=5

Complete Text Input Vals

The following SQL request allows to implement autocomplete functionality based on values frequency.

URL: api.tcl?SELECT=txt,__count,txt,___&FROM=elements&JOIN=tags&ON=elements.id&__e__=tags.id&JOIN=vals&ON=vals.rowid&__e__=tags.val&WHERE=txt&LIKE=__q__YourString__p____q__&GROUP__s__BY=txt&ORDER__s__BY=__count,txt,___&DESC&LIMIT=5

Find Similar Values by Levenshtein Distance

URL: api.tcl?SELECT=txt&FROM&___&SELECT__s__DISTINCT=txt&FROM=elements&JOIN=eltile&ON=element&__e__=elements.id&JOIN=tiles&ON=tiles.rowid&__e__=eltile.tile&JOIN=tags&ON=tags.id&__e__=elements.id&JOIN=vals&ON=vals.rowid&__e__=tags.val&WHERE=tiles.col&__e__=280444&AND=tiles.row&__e__=187294,___&ORDER__s__BY=__levenshteinDistance,txt,__q__YourString__q__,___&LIMIT=1

Interactive Text Boxes Using OpenStreetMap for San DonĂ  di Piave

Complete Text Input Keys

The following implements autocomplete functionality based on keys frequency.

URL: api.tcl?SELECT=txt,__count,txt,___&FROM=elements&JOIN=tags&ON=elements.id&__e__=tags.id&JOIN=keys&ON=keys.rowid&__e__=tags.key&WHERE=elements.datasrc&__e__=__q__SanDona.OSM__q__&AND=txt&LIKE=__q__YourString__p____q__&GROUP__s__BY=txt&ORDER__s__BY=__count,txt,___&DESC&LIMIT=5

Complete Text Input Vals

The following implements autocomplete functionality based on values frequency.

URL: api.tcl?SELECT=txt,__count,txt,___&FROM=elements&JOIN=tags&ON=elements.id&__e__=tags.id&JOIN=vals&ON=vals.rowid&__e__=tags.val&WHERE=elements.datasrc&__e__=__q__SanDona.OSM__q__&AND=txt&LIKE=__q__YourString__p____q__&GROUP__s__BY=txt&ORDER__s__BY=__count,txt,___&DESC&LIMIT=5

Find Similar Values by Levenshtein Distance

URL: api.tcl?SELECT=txt&FROM&___&SELECT__s__DISTINCT=txt&FROM=elements&JOIN=eltile&ON=element&__e__=elements.id&JOIN=tiles&ON=tiles.rowid&__e__=eltile.tile&JOIN=tags&ON=tags.id&__e__=elements.id&JOIN=vals&ON=vals.rowid&__e__=tags.val&WHERE=tiles.col&__e__=280444&AND=tiles.row&__e__=187294&AND=elements.datasrc&LIKE=__q__SanDona.OSM__q__,___&ORDER__s__BY=__levenshteinDistance,txt,__q__YourString__q__,___&LIMIT=1

Obtaining geodata - Selecting existing objects.

Click on object to see attribute values.

Client side snapping functionality for digitizing.

Server-side snapping functionality