Select to view content in your preferred language

select layer by location returns empty results

10899
42
Jump to solution
01-23-2015 12:20 PM
davidzornosa
Occasional Contributor

Hi,

What i intend to do is to get all points from Table A that fall within some records of Table B.

- Table A: point geometry. Represents events that occur in certain spots

- Table B: polygon geometry. Represents geographic, non overlapping, areas

- I turn them into feature layers so they can be fed to "select layer by location".

- "Table A layer" is the input feature

- "Table B layer" contains the selecting features

I've checked visually that there indeed exist points in table A that fall within polygons present in Table B, however all i get, when i publish the service, is an empty collection in "results".

Any ideas,

thanks

0 Kudos
1 Solution

Accepted Solutions
davidzornosa
Occasional Contributor

ok, this is funny, this happened while preparing the mock data:

1 - opened arccatalog

2 - right clicked Table B, copied it on the same dataset, the copy is called Table B1

3 - did the same for Table A, got Table A1

4 - imported both Table A1 and Table B1 in arcmap

5 - ran select location and...

6 - it worked! o_o

So, what can account for this? are there some kind of background operations being made on the data when you create a copy of a table? why the originals, which should have the exact same data as the copies, do not work but their supposed mirrors do?

I don't want to take more of your time, so i'm thinking of closing the thread and giving as a solution: "just create a copy of the conflicting tables". but you know, it feels like a lack of proper closure.

thanks

Vandana RaghunathanDan PattersonTodd BlanchetteChad Kopplin

View solution in original post

0 Kudos
42 Replies
VandanaRaghunathan
Deactivated User

Hello David,

Are the points and polygons in the same coordinate system when you look at their properties in ArcCatalog?

-

Vandana

davidzornosa
Occasional Contributor

Hi, yes, both are in 4686. thanks

0 Kudos
VandanaRaghunathan
Deactivated User

What happens when you run this in arcmap? Do you get results from the Select by Location?

0 Kudos
davidzornosa
Occasional Contributor

Ok, first off, turning both layers (table A and table B) in arcmap correctly displays this (note the dark red dot):

Second, trying with select by location:

-selection method: select features from

-target layers: table A

- source layer: table B

- spatial selection: tried with intersect and within

result: no joy

thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

Addendum....  save both as shapefiles in a folder and try those

0 Kudos
DanPatterson_Retired
MVP Emeritus

I suspect Vandana is probably correct...It is quite possible that one of the two things are possible

1  the polygon layer isn't a polygon (highly unlikely)

2  they are in different coordinate systems

Never rely on ArcCatalog or two files in the same data frame to resolve this issue...the only way you will know is to create 2 separate data frames...add one...and only one file into each of those data frames.  Mouse around on screen in both data frames and look at the coordinates in the bottom right corner of the data frame...particularly for a location that you "think" overlaps.  If the coordinates differ they are not in the same coordinate system and one is either undefined, or has been defined incorrectly by using the Define Projection tool instead of the Project too.  This generally happens when one file is in degrees and the other is projected...don't pay attention to the units showing in the data frame, they are meaningless unless everything is defined correctly

0 Kudos
davidzornosa
Occasional Contributor

Hi Dan, i did the data frames experiment. Units are ok, both in decimal degrees and visually the points' coordinates match with what should be their enclosing polygons. thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

more options...

1 make sure that there are no current selections in the layer...it may be that one point feature got selected and doesn't fall within a polygon

2  Do it manually...if it works... good...clear the selection

3  Although visually nice, perhaps you have the parameters out of order or you have selected the wrong selection type...which should be a parameter in your model and it isn't.  for example, you can select polygons that are 'within' a point...it will yield none.  or if you have specified a distance which isn't in the same units as your coordinates (in this case...decimal degrees) 

4... lastly...time for a screen grab...

0 Kudos
VandanaRaghunathan
Deactivated User

Hello David and Dan,

Looks like the Select by Location did return results in ArcMap when run using the GP tool or Selection > Select by location? If this does not work, it probably will not work in the model as well.
Like Dan mentioned, you could export both the layers to a different format (file geodatabase feature class perhaps) and then try the Select by Location GP tool.

-

Vandana

0 Kudos