Saturday, August 28 2021

The ArcGIS API for JavaScript is flexible and interoperable. It allows you to build web applications with striking visualizations and interactive workflows using data in non-ArcGIS formats as well as ArcGIS layer types.

You can load GeoJSON and comma separated values ​​(CSV) files, as well as Open Geospatial Consortium, Inc. (OGC) services, and use third-party basemaps with a few lines of code and style them as you would for any type of ArcGIS layer. Once you have the layer in your app, the world is your oyster. You can create a great user experience by using client side queries, statistical calculations, filtering, and geometric operations. Because non-ArcGIS layer types are fully integrated with the ArcGIS API for JavaScript, you can build your user interface (UI) using API widgets that work with these layers.

Consume GeoJSON

GeoJSON was developed in 2008 through community discussion and consensus to include spatial data in the brand new JavaScript Object Notation (JSON) format. GeoJSON provided an easy way for web developers to extend existing APIs. It has been widely adopted in a variety of services, such as GitHub and Twitter, and used in visualization tools such as Data-Driven Documents (D3). Due to its popularity and interoperability, developers continue to build applications that incorporate features represented by GeoJSON.

Since the initial release of the ArcGIS API for JavaScript, developers could build web mapping applications that directly consumed GeoJSON, but they had to do a bit of homework. Consuming GeoJSON required creating a custom layer in the map and manually loading, parsing, and styling the features. GeoJSON uses the World Geodetic System 1984 (WGS84), a geographic coordinate reference system, so the map was limited to WGS84 or Web Mercator spatial references. Using another coordinate reference system would mean extra effort.

The ArcGIS API for JavaScript has evolved. It now provides a GeoJSON layer to fully support GeoJSON data sources. The GeoJSON layer allows you to easily extract the GeoJSON data by referencing the URL and adding the layer to the map (Fig. 1).

Attribute data can determine the size and color of map symbols.

All loading and analysis is handled by the API. Since the API has a client-side projection engine, it will automatically project the data into the map coordinate system as needed. Although GeoJSON data is limited to WGS84, your map or basemap is not. It can be in any projection.

The fun doesn’t stop there. You can add pop-ups, labels, and styling functions using the same techniques you use to visualize data in other types of layers. You control how each attribute of GeoJSON data determines the color, size, opacity, and rotation of features. All smart mapping capabilities are available with GeoJSON layers.

Data in 2D, 3D or both

The ArcGIS API for JavaScript is multidimensional. You can choose to view the data in 2D or 3D or give your users the ability to interact with the data in 2D and 3D. Changing the code from a MapView to a SceneView will display the data in 3D. You can leave its appearance as is or style the layer with 3D symbols so that it looks good on a 3D globe. 3D makes it easier for non-technical stakeholders who may not understand maps to understand the context and analysis. With the ability to use elevation and high resolution models, 3D can even be more accurate than 2D representations of the real world.

For example, the recent earthquakes stream from the US Geological Survey includes elevation information that provides the distance below the earth’s surface. You can use the elevation information to define the depth of each feature and interact with the underground data in a 3D scene. Go further and use the magnitude of the earthquake to determine the size and color of the items. By looking at this visualization, you can really get a feel for the movement that is going on beneath the surface, even if you haven’t felt the tremor.

Once your layer is configured, you decide which map interaction you want to enable in your application. The GeoJSON layer loads all the data at once on the client. You can create a very interactive experience using client-side API queries, statistics, filtering, and geometric analysis.

Explore the ArcGIS API samples for JavaScript at developer.arcgis.com to see how you can work with GeoJSON, CSV, OGC, and tiled layers.

What about ArcGIS Online and ArcGIS Enterprise?

Many organizations want to make their data available in GeoJSON format (often along with other formats) so that any customer that supports GeoJSON can use that data as well as create and style layers in web maps from third-party GeoJSON sources. ArcGIS Online and ArcGIS Enterprise support GeoJSON as a format that you can use to upload to create new services hosted in web maps, upload existing content, or get query results.

