More

Clicking on points in ArcGIS Android


This seems like it should be very easy to do, but I am unable to click on a point and have the map recognize that I have clicked on the point. I first tried just creating a simple point, setting the query out fields to "*" and the spatial relationship to "INTERSECT". That didn't work so now I've been trying to create a polygon around where I click and setting the spatial relationship to both "WITHIN" and "CONTAINS" (two separate tries), I've also tried using an envelope instead of a polygon to no avail.

I have tried using this example directly and it works with the given map because the features are polygons, however when I change the URL's to my feature server (which is all points) it no longer does anything when I click, the length of the results array is zero.

Here is the code for my current attempt using an envelope (I left my comments in where I tried making a polygon as well) inside my OnSingleTapListener:

clicked = mMapView.toMapPoint(v1, v2); int dimens = mMapView.getExtent().getDimension(); double pixW = dimens / mMapView.getWidth(); double tolerance = 10 * pixW; Envelope env = new Envelope(clicked, tolerance, tolerance); Query query = new Query(); query.setGeometry(env); query.setOutFields(new String[] {"*"}); //Polygon poly = new Polygon(); //double x = clicked.getX(); //double y = clicked.getY(); //poly.startPath(x-2.0, y+2.0); //poly.lineTo(x+2.0, y+2.0); //poly.lineTo(x+2.0, y-2.0); //poly.lineTo(x-2.0, y-2.0); //poly.lineTo(x-2.0, y+2.0); query.setSpatialRelationship(SpatialRelationship.WITHIN); query.setInSpatialReference(mMapView.getSpatialReference()); featLayers[0].selectFeatures(query, ArcGISFeatureLayer.SELECTION_METHOD.NEW,

Does anyone have any idea why this would not work when the exact same method works for other features that aren't points? The example also has me using an ArcGISDynamicMapServerLayer, is this necessary? I have tried it both with and without this layer although I prefer it without because the layer loads slowly and makes the map look worse.


Just in case anyone has this same problem in the future I solved this issue as below:

clicked = mMapView.toMapPoint(v1, v2); Query query = new Query(); query.setOutFields(new String[] {"*"}); query.setSpatialRelationship(SpatialRelationship.INTERSECTS); Point refClicked = mMapView.toMapPoint(v1 + 35, v2); double len = refClicked.getX() - clicked.getX(); Geometry geom = (GeometryEngine.buffer(clicked, mMapView.getSpatialReference(), len, null)); query.setGeometry(geom); query.setInSpatialReference(mMapView.getSpatialReference()); arcGisFeatureLayer.selectFeatures(query, ArcGISFeatureLayer.SELECTION_METHOD.NEW, new CallbackListener() {

This is essentially what I was trying to do before, except I was creating the buffer area incorrectly. The x + 35 can be changed accordingly to how large you want your buffer to be.


A rich 2D & 3D mapping API for Java and Kotlin developers. Allows you to build apps that:

  • Use the geocoding service to convert addresses to and from geographic coordinates
  • Serve up directions, optimal routes between multiple destinations, and drive time calculations around a point of interest.
  • Find demographic and contextual data about an area such as average income, household size and population density.
  • Use a rich collection of ready-to-use basemaps, demographic maps and imagery in your app.
  • Perform analysis to discover trends and pattern detections in your data
  • Use your data offline to view maps, search, find routes, and they sync edits when reconnected.

By joining our no-cost Developer Program you get:

  • Complete access to ArcGIS developer tools and libraries.
  • An API reference and developer&rsquos guide to help you learn the API.
  • Self-guided tutorials, Example Apps and DevLabs.
  • Samples on our github repo .
  • Access to our community to get help with your questions

Add a point, line, and polygon

Learn how to display point, line, and polygon graphics in a map .

In this tutorial, you display points, lines, and polygons on a map as graphics .

To learn how to display data from data sources , see the Add a feature layer tutorial.

For more background information about the topics in this tutorial, visit Maps (2D), Graphics, and Data hosting services in the Mapping APIs and location services guide.

The following are required for this tutorial:

  1. An ArcGIS account to access API keys . If you don't have an account, sign up for free.
  2. Confirm that your system meets the system requirements.
  3. An IDE for Android development in Kotlin.

This tutorial uses Android Studio, but the code described will work in any Android IDE that supports Kotlin.

Open an Android Studio project

To start this tutorial, complete the Display a map tutorial, or download and unzip the solution in a new folder.

Modify the old project for use in this new tutorial. Expand More info for instructions.

On your file system, delete the .idea folder, if present, at the top level of your project.

In the Android tool window, open app > res > values > strings.xml.

In the <string name="app_name"> element, change the text content to Add a point, line, and polygon.

In the Android tool window, open Gradle Scripts > settings.gradle.

Change the value of rootProject.name to "Add a point, line, and polygon".

Click File > Sync Project with Gradle files. Android Studio will recognize your changes and create a new .idea folder.

If you downloaded the solution project, set your API key .

In Android Studio: in the Android tool window, open app > java > com.example.app > MainActivity.

In the setupMap function, set the apiKey property on the ArcGISRuntimeEnvironment with your API key .

Highlight the existing imports and replace with the imports needed for this tutorial.

In Android Studio, in the Android tool window, open app > java > com.example.app > MainActivity.

Create a new function named addGraphics .

Create a GraphicsOverlay to display point, line, and polygon graphics and add it to the mapView 's collection of graphics overlays.

Call the addGraphics() function from the onCreate lifecycle function.

Create a Point and a SimpleMarkerSymbol . To create the Point , provide longitude (x) and latitude (y) coordinates and a SpatialReference . Use the SpatialReferences.getWgs84() convenience function.

Point graphics support a number of symbol types such as SimpleMarkerSymbol , PictureMarkerSymbol , and TextSymbol . Learn more about symbols in the API documentation.

Next create a solid, blue, 2px-wide SimpleLineSymbol and assign it to the outline property of simpleMarkerSymbol .

Create a Graphic with the point and simpleMarkerSymbol . Display the Graphic by adding it to the graphicsOverlay 's graphics collection.

Click Run > Run > app to run the app.

An emulator should display, running your app.

If your app builds but no emulator displays, you need to add an emulator. Click Tools > AVD Manager > Create Virtual Device.

You should see a point graphic in Point Dume State Beach.

Polylines have one or more distinct parts. Each part is a sequence of points. For a continuous line, you can use the Polyline constructor to create a polyline with just one part. To create a polyline with more than one part, use a PolylineBuilder .

Create a Polyline and a SimpleLineSymbol . To create the Polyline , first create a PointCollection and add individual Point s. Then pass the PointCollection to the Polyline constructor.

Line graphics support a number of symbol types such as SimpleMarkerSymbol and TextSymbol . Learn more about symbols in the API documentation.

Create a Graphic with the polyline and polylineSymbol . Display the Graphic by adding it to the graphicsOverlay 's graphics collection. Next, add a blue outline.

Click Run > Run > app to run the app.

An emulator should display, running your app.

If your app builds but no emulator displays, you need to add an emulator. Click Tools > AVD Manager > Create Virtual Device.

You should see a point and line graphic along Westward Beach.

Polygons have one or more distinct parts. Each part is a sequence of points describing a closed boundary. For a single area with no holes, you can use the Polygon constructor to create a polygon with just one part. To create a polygon with more than one part, use a PolygonBuilder .

Create a Polygon and a SimpleFillSymbol . To create the Polygon , first create a PointCollection and add individual Point s. Then pass the PointCollection to the Polygon constructor.

Polygon graphics support a number of symbol types such as SimpleFillSymbol , PictureFillSymbol , SimpleMarkerSymbol , and TextSymbol . Learn more about symbols in the API documentation.

Next, create a SimpleFillSymbol that has a solid, 20%-transparent orange fill, and the blueOutlineSymbol defined earlier.


How to display a map using shape files in Android?

Here is the steps and sample screens regarding shape file read and display using Openmap.jar in Android.

1) Download the sample shape file zip (I have used India shape file)

2) Extract the zip file and pick one file which ends with .shp

