Monthly Archives: January 2009
Querying a point or a line is a little more difficult than querying a polygon because the mouse click is required to fall directly on the line or point in order for a result to be returned. To makes things easier for your users, you can build a “tolerance” envelope around the clicked point.
var centerPoint = new esri.geometry.Point (evt.mapPoint.x,evt.mapPoint.y,evt.mapPoint.spatialReference); var mapWidth = map.extent.getWidth(); //Divide width in map units by width in pixels var pixelWidth = mapWidth/map.width; //Calculate a 10 pixel envelope width (5 pixel tolerance on each side) var tolerance = 10 * pixelWidth; //Build tolerance envelope and set it as the query geometry var queryExtent = new esri.geometry.Extent (1,1,tolerance,tolerance,evt.mapPoint.spatialReference); query.geometry = queryExtent.centerAt(centerPoint);
In the above code, you figure out the width of one pixel in map units given the current scale. You then multiply this by the total tolerance width in pixels. So if you want a tolerance of 5 pixels on each side, you multiply by 10. This gives you the width of your tolerance envelope in map units.
You then use one of the esri.geometry.Extent constructors to make the square tolerance envelope. Any feature that intersects the envelope will be returned as a query result.
It’s worth noting that the Identify task has a built-in tolerance that you can easily modify using IdentifyParameters. However, the Identify task does not allow you the flexibility to determine which fields are returned. The Query task lets you narrow the fields.
Contributed by Sterling Quinn and Jeremy Bartley of the ArcGIS Server development team
As you know, the ESRI Developer Summit is just around the corner. We worked hard to get all of the sessions and descriptions published early, so be sure to check out the online schedule to help plan your conference, and to get a sneak preview of what’s coming.
There are three main types of sessions:
- Presummit Seminars (3hr seminars, Monday, March 23)
- Plenary Session (3hrs, Tues morning, March 24)
- Technical Sessions (1:15hr sessions, Tues-Thurs, March 24-26)
Visit the ESRI Developer Summit for more event information.
Here’s an interesting post that just appeared on the GIS Education Community Blog from George Dailey, ESRI Education Manager. It covers a trip by a colleague (Robyn Johnson) to Antarctica, and uses Explorer to tell the story about the adventure. It uses several tasks and incorporates the ArcGIS Online basemaps with data from NOAA, and also incorporates Robyn’s blog entries and YouTube vids using notes and their popups.
To learn more about notes and what you can do with them, check out these previous posts:
Here’s a heads up on a couple items of note regarding replication:
There is a new 9.3 SP1 geodatabase replication patch. This patch addresses cases where replica system versions are not being removed when they should be during a connected synchronization. We recommend that all who use geodatabase replication with ArcGIS 9.3 install this Patch.
There is also a new article that describes timeouts and data limitations when replicating with geodata services over the internet. Anyone replicating with geodata services over the internet should review this document.
Well, we were sitting around this evening wondering what our first post for 2009 would be, when the answer came in the form of a little roller coaster ride, thanks to an earthquake whose epicenter was just 6 miles from ESRI. We’ve covered earthquakes here on the blog plenty of times before, so we thought we’d do something a little different and take a look at the USGS earthquake data in 3 different ways as it’s published at the USGS site.
First we viewed the GeoRSS feed. The connection was already stored in our list of connections since we’ve used that GeoRSS feed before. We just opened up the connection by choosing File > Open, and then choosing Servers in the Open Content dialog. Once we did, we could just scroll down the list of our remembered connections to find the quake feed to view it.
The feed displays all the quakes greater than magnitude 2.5 over the past day. We also used Find Address to locate ESRI, and used Measure to determine the distance from ESRI to the epicenter of the quake, which was just under 7 miles.
Next we opened the KML published on the USGS site showing all quakes greater than 1.0 in magnitude over the past 7 days. Note the display overlay in the upper left that came along with the KML, and the small aftershock (1.7 magnitude) located within a half mile of the initial temblor.
Finally we opened the USGS quake data delivered as a comma-delimited text file. We clicked on its link at the USGS site to view it in a browser, and this is what we saw:
We saved the file out as a text file, and took a look at it using Notepad. The first line in the file had field names, which was just perfect, but we had to do some minor edits to pull in the information the way we wanted. We removed quotation marks (using a global search and replace with a space) from around a combined day/date/time field, and added the extra field names to match the new formatting on the first line. We saved the file, then chose Tools > Import File to open the file import wizard.
In the first dialog we just accepted the defaults. Note the data preview panel at the bottom of this dialog which shows us how the text file is being parsed. This was especially useful since we could verify that we correctly made the edits to the file mentioned above.
After clicking Next, in the following dialog we again accepted all the defaults (the latitude and longitude fields were already found, since they had been named “lat” and “lon” in the text file) and chose “Magnitude” as the title field (so we could view it as we hovered over the location with our mouse) and “Region” as the description field.
Then we chose a symbol, and here’s our map with the quake information imported from the text file.
This file contains all the magnitude 1.0 or greater quakes for the last day, and you can see there’s been lots of activity in southern California during that time period.
By Charlie Frye, Esri Chief Cartographer
Most maps should have some depiction of hydrography. The problem is, if you’re not familiar with the data or the typical symbology conventions, it’s hard to find the time to make the required effort. In the U.S., hydrography data is available from the USGS in the form of the National Hydrography Dataset (NHD). Once you download the NHD data you need (TIP: you need to allow popups on this site), the next task is symbolizing it. To help with that here are a few layer files that you can load into ArcMap, then use the Layer Properities’ Source tab to change the data source to your data.