Sunday, September 6, 2009

ArcGIS Javascript API query only returning max 500 features?

If you are performing a query or identify using the ArcGIS Server API, and the map service is only returning a maximum of 500 features when the query should be returning more, this is by design.

The limit on features returned is because of a default REST endpoint limit established for each map service of 500. This setting is stored in your map service configuration file, generally located at C:\Program Files\ArcGIS\server\user\cfg\[ServiceName].MapServer.cfg, as 500.

You can override this setting, and the map service will return as many features as you like, however, you should consider the amount of data that your client will be forced to download. The more features returned, the longer it will take to download them to the client, thus resulting in slower perfoming websites.



Sunday, August 23, 2009

Why upgrading to ArcGIS 9.3.1 could take so long.

Well I decided I could afford a couple hours in my maintenance window to upgrade my ArcGIS Server version 9.3.1, and 8 hours later ...... I finished.

Installing the upgrade patch didn't take to long, but during the post install, it seemed that the post install screen would hang there for a long time. I mean I even waited about an hour and a half, but still no cigar. ArcGIS Server 9.3.1 just simply would not complete.

It wasn't before I opened a trouble ticket with ESRI, and even then it was a couple of hours before we were able to get the 9.3.1 upgrade completed, and keep in mind that during this process, none of the map services are running.

What it boiled down to, was that because my map cache folder was so large, it was holding up the ArcGIS Server 9.3.1 post install progress. This is because during the post install, the folder and file permissions are set for the arcgisserver folder, and thanks to the changes in security for each of the cache image files, you may have to wait for this process to complete setting the permissions of each file. For me, this was hundreds of thousands of cache files, and according to the the ESRI Tech support folks, this process could of taken several days to complete.

If you found this artcile, then you are in luck, because there is a workaround.

That is, in order to avoid this issue when upgrading ArcGIS Server, rename your arcgisserver folder to arcgisserver.old, and the post install will take seconds vs hours. Then, simply stop the ArcSOC windows service and rename the the new arcgisserver folder to arcgisserver.delete, rename the arcgisserver.old folder back to arcgisserver, and start the ArcSOC service and you should be golden. This process works because since you are upgrading, and the ArcGIS map services were working previously, the file permissions do not need to be changed as they should already be correct.

Don't forget however, that if you are using a shared folder for your arcgisserver folder, you will have to recreate those shares.

Happy upgrading!

Monday, July 13, 2009

ArcGIS API for Silverlight no longer in BETA!

No longer in BETA version, I now present to you ArcGIS API for Silverlight version 1.0.

ESRI ArcGIS Silverlight/WPF API releasedBy Morten (7/13/2009 4:25:00 PM)

Last week we finally released v1.0 RTW of our Silverlight/WPF API. Today at our User Conference in San Diego, Jack Dangermond announced, that it even will be free for non-commercial use. The API will run on both v2 and v3 of Silverlight. [. . .] Read more

ESRI ArcGIS Silverlight Toolkit - http://esrisilverlight.codeplex.com/


Silverlight's home page.

ESRI ArcGIS API for Silverlight examples can be found at:

Saturday, June 27, 2009

Wonder how ArcGIS Javascript API examples work so well in IE8

I decided to spend some time upgrading my ArcGIS Javascript API RESTful apps so that they would work well in IE 8 since so many of our users are making the upgrade. So using the latest version of ArcGIS Javascript API 1.4, I started to check my code against their examples, and if you've read my previous post, you would of seen that the I mentioned some of the issues that I was having with IE8.

Well after spending some time looking through the examples, it appeared that ESRI was able to make all the problems disappear in IE8 that I was having in my code. So, off to work I went trying to figure out what they did in for each of the dojo tools that failed to work for me. After very little time spent, I noticed that I was implementing most of the functions pretty much the same as they were, so I decided to start at the top of their code and go line for line. It didn't take long then. When I looked at the first example, when I reached line 5, i noticed the following line:

<meta http-equiv="X-UA-Compatible" content="IE=7" />

Well, for those of you who don't know, this forces IE8 to go into compatibility mode, and actually view the page as if it were IE7.

So that is how they did it. they didn't fix anything at all, and better yet, their examples truly do not work correct in IE8. I downloaded the test page, and commented that line out, and low and behold, their own map services don't load correctly using the latest version (1.4) of their API. If you care to see what their example looks like with line 5 commented visit http://paco.agcenter.lsu.edu/gis/hsrg/index2.htm.

So the moral of this blog is, if you want to upgrade to ArcGIS Javascript API 1.4 and have users visit your site using IE 8, you are going to have to force IE8 browsers into IE7 compatibility mode.

Thursday, June 18, 2009

Louisiana - West Baton Rouge Parish Preliminary Digital Flood Rate Insurance Map (DFIRM) now published

Well for those of you who are tracking the release of the new floodmaps by FEMA in the state of Louisiana, I have posted West Baton Rouge Parish's Pre DFIRMs. You can find them at http://lamp.lsuagcenter.com/?FIPS=22121. Remember that these are preliminary, and they have not been adopted by the parish yet. UNO Chart is working on setting up a date for an outreach event to be held in the parish, and when they do, I will post it here.