3) Add that .shp file in device storage and get that file location

4) Assign that file location to OpenMap library's "ShapeFile" class (First level)

5) The "ShapeFile" class convert this data and store as "ESRIRecord" class (Second level)

6) And finally using "ESRIRecord" we get PolygonOptions x and y points which assigns to display shape on Google Map (Third level)

Regarding steps : #1,#2 and #3 steps will change with different types of file reading. For example : From our app we can download the desire zip file from server and unzip and store that files in device location (or) We can store that desire zip file in project level then unzip and store that files in device location etc.


Point clustering - basic configuration

This sample demonstrates how to enable point clustering on a GeoJSONLayer. Clustering is a method of reducing points in a FeatureLayer, CSVLayer, GeoJSONLayer, or OGCFeatureLayer by grouping them into clusters based on their spatial proximity to one another. Typically, clusters are proportionally sized based on the number of features within each cluster.

Clustering is configured in the featureReduction property of the layer. You can enable clustering with a default configuration with minimal code by setting the type to cluster .

The feature reduction property gives you control over many other cluster properties. The clusterRadius defines area of influence that determines each cluster's region for including features. You may also define popupTemplates and labels for clusters that summarize the features comprised by the cluster.

Suggestions for basic configuration

  • Turn off label deconfliction when labeling clusters with a count in the center of the cluster. If label placement is outside the cluster, keep label deconfliction enabled.
  • Increase the clusterMinSize to fit labels inside smaller clusters (16pt is a good starting point).
  • For larger layers, format the cluster count in the label with either a rounded value or a meaningful abbreviated value (e.g. 10k instead of 10000 ). See the Point clustering - generate suggested configuration for an example of this.

Point clustering only applies to layers with point geometries in a MapView containing either a SimpleRenderer, UniqueValueRenderer, or a ClassBreaksRenderer. It does not apply to layers with polyline and polygon geometries.

Clustering layers with spatial references other than Web Mercator and WGS-84 is experimental and may not work for every projection. Clustered layers that have spatial references other than Web Mercator or WGS-84 have the same limitations listed in the projection engine documentation.


Let’s get prepared for the geographic analysis by performing the following steps:

    In ArcMap, open the C:GeospatialTrainingSpatialStatsDenverCrime.mxd file. You should see a point feature class called Crime, as shown in the following screenshot:

The WGS84 Web Mercator coordinate system that is so popular today for online mapping applications is not suitable for use with the Spatial Statistics tools. These tools require accurate distance measurements that aren’t possible with WGS84 Web Mercator, so it’s important to project your datasets to a coordinate system that supports accurate distance measurements.


Like any other System, Geographic Information Systems is also an integration of various components. Software, Hardware, People, Method and Data, are the 5 components. These 5 crucial components are brought together to build a robust and powerful system. Every System integration requires a powerful and synchronous amalgamation between all the primary and crucial components. Software and Hardware are important to handle many geospatial data, databases, visualizations and even complex process inputs or outputs. The rest of the things are completed by People, Method and Data. In a nutshell, GIS Components are the crucial factors for forming or building a system that can handle all kinds of GIS-related tasks.

Components of GIS

Hadoop, Data Science, Statistics & others

Source Links of 5 images used in the infographic

1. Software

  • Software is the primary focus while setting up any of the systems. Many GIS software is available are readily available to start the work, but only the right ones suffice to tackle business problems. The software can be classified into two main types, Licensed and Freeware.
  • Licensed software requires heavy investments and have business subscriptions attached to it, while Freeware is easily available on the internet marketplace with minimum or no fees.
  • Good software that handles a large amount of geospatial data, GUI for manipulating data and querying the environment for analyzing and visualizing large data sets is a perfect fit for GIS.

Screenshots of Software:

Source links used for 3 images

