Select to view content in your preferred language

arc-jsapi How can I st_geometry using a lookup field?

2053
2
06-13-2016 01:38 AM
ParkSeungHyun
New Contributor II

I am using the st_geometry field and try to view the PNU code value.

I tried two ways.

1. oracle DB query.

    select a.pnu from LP_PA_CBND_4600000000 a  

    where sde.st_contains(a.shape,

    sde.st_point(177566.6728471977,160430.12935426735, 4))=1

When an event occurs, click the map object

i got the  evt.mapPoint(x,y).

4 is my srid.

this way is took a long time. and query was down...

2. i used the arcgis api`s IdentifyParameters

my code is follows.

 

      PoiClick : function(map, evt) {

        G_evt =evt;

        console.log("ClickPoint ==== "+evt.mapPoint);

        var targetLayerId = 'LP_PA_CBND';

        var url = map.Layers.getLayerInfo(targetLayerId).SVC_URL;

        var map = map.getMap();

        //파라미터 설정.

        var idParams = new krcgis.core.tasks.IdentifyParameters();

        G_idparams =idParams;

        idParams.geometry = evt.mapPoint;

        idParams.mapExtent = map.extent;

        idParams.returnGeometry = true;

        idParams.tolerance = 3;

        idParams.layerOption = krcgis.core.tasks.IdentifyParameters.LAYER_OPTION_ALL;

        idParams.width = map.width;

        idParams.height = map.height;

      

           krcgis.Function.GetPoiInfo(url, idParams);

           return evt.mapPoint;

        },

      

        //POI 정보를 가져온다.

        GetPoiInfo : function(url, idParams) {

         idTask = new krcgis.core.tasks.IdentyfyTask(url);

       

        idTask

        .execute(idParams)

        .addCallback(function (response) {

               G_response = response;

        if (response) {

        return response;

        }

      

        })

        .addErrback(function (error) {

        console.log('GetPoiInfo result error=', error);

        });

        }

It could be obtained in this way code pnu.

However, this way is different from the value that gets pnu code depending on the zoom level.

I want to get a single pnu code in a single x, y values.

how to get pnu code? 

Database table  :

1111.png222.png

Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Park,

  You should use the QueryTask for this:

QueryTask | API Reference | ArcGIS API for JavaScript

Query data without a map | ArcGIS API for JavaScript

Select with Feature Layer | ArcGIS API for JavaScript

The Query Class allows you to specify a query geometry and a spatial relationship, along with which fields you want returned.

ParkSeungHyun
New Contributor II

Thanks~! your answer

0 Kudos