Hi,
I have Qyery object and I have point feature class service table.I want to query point feature class with polygon geometry but when I use feature.geometry can't query when I use feature.geometry.queryEnvelope() I can query but I want to query only that feature geometry not envelope.Here is the objects below:
Query
{
id: baseProjeQuery
}
FeatureLayer
{
id:featureProjeLayer
featureTable: geodatabaseProjeTable
selectionColor: "cyan
}
GeodatabaseFeatureServiceTable
{
id:geodatabaseProjeTable
url:"http://.............................../MapServer/0"
}
function Query()
{
baseProjeQuery.geometry=feature.geometry; //can't return result
baseProjeQuery.geometry=feature.geometry.queryEnvelope(); //return result but within envelope
baseProjeQuery.spatialRelationship=Enums.SpatialRelationshipIntersects;
geodatabaseProjeTable.queryServiceFeatures(baseProjeQuery);
}
Thanks for helping
Hi Taner,
What is the "feature" in feature.geometry referring to? Is this a feature from the feature table that you have obtained through some method of the feature table?
Thanks,
Luke
Hi Lucas,
The feature is form feature table query result polygon geometry like below row with bold font:
GeodatabaseFeatureServiceTable
{ id:geodatabaseProjeTable
url:"http://..................../MapServer/3"
onQueryServiceFeaturesStatusChanged: {
if (queryServiceFeaturesStatus===Enums.QueryFeaturesStatusCompleted) {
var counter= 0;
var iteratorProje = queryServiceFeaturesResult.iterator;
var feature = iteratorProje.next()
projeArray.push(feature.geometry);
}
}
}
Thanks
To help troubleshoot, I would suggest start by including the following console logging lines in your function to examine what is going on with your feature geometry.
console.log("feature geometry json: ", JSON.stringify(feature.geometry.json) )
console.log("is feature geometry valid? ", feature.geometry.valid)
console.log("feature geometry envelope json: ", JSON.stringify(feature.geometry.queryEnvelope() ) )
Examine the output of these and it will help isolate if there is something wrong with the feature geometry or something else going on...
Hi,
Here is the console output of geomery of first two console but last console output is crashed
qml: feature geometry json: {"rings":[[[3059694.65349892,4717934.26360585],[3059873.56951636,4718691.57706042],[3060348.85501592,4719854.46712943],[3061275.1024774,4720744.24709398],[3061755.31103653,4721459.99145372],[3061782.46929259,4721500.46820324],[3061871.31592873,4722371.85996087],[3061871.03246758,4722373.99193365],[3061823.87931639,4722728.69418005],[3061667.61023294,4723423.33508469],[3062076.49727843,4724609.90278168],[3062894.92223429,4725772.54766291],[3062962.61614523,4725860.9380874],[3063071.53676656,4726003.15781694],[3063397.99336896,4726621.99908525],[3063520.31011892,4726673.29728695],[3063643.28041342,4726724.8261693],[3063643.29388135,4726724.87356288],[3064924.30653738,4727261.77389152],[3065316.04001505,4727428.2511593],[3065717.16241333,4727542.41348988],[3066280.98845514,4727702.85312114],[3066343.096618,4727720.52414345],[3066826.79279866,4727844.42470942],[3067711.8972434,4727995.68155293],[3068620.75073905,4728377.99304055],[3068830.66380811,4728403.52173158],[3069379.23791032,4728470.21529356],[3070157.34864904,4728599.64823678],[3070502.44228096,4728657.03237793],[3071198.41848825,4728839.35208194],[3072244.3894631,4729154.30038113],[3072804.84770483,4729435.61736469],[3073624.18930421,4729901.75718519],[3073779.27174821,4729989.97671837],[3074399.82600337,4730353.0255302],[3075190.5404841,4730815.54974592],[3075190.55676454,4730815.55923434],[3075399.02885254,4729839.65443988],[3075398.70972808,4729824.96251628],[3075401.26088945,4729812.82202047],[3075395.83724968,4729692.78286258],[3075395.83695746,4729692.77910234],[3075385.7600007,4729229.06255265],[3076659.11033583,4728439.49017392],[3079348.39768803,4727142.57670946],[3079591.67286755,4727025.21336107],[3080002.29193424,4726735.25335603],[3080529.38163773,4726378.84103144],[3081046.16503742,4726235.00301296],[3081244.75993197,4726224.16521483],[3081544.94569283,4726234.75175276],[3082129.88823051,4726264.86728299],[3082513.76493719,4726322.1052741],[3082570.64332571,4726330.58482278],[3082800.63294139,4726416.35200963],[3083515.43755621,4726682.87695125],[3084095.30459119,4726899.04595509],[3085626.28449786,4727464.9026602],[3086392.45137627,4727745.26435264],[3087084.3455918,4727888.78140179],[3087874.26209177,4728047.93620829],[3088742.70912538,4728163.1922511],[3088762.124055,4728175.28770237],[3089917.41186091,4728894.93137032],[3090701.94436688,4729176.94838207],[3091121.66373599,4729327.79674811],[3091210.56531482,4729348.18260271],[3091801.85586196,4729483.74912583],[3091895.6231241,4729313.8165525],[3091948.55939445,4729217.87881459],[3093927.73644542,4729083.6104903],[3094175.07396687,4729011.28298114],[3094672.39550494,4728865.83483745],[3094897.42754582,4728800.01232566],[3095009.90835355,4728601.89898366],[3095101.42867144,4728402.76645902],[3095099.38349999,4728170.41480339],[3095096.462174,4727838.47903538],[3095112.68462256,4727826.8613361],[3095129.97474256,4727814.47899788],[3095454.09347612,4727613.28343462],[3095460.82267448,4727609.10604462],[3095475.57986215,4727599.94492006],[3095895.60844847,4727917.78032462],[3096554.6723942,4728385.62594169],[3096595.438048,4728462.29435046],[3096829.26987698,4728836.23595569],[3097536.67763143,4728581.76062543],[3097755.26681405,4728503.11639781],[3098343.90412075,4728268.98305489],[3098532.56358716,4728193.93446976],[3098601.60634647,4728261.99632709],[3098883.89251209,4728492.81784023],[3099817.8382979,4729413.35453607],[3100030.8761286,4729670.75574485],[3100240.38576994,4729923.8830096],[3100241.2822499,4730020.17408629],[3100243.5539283,4730264.1600188],[3100245.11609818,4730431.94747742],[3100359.1167392,4730797.32691584],[3100790.77474618,4730991.07473436],[3100892.23137915,4731036.6098247],[3100978.7454787,4731257.39181083],[3101126.12318137,4731633.48332246],[3101158.0895833,4731715.05608558],[3101186.35828093,4731787.19181021],[3101390.86740077,4732309.03989492],[3102078.74137091,4733485.30090514],[3102302.38331551,4733881.22823813],[3103302.75750517,4734601.14922933],[3103589.14917476,4734811.29974867],[3105231.60094342,4737086.49147073],[3105624.6785134,4737873.11051548],[3106183.88857911,4738992.05526137],[3106780.87799976,4740203.08092919],[3106975.45168374,4740597.74417247],[3107581.26305765,4741826.4133467],[3107585.6277857,4741993.52325868],[3107588.88033673,4742118.04501977],[3107590.28374397,4742171.77713624],[3107599.26170279,4742515.48905987],[3107607.42077671,4743327.0119008],[3108090.09336118,4745067.83214085],[3108353.81261465,4745954.79759474],[3108427.25835367,4746110.59257351],[3109021.76426371,4747371.56062145],[3110733.59941821,4748817.35930957],[3110765.18323981,4748844.02984898],[3111258.81103698,4749085.96490742],[3112383.59341215,4749661.08780248],[3113387.96034803,4751155.30858532],[3113939.86139653,4752133.39908615],[3114595.23386833,4753294.69568304],[3114634.37351601,4753354.76503232],[3115426.37431922,4754570.16886601],[3115432.70182076,4754563.76222368],[3116305.14097448,4753680.37081417],[3116063.10367894,4752661.78452644],[3115783.759444,4751486.05108076],[3116669.79180157,4750867.09285564],[3116994.2868905,4750640.38054062],[3118431.01862898,4749660.31972687],[3118976.86520997,4748919.79237179],[3122336.11926881,4747308.35514313],[3123142.60477494,4746921.27922288],[3123427.25672958,4746779.06225806],[3125763.86338512,4743051.36578936],[3126228.73882809,4741603.43046415],[3127010.78958943,4739167.10669593],[3128812.24239079,4738189.98064586],[3128879.83800275,4738153.30808088],[3130160.78176576,4736974.26258845],[3131429.39522483,4735806.27548578],[3132139.0190225,4735152.81182171],[3133657.4520133,4733410.56677675],[3133913.92661264,4733116.237577],[3133966.79934239,4733093.087798],[3134806.69801564,4732725.30542447],[3134847.16107253,4732721.31295476],[3135217.57203259,4732684.75490459],[3135865.91313432,4732620.73349987],[3135790.49210671,4731538.40215951],[3135775.77032367,4731327.11955516],[3135682.54435089,4730218.65458529],[3135628.30036379,4729573.61982268],[3135597.30852021,4729205.06421768],[3135488.48572183,4728198.52610097],[3135449.72228144,4727839.96138795],[3135454.56231409,4727664.54677704],[3135511.29864907,4725608.12695179],[3135689.97892068,4723962.78242188],[3135749.6865347,4723427.40737713],[3135862.84862014,4722606.41629395],[3135918.83776791,4722200.19292726],[3135797.69770871,4721786.69465679],[3135665.40944932,4720701.90150369],[3135641.84633355,4720508.66426028],[3135530.54921537,4719703.51230292],[3135264.24244441,4719190.79128696],[3134948.50946238,4718610.03778578],[3134615.25097981,4717995.13357508],[3134680.37661148,4717382.97975732],[3134756.31723052,4716886.59347923],[3135089.40759738,4715773.12707004],[3135337.49368605,4714943.73481779],[3135046.97591005,4713651.52647753],[3134895.78104975,4712978.94484771],[3134879.8942773,4712724.85187378],[3134857.76305298,4712370.87391607],[3134689.19460197,4712220.89401533],[3134513.73010583,4712124.24740305],[3134058.60829547,4712005.51780527],[3133878.65522102,4711996.69085553],[3133535.3060231,4711979.8394654],[3132995.31115434,4711905.87251158],[3132507.81291219,4711524.23929772],[3131598.03136369,4710170.47676451],[3130879.37486917,4709636.39428444],[3130266.97534192,4709592.76552368],[3129934.33491671,4709447.50671672],[3129383.32449453,4709206.86045369],[3128290.69160984,4708729.56077928],[3127520.25647964,4708255.40367184],[3126611.18958297,4707271.10758521],[3126022.61271844,4706619.00044887],[3125867.79270049,4706447.45646024],[3125613.44036532,4706183.07645061],[3125267.51087249,4705217.39413677],[3124834.29525886,4703916.78338753],[3124492.25738263,4703258.68070716],[3124134.83326021,4702871.21219048],[3123922.21216843,4702055.58851896],[3123877.28818387,4701883.24773661],[3123849.69203626,4701777.38071249],[3123913.22429155,4701538.90164512],[3124090.71449698,4701327.62201906],[3124246.13686529,4701262.22663934],[3124439.41385535,4701180.89938821],[3124616.33286205,4700922.08078918],[3124530.07163177,4700637.54669917],[3124478.45604121,4700467.2881366],[3124437.38701426,4700317.11664529],[3124369.60868327,4700069.27482735],[3124102.65936653,4699093.06947003],[3123860.27106647,4698088.45127231],[3123463.96324718,4697232.21344258],[3123425.25634221,4697148.58082374],[3123027.20823965,4695746.93672782],[3122848.18714646,4695116.47853931],[3122712.4521854,4694638.43142833],[3122770.26283019,4694263.59527587],[3122864.69430151,4693651.28708249],[3122548.91288133,4692925.81102215],[3122673.18524364,4692352.9370948],[3122713.61978902,4691475.12325927],[3122064.63192001,4691170.69419227],[3121110.5246477,4690723.12710139],[3120142.11861727,4690885.14936481],[3119690.98676356,4690897.78648208],[3119118.01659476,4690901.34485802],[3118574.29887423,4690904.69139389],[3118166.03926649,4690865.79875758],[3117532.70911263,4690587.40302564],[3116755.629176,4690155.44684844],[3115200.53398369,4689185.95818137],[3114361.70789541,4689068.71449376],[3113935.54716972,4689040.38178472],[3113494.52357175,4689466.11625584],[3112741.34336024,4688868.86656738],[3111923.23749732,4688949.83612047],[3111263.47945349,4688401.9890631],[3111242.59406802,4688384.69543081],[3110685.25443954,4688337.85834407],[3109933.10129071,4687174.78569833],[3109450.55630319,4686872.21956789],[3109450.55309141,4686872.21746084],[3109442.11223392,4686819.69871212],[3109298.81636216,4685928.08492295],[3109298.81354717,4685928.06870065],[3109298.8040952,4685928.01046695],[3109220.01031692,4685868.03571302],[3108743.66146992,4685505.48796857],[3108334.81113367,4685491.79098081],[3108160.18120864,4685537.44479919],[3107767.63791117,4685640.19928076],[3105888.89679828,4686140.77555126],[3104529.94497946,4687117.6883401],[3104529.91647825,4687117.70588936],[3103026.87515563,4688031.74112137],[3101667.85820499,4688455.71353583],[3101280.97542347,4688514.07498947],[3100076.2988827,4688513.20656675],[3099592.03084209,4688785.20582455],[3098293.50125903,4689514.40248615],[3096894.17930235,4689468.97604916],[3096530.97830685,4689397.70128994],[3095818.3733147,4689257.81955092],[3095363.26022894,4689118.87597814],[3094017.16590464,4688707.7893676],[3093367.52054338,4688253.66869249],[3093190.07587231,4688156.01658733],[3091975.6878969,4687487.60009179],[3090917.73245937,4687319.73658884],[3090262.32669085,4687560.97654222],[3089552.93356491,4688380.2544598],[3089435.19594973,4689772.38210861],[3089331.32211175,4690244.0036223],[3089074.63514734,4691409.35027362],[3089098.51230052,4694333.26186329],[3089036.41594421,4695251.45405312],[3088113.02429986,4695957.53534084],[3087680.00821753,4696288.60041099],[3087487.63575366,4696435.67055776],[3087399.25192609,4696489.26506031],[3086314.90916706,4697146.70652517],[3085788.70629906,4698224.64117293],[3085418.62180047,4699236.62702159],[3085400.72824709,4700486.6634736],[3084588.45691477,4701576.39650135],[3083389.84106754,4702100.20547017],[3080804.55832496,4702229.34095247],[3080226.74087421,4702848.18761955],[3079988.02661593,4703103.83162429],[3079497.83806057,4703832.59946743],[3078920.6269061,4704148.80764204],[3078563.40558147,4704158.76872126],[3077591.64820347,4704185.80243224],[3075393.0815968,4704406.80085976],[3073593.06262719,4704587.37855621],[3071290.28863022,4704661.50453917],[3071030.95231067,4705399.73149512],[3069470.83845621,4706956.61955356],[3067824.17297248,4708838.23337538],[3065769.72246113,4711370.9016211],[3064876.55872081,4712362.59479818],[3063589.02595629,4713791.8544596],[3061300.40655512,4716184.62965621],[3060057.02976315,4717539.41663184],[3059694.64276009,4717934.21190357],[3059694.70818328,4717934.20429069],[3059694.65349892,4717934.26360585]]],"spatialReference":{"latestWkid":3857,"wkid":102100}}
qml: is feature geometry valid? true
my bad - the third console line was missing the .json at the end.
console.log("feature geometry envelope json: ", JSON.stringify(feature.geometry.queryEnvelope().json ) )
However, it at least confirms that the feature geometry is valid. So if using the feature.geometry doesn't return anything but using the envelope of that geometry does - are you 100% sure that the feature geometry itself intersects whatever shape you are comparing it to?
If you can't verify this with the source data (e.g. just using Arcmap to examine the features), create a new geometry that is the intersection of the envelope and your target data, add this geometry to your map somehow (e.g. to a graphics layer) and examine it to see what/where it intersects.
qml: feature geometry envelope json: {"spatialReference":{"latestWkid":3857,"wkid":102100},"xmax":3135918.83776791,"xmin":3059694.64276009,"ymax":4754570.16886601,"ymin":4685491.79098081}
Are you sure you want to be calling queryServiceFeatures? This is to query the service to pull records into the feature table. If you are just wanting to do a regular query, you probably want to perform a queryFeatures or even a QueryTask.
I also try query with QueryTask but result is the same.The query can't query with feature's geometry . But query can query with feature's geometry.queryEnvelope() . feature.geometry is the correct I can zoom in an I can draw polygon graphic with it .Here is the geometry picture below .
How can I solve this problem with other way.
Thanks.