Skip to content

Up down loader option in the Design module

cornelissenja edited this page Sep 6, 2018 · 42 revisions

The up/down-loader option adds methods to upload and download data to and from the design module layers. There are 2 formats supported: shape and excel files.

Shape files

Shape files are supported with 3 geometries: dots, lines and polygons.

  • Dots are represented as circles that have a constant diameter, regardless of the zoom level of the map the circles are shown with the same dimensions and do not scale. The circles can have 2 colors: the outline and the fill can be determined via a color palette.
  • Lines can be made of multiple line segments. The coloring of the lines is determined via a color palette.
  • Polygons are build up by a closed line (the last point of the line is the same location as the starting point of the line). The closed line is drawn in the outline color defined by a color palette and filled with the fill color defined by that same color palette.

The data fields in a shape file are limited to 10 characters. Because the field names are used to create or link to data fields of the table in the ecodistrict database it is important when using shape files in uploading data to initially create the fields with short names no longer then 10 characters. If longer names are used, downloaded shapes with fields trimmed to 10 characters cannot be uploaded again because of the mismatch in field names.

Excel files

Downloaded Excel files contain all fields available in the table that have known types. The first row of the Excel file will contain field names and type to help parse the data to import into the database. Special codes are used to remove fields and/or rows from the data. The file type is called Excel because it is in an export format of Excel. The format is the text-export from Excel with a tab character as a field delimiter. Excel can directly open, save and work with this format. Floating point numbers should be exported in the US format: a dot as decimal separator, it can be in normal x.xxxx format or in scientific format x.xxe+xx.

Color palettes

There are 2 types of legends that can be derived from given palettes. The palette is defined in JSON, with some extra information a legend can automatically be derived from this.

  • Discrete legend: discrete steps or levels with specified colors.
  • Ramp color legend: gradients between values.

Definition of a legend in JSON

color = [<red>, <green>, <blue>, <alpha>] | "#<rr><bb><gg><aa>" | "#<r><b><g><a>" | "#<rr><bb><gg>" | "#<r><b><g>" where red, green, blue are [0..255], alpha is [0.0..1.0] (default=1.0=opaque)

`geoColor = { `
	`"fill": <color>(default=[0, 0, 0, 255]),`
	`"outline": <color>(default=[0, 0, 0, 0]),`
	`"fill2": <color>(default=[0, 0, 0, 0])`
`}`

`legend common: {`
	`"type": "discrete"(default)|"ramp",`
	`"description": <string>,`
	`"entries": []`
`}`

`discreteEntry: {`
	`"color": <geoColor>,`
	`"minValue": <double>,`
	`"maxValue": <double> (default=<minValue>+1), `
	`"description": <string>(default="")`
`}`

`discrete: {`
	`"orientationVertical": true(default)|false`
	`"noDataColor": <geoColor>(default={fill: [0, 0, 0, 255]})`
	`"entries": [<discreteEntry>[,<discreteEntry>]]`
`}`

`rampEntry: {`
	`"color": <color>,`
	`"value": <double>,`
	`"description": <string>(default=<value-as-string>`
`}`

`ramp: {`
	`"lowerDataColor": <color>(default=[0, 0, 0, 255]), color used when value is lower then lowest defined range`
	`"noDataColor": <color>(default=[0, 0, 0, 255]), color used when value is NaN or null`
	`"higherDataColor": <color>(default=[0, 0, 0, 255]), color used when value is higher then lowest defined range`
	`"width": <int>(default=300),`
	`"logScale": false(default)| true,`
	`"tickFontSize": <int>(default=11),`
	`"entries": [<rampEntry>[,<rampEntry>]]`
`}`

Field types and names

Clone this wiki locally