AnsweredAssumed Answered

Finding out whether lat/long position within Polygon.

Question asked by jose-renato on Oct 15, 2019
I am working on a system that will work offline, so I exported my map data to a geodatabase.

I need to check if the GPS coordinate is within a polygon of my geodatabase and return the record table of that polygon.

Below is the code snippet that reads my geodatabase:

I am working on a system that will work offline, so I exported my map data to a geodatabase.

I need to check if the GPS coordinate is within a polygon of my geodatabase and return the record table of that polygon.

Below is the code snippet that reads my geodatabase:

private void loadGeodatabase() {    String path;    path = Environment.getExternalStorageDirectory().getPath() + "/gdbuam.geodatabase";     final Geodatabase geodatabase = new Geodatabase(path);    Log.d("GEO", path);     geodatabase.loadAsync();     geodatabase.addDoneLoadingListener( () -> {        if(geodatabase.getLoadStatus() == LoadStatus.LOADED){            GeodatabaseFeatureTable table = geodatabase.getGeodatabaseFeatureTableByServiceLayerId(0);            System.out.println("Nome da tabela: " + table.getTableName());           }else{            Toast.makeText(Screen_Pre_Certificado_Tractor.this, "Erro ao carregar!!!!", Toast.LENGTH_LONG).show();        }    });}

Outcomes