2. Hardware

  • Hardware is the second most important part of any GIS Components. Software and Hardware complement each other when they are deployed correctly, looking at the compatibility. If there is any mismatch in any of the two components, then the functionality effects and results are not approximate.
  • Some organizations have moved over to cloud services like AWS and Azure to create a virtual environment and balance physical servers load. It requires huge server stations and command centres to handle a large amount of geospatial data and even to keep everything ongoing in a live environment.
  • Hardware should be robust and should have the future potential to deal with heavy software patches and updates. Latest high chip and AI-based processors, Motherboards and even GPUs are needed in today’s world to handle GIS software and data.

3. Data

  • Geospatial data is like the blood of any GIS Components. Field workers, Drones, Satellites and SONAR – LIDAR Technology are used to collect geospatial data. This data format varies from tool to tool and depends upon the source from where the data is extracted. Primarily the geospatial data is classified into Raster data and Vector data. Raster Data is the imagery files from different camera-enabled sources. They form like a sheet covering different layers that portray longitudinal, latitudinal, and even topographical maps.
  • On the other hand, Vector Data deals with address points, Graphs and Datascience and Machine Learning models are further used to analyze and work on the data sets. With the analysis of past data, organizations can perform analytics and showcase various future trends.
  • Geospatial RDBMS is used to handle these data sets. Analysts and Database administrators work together to handle the databases and even sanitizing the irrelevant parts of imported data.

4. People

  • People are an important catalyst in doing a GIS Components setup. With the help of proper management and technical expertise, all the known-unknown problem areas can be addressed. Project-Program Management is then used to understand any scope of a GIS project.
  • People with the right level of geology, information systems, and statistics knowledge participate in the project setup’s technical aspects. In contrast, the ones with strong management and business knowledge concentrate on handling the projects and the business. GIS projects require a strong workforce and inventory management, and hence people also concentrate more on the overall project development lifecycle techniques.
  • GIS Analysts and Technicians play along with the GIS data to analyze and monitor various forms of data sets. GIS developers and database administrators look after the frontend and the backend part of the setup. Project Managers and Architects deal with architecture and project planning by keeping the actionable scope in the picture.
  • Organizations are also taking ML/AI engineers’ help to build strong models for solving business issues. Data scientists with strong analytical and programming skills are also targeted by GIS organization to work on complex geospatial data sets and trends.

5. Method and Processes

  • There should be a defined business process for any system to function to approximate the desired results efficiently. Organizations nowadays use various standardized process models to build a system that is still in a transition phase.
  • Total Quality Management, LEAN, SIX SIGMA and KAIZEN are some of the standardized models followed by organizations to ensure the business process doesn’t become an unsolved puzzle. Audits are performed internally and externally to understand if the setting process is being followed accurately without any anomalies.
  • ISO Audits and certifications give an organization a certain benchmark to portray its work to a wider audience. Due to these certifications and audit trails, organizations trust the authenticity and integrity of the system that is used. Methods are not only used until the process is set up perfectly but also to maintain it. Some organizations keep on evolving ambitiously by deploying new processes.
  • Process reengineering is followed in understanding the AS-IS part of the business process and to define the TO-BE part of the process. This allows organizations and LEAN experts to remove nonproductive parts of the process so that further time and cost of the company can be saved.

Conclusion

Above mentioned 5 components are the crucial ingredients to set up a GIS. As the organization grows, the components acting as pillars for GIS also grows. Giants like Google, ESRI and HERE will have their set of crucial components. More importantly, the setup of GIS is not easily done in overnight, even if any organization is privileged with all the crucial components, even if the absence of one of the above components can lead to failure in setting up the right system.

Recommended Article

This is a guide to GIS Components. Here we discuss the introduction to GIS Components and the top 5 Components of the Geographic Information System in detail. You can also go through our other related articles to learn more –


Choose a receiver

AppStudio can use the GPS that's built into your device, or you can add an external GPS receiver to obtain high-accuracy data. There are many GPS receivers available however, not all of them work directly with AppStudio . To use a GPS receiver with AppStudio , the receiver must support the output of NMEA sentences.