Bring CSV data to life

CSV is a plain text file format used to represent tabular data, including geographic point features (that is, latitude and longitude). Due to its simple structure, CSV is easy to generate, import, and export from programs that store data in tables such as Microsoft Excel. However, if you want to understand spatial patterns in data, it’s almost impossible in a tabular format. If a CSV file contains location data (location information, addresses, or x, y coordinates), you can map it. You can do everything with CSV only with GeoJSON.

There are several ways to import CSV data into your application. You can use the API CSV layer to load the CSV by specifying the URL where the file is stored (Fig. 2).

Note that the CSV layer expects the latitude and longitude coordinates. If the basemap and the CSV data have different spatial references, the CSV data will be automatically reprojected on the client side, as with GeoJSON.

Another way to import CSV data is to use a web layer or map that you create in ArcGIS Online or ArcGIS Enterprise. An easy way to do this is to upload the CSV file and create a hosted feature layer (Fig. 3).

If the CSV data has addresses or place names, it will be geocoded. Once the data is in your map, you can use smart mapping tools to style the layer, add pop-ups, and do other things. The saved web layer or map can be loaded into your app as usual and the API will apply whatever has been configured.

OGC Services

The use of OGC services and encodings enables open access to geographic data and software functionality, enabling organizations to integrate GIS data and services into any application on a variety of computing and mobile devices. These open services and encodings improve the sharing and interoperability of geospatial information. With ArcGIS, you can publish your data as OGC endpoints as well as ArcGIS service types. For example, you can publish an ArcGIS Online or ArcGIS Enterprise Web Feature Service (WFS) hosted from a hosted feature layer and Web Map Tile Service (WMTS) from a tiled layer.

A smart practice is to enable both ArcGIS and OGC service types so that client applications built with ArcGIS service types can enjoy performance and capacity benefits, while non-ArcGIS customers can still benefit from the benefits. ” interface with the OGC service types.

OGC layers (from any source) can be imported into your web application by adding them to a web map in ArcGIS Online or ArcGIS Enterprise. Load these layers with a few lines of code or by manually creating layers in your application that directly reference the services. The ArcGIS API for JavaScript supports Web Map Service (WMS), WMTS, WFS (available in version 3.x and coming soon in version 4.x) and KML. OGC layers are well integrated into the API. For example, the design of the WMS layer was modeled on the map image layer based on ArcGIS dynamic services. You can work with WMS sublayers in a very similar way to how you work with map image layer sublayers. These types of layers, in addition to sublayers, will be displayed in the legend and layer list widgets. If you want to change the visibility of a WMS sublayer, check or uncheck the layer in the list of layers.

Use any tiled layer from anywhere

You can use a basemap from the various vector and raster basemaps available with ArcGIS Online or from a basemap that you published. You can also use a non-ArcGIS basemap, whether it is a raster or vector basemap.

To use a third-party raster basemap, the API’s web tile layer provides an easy way to add non-ArcGIS map tiles as a layer to a map. The basemap should have a URL pattern that typically follows this pattern: http://some.domain.com/ Danemarkleveldale/ CobraColibrucker/Developer, where level is a zoom level, and col and row represent the column and row tile. This model is not mandatory but is the most commonly used on the web.

To use a vector basemap, you can load it into the API, regardless of its origin. The vector tile layer consumes vector tiles and is stylized using a common style specification. Explore the ArcGIS API samples for JavaScript at developer.arcgis.com to see how you can work with GeoJSON, CSV, OGC, and tiled layer types. If you open a sample in the sandbox, you can replace one of the services with the one you want to use, refresh the map, and see it displayed.

To learn on Esri’s vision of an open, flexible and interoperable platform that supports innovation.

This article originally appeared in ArcUser magazine


Source link

Previous

How Progressive Web Apps Will Change Online Business

Next

Objectives of Amazon Web Services (AWS) in the ASEAN Region

Check Also