Selecting by polygon

2008
11
08-25-2010 08:04 AM
RichardKrell
New Contributor
I am tearing my hair out over something that I am sure is a simple thing but I have been looking at for so long I am not seeing the obvious so any help would be greatly appriciated.
I started by looking at the code provided at http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=15872

Then I took pieces of it to create my own using my services.  I have attached the mxml file named testshape.txt.  I am also including a output of what happens after I draw the polygon and it is called output.txt.

It appears it is finding the records in the polygon and then I think it is creating the graphics element but that is where it is blowing up.  Please take a look and advise please.
0 Kudos
11 Replies
by Anonymous User
Not applicable
Original User: cgishack

After looking at the service it looks like you don't have a geometry column ( esriFieldTypeGeometry) in this feature class.
No geometry is being returned from the map service because there is no geometry field in the data.
I see you have  Point_X and Poiny_Y fields, but these are not seen as geometry by the server.
http://data.cmap.illinois.gov/ArcGIS/rest/services/Maps/TIP_Test/MapServer/0

Is this some event layer or something similar in your MXD  or do you have the Shape field turned off on the MXD ?

Drew
0 Kudos
RichardKrell
New Contributor
I had just noticed that a little while ago but am not yet able to define the geometry type in the service.  still reading.  Can you point me in the correct direction?
Also I just looked at the mxd and this is a shapefile with the geometry type defined as a point.  So I don't understand why it is not coming through when it is pulbished unless it is because this is one of a couple shapefiles in the project and the other one is a line.
0 Kudos
by Anonymous User
Not applicable
Original User: cgishack

The service will pull the geometry type out of the data.. You don�??t have to defined anything in the service itself.
I would go back to your Map Document (MXD) and see what the data has there.
Check to ensure your �??SHAPE�?� fields visibility is not turned off too (Layer Properties->Fields Tab)
0 Kudos
RichardKrell
New Contributor
Boy fast and furious here.  I checked and the shape field was turned off.  I will let you know what happens but I have a feeling that the problem may also stem from having a line shapefile as part of the mxd also.  I will let you know shortly and thanks for all your help.
0 Kudos
RichardKrell
New Contributor
Andrew,
That was part of it... Once I turned on the shape field it now is showing the Geometry type as esriGeometryPoint.  FANTASTIC... still not working but I think this is getting me closer.  I would like to keep this going and work on it for a while and see what happens.

Again thanks very much Andrew and I will let you know what happens.
0 Kudos
by Anonymous User
Not applicable
Original User: cgishack

Good to hear!
Don't forget to refresh both the service and the rest cache to see the changes take effect.

Once you fix your code a bit I am sure it will all come together and work!

Drew
0 Kudos
RichardKrell
New Contributor
yea did that and am still blowing up but I think it is in the line:

var point : MapPoint = new MapPoint(featureSet.features.geometry.x,featureSet.features.geometry.y);

Still the same information in the dump.  Error #1009: Cannot access a property or method of a null object reference.

This is closer than I have been in days!!
0 Kudos
by Anonymous User
Not applicable
Original User: richardkrell

If you are interested you can see what I have done thus far in a test service located at:
http://data.cmap.illinois.gov/tipbeta/shapes1.html
0 Kudos
by Anonymous User
Not applicable
Original User: cgishack

I assume you are still using the same service......
I don't see a geometry Type listed
See Geometry Type using the link below for Maps/TIP_Test/0 layer
http://data.cmap.illinois.gov/ArcGIS/rest/services/Maps/TIP_Test/MapServer/0
0 Kudos