GeoJSON: Difference between revisions
No edit summary |
|||
Line 12: | Line 12: | ||
* The file must have a CRS (Coordinate Reference System) defined | * The file must have a CRS (Coordinate Reference System) defined | ||
* The file must use character encoding UTF-8. | * The file must use character encoding UTF-8. | ||
* All desired attributes must be numerical, so that they can be loaded as valid [[attribute]] values. Attributes with text values are ignored when attempting to load them as attributes. | * All desired attributes must be numerical, so that they can be loaded as valid [[attribute]] values. Attributes with text values are ignored when attempting to load them as attributes. See for steps, [[https://previewsupport.tygron.com/wiki/Data_preparation#Text_attributes|this page]]. | ||
Also take a look at the [[Data_preparation|data preparation]] page for considerations and tips regarding importing geo data. | |||
{{editor steps|title=create a GeoJSON file|Open the Geo Dataset in a GIS | {{editor steps|title=create a GeoJSON file|Open the Geo Dataset in a GIS|Save the file in GeoJSON format with encoding UTF-8}} | ||
The next sections show how to create a GeoJSON file in ArcGIS en QGIS. | The next sections show how to create a GeoJSON file in ArcGIS en QGIS. | ||
Line 33: | Line 34: | ||
</gallery><br clear=all> | </gallery><br clear=all> | ||
====2 | ====2. Saving==== | ||
The last step is to save the file as a GeoJSON file. This can be done by clicking on the specific layer with the right mouse button and selecting the "Save as" option. Choose the GeoJSON format, a location and file name and the UTF-8 character set. Saving will create a new ".geojson" file with all the desired data, ready to import into the {{software}}. | The last step is to save the file as a GeoJSON file. This can be done by clicking on the specific layer with the right mouse button and selecting the "Save as" option. Choose the GeoJSON format, a location and file name and the UTF-8 character set. Saving will create a new ".geojson" file with all the desired data, ready to import into the {{software}}. | ||
<gallery mode="nolines"> | <gallery mode="nolines"> |
Revision as of 13:56, 21 August 2019
What is GeoJSON
GeoJSON is a file format for geographical data. It is a simple text-based format which can be read by humans, but also by computers. Any Geo Dataset in another format can be converted to the GeoJSON file format.
How to create a GeoJSON file
To convert a Geo Data set so that it meets these requirements, for example a GIS (Geographical Information System) can be used. ArcGIS Desktop is one example. An open-source alternative is QGIS.
The GeoJSON file must conform to a number of prerequisites before it can be loaded properly. Files which do not conform to these prerequisites may not be loaded properly by the Tygron Platform. The requirements are:
- The file must be saved in GeoJSON format
- The file must have a CRS (Coordinate Reference System) defined
- The file must use character encoding UTF-8.
- All desired attributes must be numerical, so that they can be loaded as valid attribute values. Attributes with text values are ignored when attempting to load them as attributes. See for steps, [page].
Also take a look at the data preparation page for considerations and tips regarding importing geo data.
- Open the Geo Dataset in a GIS
- Save the file in GeoJSON format with encoding UTF-8
The next sections show how to create a GeoJSON file in ArcGIS en QGIS.
How to create a GeoJSON file in QGIS
These steps for creating a GeoJSON file in QGIS are described in more detail below.
1. Open a Geo Dataset
First open a Geo Data file in QGIS. It's possible to load a file either by dragging it directly into the QGIS window, or by selecting it in the "Browser" panel in the QGIS window. The file will appear in the "Layers" panel, and its contents will be displayed as shapes or polygons in the main view.
2. Saving
The last step is to save the file as a GeoJSON file. This can be done by clicking on the specific layer with the right mouse button and selecting the "Save as" option. Choose the GeoJSON format, a location and file name and the UTF-8 character set. Saving will create a new ".geojson" file with all the desired data, ready to import into the Tygron Platform.
- Right-click the layer
- Select Save As...
- Set the Format to "GeoJSON"
- Use "Browse" to select a name and location for the resulting file
- Set the correct CRS (Coordinate Reference System) for the data
- Set the encoding to "UTF-8"
- Select "OK" to save the file
How to create a GeoJSON file in ArcGIS
A GeoJSON file can also be created in ArcGIS using the Data Interoperability Extension. Without this extension, it is not possible to create a GeoJSON file. Keep in mind that the JSON output data format is not the same as the GeoJSON format. Below the steps are provided for creating a GeoJSON file in ArcGIS.
- Open the dataset in ArcMap
- In the Menu bar go to the Menu Customize and choose Extensions
- Select the Data Interoperability Extension
- Choose the Quick Export tool from the Data Interoperability Toolbox
- In the Quick Export tool: choose the input layer, set as output format GeoJSON and provide a location for saving the exported dataset
How to load a GeoJSON file into the Tygron Platform
Use the Geo Data Wizard for importing the created file. Select in step 1 the first option: Import a GeoJSON file and follow the steps in the wizard.