To improve the accuracy of your positions, consider using a GPS receiver that supports differential corrections. If you are using an iOS device, you must also use one of the GPS receivers supported on iOS. While Esri doesn't publish a list of supported GPS receivers for Android or Windows, a list of receivers used in testing on Android and Windows is provided.

Most high-accuracy GPS receivers support the NMEA sentences that AppStudio uses however, it's recommended that you check whether your receiver supports these NMEA sentences in the receiver's user manual before you try to connect it to AppStudio .

NMEA support

NMEA 0183 is the data specification standard that AppStudio uses to communicate with GPS receivers. NMEA messages contain lines of data called sentences. AppStudio derives GPS information such as latitude, longitude, height, and fix type by reading specific sentences in NMEA messages.

AppStudio supports NMEA 4.00 and 4.10. It can read the following NMEA sentences:

  • GGA: Time, position, and fix-related data
  • GSA: GNSS DOP and active satellites
  • GSV: GNSS satellites in view
  • RMC: Recommended minimum specific GNSS data
  • VTG: Course over ground and ground speed
  • GST: GNSS pseudorange error statistics

If AppStudio receives GST sentences that contain accuracy information for a particular coordinate, it uses them to determine accuracy. By default, the horizontal and vertical accuracy numbers are specified in root mean square (RMS). The level of confidence using RMS is 63 percent to 68 percent for horizontal accuracy, and 68 percent for vertical accuracy.

Estimated accuracy

If AppStudio doesn't receive a GST sentence from a GPS receiver but does receive a GSA sentence, AppStudio estimates accuracy using horizontal dilution of precision (HDOP) and vertical dilution of precision (VDOP). The estimated horizontal accuracy is calculated by multiplying HDOP by 4.7, and the estimated vertical accuracy is calculated by multiplying VDOP by 4.7.

Differential corrections

To improve the accuracy of your positions, consider using a GPS receiver that supports differential corrections. Differential correction technology further improves accuracy by using reference stations, which are also known as base stations. A reference station is another GPS receiver that is established on a known location. The reference station estimates its location based on satellite signals and compares this estimated position to the known position. The difference between these positions is applied to the estimated GPS position calculated by your GPS receiver, also called the rover, to get a more accurate position. Your receiver must be located within a certain distance of the reference station for differential corrections to occur. Differential corrections can be applied in real time in the field or when postprocessing data in the office.

Differential corrections can be provided by public or commercial sources. One of the most widely used and publicly accessible real-time correction sources is the Satellite-based Augmentation System (SBAS), which is also commonly referred to as the Wide Area Augmentation System (WAAS) in the United States. It is free to use SBAS, but your GPS receiver must support it. Using commercial correction services typically requires a subscription and may also require purchasing a particular type of GPS receiver that can receive these correction signals. See the Differential GPS Explained article in ArcUser magazine for more information.

GPS receivers supported on iOS

To directly connect a Bluetooth receiver with an iOS device, the receiver must be part of the MFi program as well as support the output of NMEA sentences. The following receivers can be used directly with AppStudio Player on supported iOS devices.

To determine the version of firmware your GPS receiver uses, pair your receiver with your device, open your device's General > About settings, and tap the name of your paired receiver.

GNSS Surveyor and GPS Pro+ require firmware version 2.1.40 or later. GPS Pro requires firmware version 2.0.90 or later. GPS for Lightning Connector requires firmware version 1.0.24 or later.

GLO requires firmware version 3.00 or later and GLO 2 requires firmware version 2.1 or later.

GPS receivers tested on Android and Windows

AppStudio works with any receiver supported on Android or Windows that outputs NMEA 0183 sentences. While Esri doesn't certify any device, the following is a list of devices that have been used:

Caution:

This is not a comprehensive list of all devices that work with AppStudio .

  • Bad Elf GNSS Surveyor, GPS Pro, and GPS Pro+
  • Eos Arrow Lite, Arrow 100, Arrow 200, and Arrow Gold
  • Garmin GLO ¹, Garmin GLO 2¹
  • Geneq SxBlue II and SxBlue III²
  • Juniper Systems Geode
  • Leica GG03¹, GG04, and Zeno 20¹
  • Trimble R1, R2, R8s¹, and R10¹

