POST
|
I'm trying out the geometryEngine api from the JavaScript framework and it doesn't seem to work as intended. Some code to do distance between two points: require(["esri/geometry/geometryEngine"], function(geometryEngine) { this.sr = new esri.SpatialReference({ wkid: 4326 //decimal degrees }); this.distanceUnit = 9001; var distance = new Number(0); geometry1 = new esri.geometry.Point(-105, 40, this.sr); geometry2 = new esri.geometry.Point(-100, 30, this.sr); distance = geometryEngine.distance(geometry1, geometry2, this.distanceUnit); }); the distance returned seems to be a decimal-degree unit, not ever the units I specify (e.g. 9001:meter, 9036:kilometer, 9035:mile) Is there something I'm missing?
... View more
07-13-2015
05:14 PM
|
0
|
0
|
3353
|
POST
|
Here is the solution I found: don't use the ESRI library, use Spatial4j instead. Example use: Add to your pom: <dependency> <groupId>com.spatial4j</groupId> <artifactId>spatial4j</artifactId> <version>0.4.1</version> </dependency> in your class: Rectangle envelope = SpatialContext.GEO.makeRectangle(minlon, maxlon, minlat, maxlat); Point pt = SpatialContext.GEO.makePoint(lon, lat); boolean contains = false; if (envelope.relate(pt) == SpatialRelation.CONTAINS) { contains = true; } you can also check if your envelope crosses the dateline with this boolean response: envelope .getCrossesDateLine();
... View more
05-28-2015
09:42 AM
|
0
|
0
|
10
|
POST
|
You still want to query something. Tom's example is good, another typical 'dummy' query to get all data is: WHERE 1=1
... View more
04-24-2015
08:25 AM
|
0
|
0
|
35
|
POST
|
queryTask = new esri.tasks.QueryTask(gpURL); //build query filter query = new esri.tasks.Query(); query.returnGeometry = false; query.outFields = ["*"]; query.geometry = geometry.mapPoint; query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; queryTask.execute(query, successFunction, errorFunction); Use the error callback and see what the response objects say. Also, what are you querying? A where-clause, by geography, etc?
... View more
04-23-2015
10:40 AM
|
0
|
0
|
35
|
POST
|
I'm using the ESRI Geometry Java API https://github.com/Esri/geometry-api-java I want to construct an envelope and see if it contains certain points. It's possible the envelope crosses the International date line. Here is some sample code I've tried: double lon = Double . parseDouble ( "179.99" ); double lat = Double . parseDouble ( "0" ); Point pt = new Point ( lon , lat ); double minlon = Double . parseDouble ( "170" ); double minlat = Double . parseDouble ( "-20" ); double maxlon = Double . parseDouble ( "-170" ); double maxlat = Double . parseDouble ( "20" ); Envelope ev = new Envelope ( minlon , minlat , maxlon , maxlat ); SpatialReference sr = SpatialReference . create ( 4326 ); // decimal degrees boolean test = GeometryEngine . contains ( ev , pt , sr ); System . out . println ( GeometryEngine . geometryToJson ( sr , ev )); assertTrue ( "envelope containts point true" , test ); The test fails, and if I check the print statement I get a json that has swapped my x-coordinates { "xmin" :- 170 , "ymin" :- 20 , "xmax" : 170 , "ymax" : 20 , "spatialReference" :{ "wkid" : 4326 }} Is there a different/better way to do this?
... View more
04-20-2015
04:57 PM
|
0
|
1
|
3235
|
POST
|
Ideally be able to determine if you are off-ground (building levels/roofs, poles, etc..).
... View more
04-09-2014
01:25 PM
|
0
|
0
|
30
|
POST
|
Hey, is there any way to use Collector (or any mobile ESRI app) to record Altitude along with Lat Long?
... View more
04-09-2014
01:01 PM
|
0
|
4
|
3418
|
POST
|
I'm looking to see if it's possible to layer multiple graphics (like a background graphic and a foreground graphic) for a single point? Ideally I don't want to create multiple features of the same point in the same or different layer. Perhaps someone has extended PictureMarkerSymbol to take in more than one img URL?
... View more
02-28-2014
08:33 AM
|
0
|
0
|
444
|
POST
|
Is it possible that the node used to generate the content for your infoWindow is getting destroyed between the first and second clicks? I had something similar happen to me when I closed the infoWindow and ended up having to clone the node for the infoWindow rather than assign it directly. Brittney, I think you are on the right track, though I'm not sure the best means of resolving the issue. On the first click (feature - onSelectionComplete) I can see the infoWindow with both .title and .content populated. However, on the subsequent click on the already selected feature, the .title stays the same, but the .content almost becomes empty - the main div remains (a BorderContainer), however the contents of the div are now empty (no more content pane's, etc..).
... View more
06-27-2013
09:35 AM
|
0
|
0
|
19
|
POST
|
Jon, Thanks for the response. However, those aren't the issue. I have already selected the feature, I'm not changing the feature (not clicking another feature), nor clearing features, simply clicking the same feature after the infoWindow has already popped up. At that point the infoWindow goes from populated data to blank.
... View more
06-14-2013
12:15 PM
|
0
|
0
|
19
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|