|
POST
|
Hi Ernst, At 10.1, there is a way to recalculate the extent through the properties of the feature class. In the Catalog window > right-click on the feature class > Properties > Feature Extent tab. [ATTACH=CONFIG]21603[/ATTACH] The only way I was able to find a way to do this using python is to execute the Feature Class to Feature Class tool. So, what you could do is execute the following tools: arcpy.FeatureClassToFeatureClass_conversion arcpy.Delete_management (delete the original feature class) arcpy.Rename_management (rename the copied feature class to the original name)
... View more
02-08-2013
02:06 AM
|
0
|
0
|
4964
|
|
POST
|
Hi Ernst, Do your feature classes reside in a File/Personal Geodatabase, or an SDE Geodatabase? If they reside in an SDE geodatabase you can use the 'sdelayer -o alter' command to recalculate the extent. Ex: import os
os.system("sdelayer -o alter -l parcels,shape -E calc -i sde:sqlserver:serverA -D GIS -u vector -p vector") The '-E calc' option will recalculate the extent based on all the features. Or you can optionally specify it: -E -75.17,39.88,-75.13,39.92
... View more
02-07-2013
01:54 AM
|
0
|
0
|
4964
|
|
POST
|
Hi David, I believe the problem is the extent is wrong when you try to zoom to the feature. Try the following instead: var map;
var findTask, findParams;
function init(){
map = new esri.Map("map")
var basemap = new esri.layers.ArcGISDynamicMapServiceLayer("http://myserver/ArcGIS/rest/services/Basemap/MapServer");
map.addLayer(basemap);
//Create Find Task using Post code layer
findTask = new esri.tasks.FindTask("http://myserver/ArcGIS/rest/services/Basemap/MapServer/");
//Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["NAME"];
findParams.outSpatialReference = map.spatialReference;
}
function doFind(){
//Set the search text to the value in the box
findParams.searchText = dojo.byId("name").value;
findTask.execute(findParams, showResults);
}
function showResults(results){
map.graphics.clear();
var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND, 10,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([0, 0, 0]), 1),
new dojo.Color([255, 255, 0, 1]));
//Create items array
var items = [];
for (var i = 0, il = results.length; i < il; i++) {
items.push(results.feature.attributes); //append each attribute list as item in store
var graphic = results.feature;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
}
for (var i = 0, il = map.graphics.graphics.length; i < il; i++) {
var currentGraphic = map.graphics.graphics;
}
extent = pointToExtent(map, currentGraphic.geometry.x, currentGraphic.geometry.y, 6)
map.setExtent(extent);
}
function pointToExtent(map, pointX, pointY, toleranceInPixel) {
var pixelWidth = map.extent.getWidth() / map.width;
var toleraceInMapCoords = toleranceInPixel * pixelWidth;
return new esri.geometry.Extent( pointX - toleraceInMapCoords,
pointY - toleraceInMapCoords,
pointX + toleraceInMapCoords,
pointY + toleraceInMapCoords,
map.spatialReference );
}
dojo.addOnLoad(init); The function 'pointToExtent' will calculate the extent based off of the selected graphics X and Y coordinates.
... View more
01-29-2013
07:26 AM
|
0
|
0
|
735
|
|
POST
|
Hi James, You can check if the layer resides in an SDE geodatabase by using the Layer's 'dataSource' property. Ex: import arcpy from arcpy import env env.workspace = "C:/WORKSPACE" mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] CRID = 333 defquery = """ "RID" = """ + str(CRID) for lyr in arcpy.mapping.ListLayers(mxd): if ".sde" in lyr.dataSource: lyr.definitionQuery = defquery
... View more
01-29-2013
05:16 AM
|
0
|
0
|
1048
|
|
POST
|
Hi Jerome, You could use the glob module to do this. Here is an example: import arcpy, glob
newSdePath = r"Database Connections\myConnection.sde"
for file in glob.glob(arcpy.GetParameterAsText(0) + r"\*.mxd"):
mxd = arcpy.mapping.MapDocument(file)
for df in arcpy.mapping.ListDataFrames(mxd):
for lyr in arcpy.mapping.ListLayers(mxd, ""):
if lyr.isFeatureLayer== True:
lyr.replaceDataSource(newSdePath, "SDE_WORKSPACE","", False)
mxd.save()
del mxd In the above example, set the data type for 'arcpy.GetParameterAsText' as 'Folder'. The above code will then loop through the specified folder and update all MXDs.
... View more
01-29-2013
05:09 AM
|
0
|
0
|
2312
|
|
POST
|
Hi Timothy, I recommend a File Geodatabase unless you need to edit feature classes with your web application. At that point you need a feature service, and a feature service requires the data to exist in an SDE geodatabase. Benefits of using a File Geodatabase: 1. Public applications are not directly accessing your SDE geodatabase 2. With SQL Server Express (Workgroup edition) you are limited to 10 connections. You will not be using a connection(s) with the published service 3. File Geodatabases can yield faster performance
... View more
01-28-2013
10:27 AM
|
0
|
0
|
479
|
|
POST
|
Hi Henrik, When you mosaic the rasters together using the Mosaic to New Raster tool, specify MAXIMUM for the Mosaic Operator parameter. The output cell value of the overlapping areas will be the maximum value of the overlapping cells. You may still have the black collar around the final output, but you can remove this using the symbology tab, or by using the Copy Raster tool and specifying 0 for the NoData Value parameter.
... View more
01-28-2013
05:23 AM
|
1
|
0
|
8352
|
|
POST
|
Hi Ernst, Take a look at creating a versioned view. There is a similar post here.
... View more
01-28-2013
05:06 AM
|
0
|
0
|
3500
|
|
POST
|
The arcpy.da.UpdateCursor is only available at 10.1. You can still use the arcpy.UpdateCursor at 10.0. The same test updated the rows in a little over 3 seconds.
... View more
01-22-2013
06:19 AM
|
0
|
0
|
1255
|
|
POST
|
Hi George, You could accomplish this in a python script. Ex: import arcpy from arcpy import env from arcpy.sa import * env.workspace = r"C:\folder1" list = [] for raster in arcpy.ListRasters("*"): list.append(raster) for n in list: env.workspace = r"C:\folder2" if n in arcpy.ListRasters("*"): ras2 = n outPlus1 = Plus(n, ras2) env.workspace = r"C:\folder3" if n in arcpy.ListRasters("*"): ras3 = n env.workspace = r"C:\folder4" if n in arcpy.ListRasters("*"): ras4 = n outPlus2 = Plus(ras3, ras4) outPlus3 = Plus(outPlus1, outPlus2) outPlus3.save(r"C:\output" + "\\" + n) What the code is doing is iterating through folder1 and appending all rasters to a list. Then the code iterates through the list and finds each raster in folder2, folder3, and folder4. With a python script you cannot use the Raster Calculator, so you will need to use the Plus tool for spatial analyst. Therefore, you will need to sum the rasters from folder1 and folder2, then sum the rasters folder3 and folder4, and then finally sum the outputs from these two.
... View more
01-22-2013
05:36 AM
|
0
|
7
|
4678
|
|
POST
|
Hi Lionel, The new python arcpy.da.UpdateCursor is extremely fast. With a quick test, I was able to update approx 12,000 rows in less than 2 seconds.
... View more
01-22-2013
05:10 AM
|
0
|
0
|
1255
|
|
POST
|
Check to make sure no users are connected to the database when you execute the compress. Also, if you have any replicas be sure they are synched before the compress. http://support.esri.com/en/knowledgebase/techarticles/detail/29160
... View more
01-22-2013
02:04 AM
|
0
|
0
|
716
|
|
POST
|
This is most likely due to a schema lock. Is the data open in ArcMap? If so, try closing ArcMap, or in ArcMap right-click on the layer > Open Attribute Table > click the drop down > Add Field.
... View more
01-18-2013
09:47 AM
|
0
|
0
|
552
|
|
POST
|
We are currently working in ArcGIS 10. We have a replica gdb of our data on sde. I added a couple of fields to the parent gdb. in this case our sde gdb. I was able to get the fields added to our replica gdb. But the data that was in those fields did not populate. I ran a synchornize data and still didn't push the data over. How do i get the data to populate. Hi Erik, Take a look at the following article. You can follow these steps to update the schema of your child geodatabase. After the schema is updated, you can synchronize the edits from your parent to child geodatabase.
... View more
01-18-2013
08:57 AM
|
0
|
0
|
1345
|
|
POST
|
Hi Mike, When you switch versions, are you performing the switch using the Table of Contents, or the 'Change Version' tool on the versioning toolbar? If so, when you execute the Select Layer by Location tool, be sure you are using the drop-downs to select the layers from the table of contents, and you are not browsing for the feature class. If you browse to the feature class, and the geodatabase connection properties are set to SDE.Default, this will be the version used to perform the selection.
... View more
01-18-2013
06:32 AM
|
0
|
0
|
4073
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|