I hope to Geo-reference the original FIRM Maps and put them on the website as soon as possible so that you people living in this parish will be able see exactly how the flood maps changed.


Thursday, June 11, 2009

Adding a 3rd party WMS map service using ArcGIS Javascript API

Well, I've looked all over for how to add a WMS to a website using the ArcGIS JavaScript API. ESRI’s resources web site offered a clue by showing how to add a WMS service generated from a ArcGIS Server to a map, but it did not quite work with other WMS Services.

Since I didn’t have much luck there, or elsewhere on the web, I figured I would teach myself. Furthermore, I figured I would document it along the way so that someone else who tried this in the future might have better luck. Before you get started however, I highly recommend you at least glance at the OGC Web Map Services standards, I have even provided you with a link toVersion 1.1.1here which is the version of the WMS that I use in this example.

So, here it goes:

I wanted to have access to the current rain/weather situation in my website, so I chose theCONUS NEXRAD Base Reflectivity (N0R) WMS layer, hosted by Iowa Environmental Mesonet, and I overlayed it onto an existing base map that I have. Doesn't seem like it would be that complicated right? Well if you are left just to ESRI’s web resources and don’t know much about WMS standards it just may be.

The first step is to create a WMS Layer as a ArcGIS DynamicMapServiceLayer usingdojo.declare which requires 3 arguments as follows:

1. The name of the Class that you wish to declare which is a string representation of the name. I will use “my.WeatherRadarWMS

2. The next parameter is either an object or an array of objects. In this case it is the ESRI ArcGIS JavaScript API defined object DynamicMapServiceLayer.

3. The third parameter is an JSON object hash of properties to be mixed in after all other inheritance has been solved. This instance has two properties constructor and getImageUrlwhich are required.

// Save time by declaring your start extent up front
// this is the full extent for the state of Louisiana

var startExtent = new esri.geometry.Extent({ xmin: -94.647329960938, ymin: 28.1275820820308, xmax: -88.154410039062, ymax: 33.7470889179692, spatialReference: new esri.SpatialReference({wkid: 4269})});

//Create the WMS layer

declare("my.WeatherRadarWMS", sri.layers.DynamicMapServiceLayer, {
// Now for the constructor definition
constructor: function() {
this.initialExtent = this.fullExtent = startExtent;
this.spatialReference = new esri.SpatialReference({wkid:4269});
this.loaded = true;
this.onLoad(this);
},

getImageUrl: function(extent, width, height, callback) {

//***** PAY ATTENTION HERE ******************//
//* The ESRI Example uses a JSON Object which works
//* fine with an ESRIgenerated WMS, but not with
//* WMS’es created by other software. I had change
//* the parameters to a string this section up a bit.
//**********************************************//

var params =
"VERSION=" + "1.1.1" +
"&REQUEST=" + "GetMap" +
"&SRS=EPSG:" + "4326" + // You need to use the WMS’s spatial wkid
"&width=" + width +
"&height=" + height +
"&LAYERS=" + "nexrad-n0r,nexrad-n0r-900913,
nexrad-n0r-m10m,nexrad-n0r-m15m" +
"&STYLES=" +
"&FORMAT=" + "image/png" +
"&TRANSPARENT=" + "true" +
"&bbox=" + extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax
"&exceptions=" + "application/vnd.ogc.se_xml"

callback("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?" + params );
}
})
}

Now all that’s left is to add the layer to your map document as follows:

//Add WMS Weather Layer
map.addLayer(new my.WeatherRadarWMS());

//or ......
//If you wanted to add opacity to the layer,
// you could do this
wmsRadarLayer = new my.WeatherRadarWMS()
wmsRadayLayer.setOpacity(.75)
map.addLayer(wmsRadarLayer)

And there you have it, a WMS layer added via ArcGIS JavaScript API. You can see a live version of this here. I will leave it up for a bit.

Post a comment if you find this helpful or if you have any questions.



Monday, June 8, 2009

ArcGIS JavaScript API 1.4 released, and some functions no longer work the same in IE8.

I am an avid GIS Programmer, and I primarily use ArcGIS Server as the platform for my GIS Layers and I use ArcGIS JavaScript API as the web engine. I have however had many issues making all my existing websites function properly in IE 8. This is partially because the API uses dojo, and until dojo 1.3 version was released, there were many compatibility problems with dojo and IE8 .

While I was able to resolve most of my issues when ArcGIS JavaScript API 1.3 was released, I am back to the grinding wheel with the latest release of ArcGIS JavaScript API 1.4 . I have once again found more problems that I have to address or work-around with ESRI's latest release of their JavaScript API.

One of the first problems I noticed, is that when using shift+click+drag to draw a zoom rectangle, the oncle slick zoom rectangle no longer appears although the function still appears to work. If you look at their sample posted here, you will notice that they no longer list the zoom function.

If you have IE 8, you can view this test page that I built here which is using ArcGIS JavaScript API version 1.4. If you have FF, take a look and use the zoom function and you will see that the zoom function does not draw correctly. Both of these problems do not exist in version 1.3.