Add layers#

In NextGIS Mobile there are several ways to add geodata:

Where to get data?

Explore NextGIS Data

Create empty layer#

To create an empty vector layer, open the layer panel three lines and tap ic_add_layer.

../../_images/ngm_layer_tree_plus_en.png

Fig. 1003. Opening “Add geodata” menu#

In the menu select Create layer.

../../_images/ngm_add_geodata_new_en.png

Fig. 1004. “Add geodata” menu#

A dialog opens that allows you to set up your layer.

../../_images/ngm_new_layer_name_en.png

Fig. 1005. Creating a new vector layer#

Set up the following parameters for the vector layer:

  1. Name - required, enter a name to be displayed in the layer list.

  2. Geometry type - select what geometry the layer features are going to be (point, linestring, polygon, multipoint, multilinestring, multipolygon).

  3. Fields - a list of fields containing layer attributes.

If you only set the name and geometry type, by default the layer is created with two fields: technical field for feature identifier (fid) and a text field (description).

You can create a layer with as many fields as you need. Tap on the “+” next to the Fields label. A field creation dialog opens:

../../_images/ngm_add_field_en.png

Fig. 1006. Adding a new field#

Set up the following parameters:

  1. Field name, it will be used in the layer structure.

Note

Only use plain Latin symbols and numbers, no spaces. SQL keywords cannot be used for field names.

  1. Field type - string, integer (32 bit), integer (64 bit), real, date&time, date, time.

See also

To set up aliases for the fields you can update the layer in Web GIS. You can also create a custom form with field labels, comments and more intuitive controls for entering values.

To complete layer creation tap button_tick in the top right corner.

../../_images/ngm_fields_added_en.png

Fig. 1007. Completing layer creation#

New layer is added to the top of the layer list.

../../_images/ngm_new_layer_result_en.png

Fig. 1008. New local layer#

Now you can:

Create vector layer from a file#

The following formats are supported:

  • GeoJSON

  • custom forms in *.NGFP format (created in NextGIS Web, see how to do it )

Open the Layer tree panel three lines, tap “Add geodata” ic_add_layer and select Open local.

../../_images/ngm_add_local_en1.png

Fig. 1009. Creating layer from file#

Next a pop-up opens where you can set a custom name for the layer:

../../_images/ngm_add_local_name_en1.png

Fig. 1010. Name of the new layer#

Tap Create to start loading data. You can see the loading progress in a pop-up as well as in your device notifications.

../../_images/ngm_add_local_process_en.png

Fig. 1011. Loading data from file#

New layer is placed at the top of the layer list:

../../_images/ngm_add_local_result_en1.png

Fig. 1012. Newly created layer in the layer list#

See how you can modify the data in the section Editing layers.

Note

Requirements for GeoJSON files

  • The extension must be .geojson, or .geojson.zip - an archive that has the file in the root directory;

  • Spacial reference system - only WGS 84 (EPSG:4326) or Web Mercator (EPSG:3857).

  • If the file contains multiple geometry types,the first feature determines the geometry type and all other types are ignored.

  • Text must be in UTF-8 encoding.

Create raster layer from file (tile cache)#

The following formats are supported:

  • XYZ/TMS in a ZIP-archive;

  • MBTiles;

  • *.NGRC.

Want to buy ready-made tiles for your area of interest?

Explore NextGIS Data

You can generate tile cache with a QGIS plugin called QTiles or use an online tool Raster to NGRC.

To load a raster layer into NextGIS Mobile:

Open the Layer tree panel three lines, tap “Add geodata” ic_add_layer and select Open local.

../../_images/ngm_add_local_en1.png

Fig. 1013. Creating layer from file#

Select tile cache file from your device.

New raster layer is placed at the top of the layer list:

../../_images/ngm_add_tileszip_result_en.png

Fig. 1014. Newly created raster layer in the layer list#

Note

Requirements for tile archive

Z-level folders can be in the root of the archive or in a folder that’s in the root of the archive (name doesn’t matter, but there must be only one folder). Deeper nesting for Z-level folders is not supported.

Add geoservice#

In NextGIS Mobile you can create raster layers from external geoservices (basemaps, for example)

The easiest way to do it is to pick a service from QuickMapServices catalog.

If you don’t want to depend on the availability of external services, you can host your own key-protected basemaps with NextGIS GeoServices.

Add service from QuickMapServices catalog#

To use a tile service from QuickMapServices catalog:

Open the Layer tree panel three lines, tap “Add geodata” ic_add_layer and select Add geoservice.

../../_images/ngm_add_geoservice_en.png

Fig. 1015. Add geodata dialog#

A pop-up opens displaying all services available in the QMS catalog. Start typing in the search bar the name of the service or some key words like satellite. Pick a service or several services from the search results by putting a tick next to them, then tap Add at the bottom of the screen.

../../_images/ngm_add_gs_qms_select_en.png

Fig. 1016. Selecting geoservice from catalog#

New layer is placed at the top of the layer list:

../../_images/ngm_add_gs_qms_result_en.png

Fig. 1017. Newly added geoservice in the layer list#

Hint

Since it’s a raster layer, it covers all the layer below it. Drag the layer to a convenient place at the bottom of the layer tree.

Add custom tile service#

To use a custom tile service not included in QuickMapServices catalog:

Open the Layer tree panel three lines, tap “Add geodata” ic_add_layer and select Add geoservice.

../../_images/ngm_add_geoservice_en.png

Fig. 1018. Add geodata dialog#

Tap New.

../../_images/ngm_add_gs_new_en.png

Fig. 1019. Adding new service#

A settings pop-up appears.

../../_images/ngm_gs_new_settings_en.png

Fig. 1020. Settings for custom TMS service#

Enter at least two parameters:

  • Layer name;

  • URL.

Service URL determines the order of tile numbers (vertical, horizontal and zoom level). In the address, it’s marked by {x}, {y}, {z} in the corresponding order.

You can also add subdomains. For example, for subdomains a.tile.openstreetmap.org, b.tile.openstreetmap.org, c.tile.openstreetmap.org the URL is {a,b,c}.tile.openstreetmap.org.

You can also set:

  • schema (how the tiles are cut): XYZ (OSM) or TMS (OSGeo);

  • cache size: no cache, 1 screen, 2 or 3 screens;

  • credentials (login and password) if thery are required to access the tiles.

Note

Only Basic access authentication is supported.

When all is set, tap Create. The new layer is placed at the top of the layer list.

Cache tile service data#

You can work with data from external geoservices even without Internet connection. To make it possible, download tiles for your area of interest.

Make sure that the raster layer is added to the Layer tree and visible.

Open the map at the extend of the area you want to download tiles for.

Open the layer menu and select Download tiles.

../../_images/select_download_tiles_en.png

Fig. 1021. Raster service menu#

In the pop-up window select the necessary zoom range. Tap Start.

../../_images/cache_zoom_levels_en.png

Fig. 1022. Selecting zoom range to download tiles#

../../_images/cache_progress_en.png

Fig. 1023. Download in progress#

Warning

If the total number of tiles of the selected range is over 6000, only the first 6000 tiles are downloaded. The rest won’t be downloaded to avoid memory overload.

Cache layer is added to the top of the layer list and marked by a downward arrow.

../../_images/cache_result_en.png

Fig. 1024. Cached tiles in the layer tree#

Now even when there’s no connection the tiles for the are will be displayed in the app.