The Trimble GNSS Status app (Windows or Android) is required to receive corrected positions with R1 or R2. On Android, you also need the Trimble GNSS Direct app.

For the Trimble R1 receiver on Windows, AppStudio can't access differential GPS fixes with RTX. However, AppStudio can identify the location with autonomous GPS fixes, as well as SBAS corrected and local base station corrected locations via NTRIP.

For the Trimble R2 receiver on Windows, AppStudio can't access locations with RTX or local base station corrected locations via NTRIP. AppStudio can only access autonomous GPS fixes and SBAS corrected locations.

Issues have occurred when pairing the Trimble R10 with Samsung Galaxy S5 and S7 devices.


Why the intersection of Artificial Intelligence and Geographic Information Systems is creating new opportunities

Artificial intelligence has made rapid progress, especially in areas such as computer vision, natural language processing, and machine translation. The intersection of Artificial Intelligence (AI) and geographic information systems (GIS) is creating massive, new opportunities. AI, Machine Learning and Deep Learning are helping us make a better world.

Machine learning is a core component of spatial analysis in GIS. These tools and algorithms have been applied to geoprocessing tools to solve a variety of problems. Prediction algorithms such as geographically weighted regression allow you to use geography to calibrate the factors for predictions. These methods need experts to identify or feed in those factors (or features) that affect the outcome that we are trying to predict.

The rise of Deep Learning
In Deep Learning, machines figure out what those factors/features are, just by looking at the data. In a deep neural network, there are neurons that respond to stimulus and they are connected to each other in layers. One aspect of AI where Deep Learning has done exceedingly well is computer vision. The simplest of the many possible computer vision tasks is Image Classification, in which the computer assigns a label, such as ‘cat’ or ‘dog’ to an image. This can be used in GIS to categorise geotagged photos. Then, there’s Object Detection, in which the computer finds objects and their location within an image.

Another important task in computer vision is Semantic Segmentation, wherein we classify each pixel of an image as belonging to a particular class.

In GIS, Semantic Segmentation can be used for land cover classification or to extract road networks from satellite imagery. Instance Segmentation is yet another type of segmentation wherein the detailed boundary of each object instance is marked out.

ArcGIS—a proprietary software from Esri—has tools to help with every step of the data science workflow, while the Living Atlas provides access to a large collection of Esri-curated and partner-provided imagery that can be critical to a deep learning workflow. ArcGIS Pro includes tools for helping with data preparation for deep learning workflows, and it is being enhanced for deploying trained models for feature extraction or classification.

The road ahead
Some of the innovative uses of Deep Learning are for enhancing imagery such as increasing zoom levels through ‘Superresolution networks’. This technique can be used to increase clarity of satellite images and even go beyond the resolution of the sensors used. Another innovative use of Deep Learning is in the field of ‘Creative AI’. Neural style transfer techniques can be used for generating ‘map art’ and can find practical use in GIS through cartographic style transfer. Generative Adversarial Networks (GANs) is an active area of research and can be used for generating map tiles straight out of imagery.

Deep Learning can also be used for processing large volumes of structured data such as observations from sensors or attributes from a feature layer. Applications of such techniques to structured data include predicting the probability of accidents, sales forecasting, natural language routing and geocoding.

Rohit Singh (The writer is development lead – ArcGIS API for Python, Esri Inc.)


GIS glossary

The GIS terms under the entries GIS glossary: a-g and GIS glossary: h-t are condensed and reproduced with permission from "A Practitioner's Guide to GIS Terminology" by Stearns J. Wood. Compiled over 30 years and first published in 1984, the book contains more than 10,000 terms embracing all aspects of geoprocessing and geoanalysis, spatial and network analysis, resource management, facilities management, automated mapping, computer-aided design and drafting, database management systems, open systems connectivity and geographic information system computer technology. Selected terms from geography, cartography, computer science, urban and regional information systems, remote sensing and GPS are also included. See GIS glossary: a-g and GIS glossary: h-t.