|
POST
|
I don't think it applies to images that are always rectangular. So for your case create a bounding box and tile it into less than the maximum size. Better still contact the vendor and get a quote for providing the area you want. They probably will do a custom area. My thought experiment was to simply divide up an irregular but convex polygon into segments from the centroid. We know the area of the segment so we can create triangles from the centroid to the boundary vertices. you keep adding up the triangles until you reach the limit and then draw the combined shape. For 4 parts the segments would be quarters. I know for large numbers the shape would not be squarish. This could be helped by cutting out a circle in the middle and then do the same process, subtracting off the centre segment. Then there would be n -1 equal areas and one circle of the same area. The areas around the ring would have roughly 4 sides, maybe the circular side could be simplified to a straight segment.
... View more
04-04-2017
02:12 AM
|
0
|
2
|
2666
|
|
POST
|
This seems to be an unanswerable question if it is still going after 5 years! But it inspired me to think of a solution that is modelled on the discovery that the earth sweeps around the sun on an ellipse at different speeds but a constant swept area. I know people had in mind rectangular forestry plots but that is never going to fit into an irregular polygon. Without the restraint of a grid (from previous failed solutions) there is an apparently trivial solution. So this is my idea that seems easy to implement. Why not simply divide the area into n segments? Each segment will have area = total_area / n. There will not be any left-over areas. Start by selecting the centre, say a modified centroid. Then sweep around the boundary adding up the cumulative area until you reach the limit for a segment, draw a line and restart. I can see an exception with some shapes that are so re-entrant that there is not a straight line to the centroid, so they would need special handling such as splitting into convex polygons. With geometry objects in arcpy the calculations can be very fast with a python function that iterates over the boundary vertices. Each step is a simple triangle with an easy area solution, just keep adding until you get to the limit. If the vertices are too widely spaced, interpolate or densify the boundary before starting. So you don't like the shapes? Why not, for a small number, say 4 they will be almost a rectangle anyway. Maybe for a very large number you could cut out the centre say using a circle and have n-1 segments around the donut to prevent sliver shaped areas. Hint: Surveyors use the Double Difference Area equation to calculate the area of a traverse with only one division operation by 2. Anyone up to the challenge to provide a script that runs in a short time?
... View more
02-01-2017
10:15 PM
|
0
|
5
|
2666
|
|
POST
|
Do you need a geometry AND a wkt version? Surely one will do. You would have to be careful to get the one in the list. Would it not be easier to just write row[1] = objectdict[row[0]] where the objectdict is a dictionary of shapes indexed by ID I am trying to help you debug your code, so I would put in a lot of print statements that confirm you do have a geometry and it is in the right row element by printing out a WKT representation as you go and then break after the first one. If you only put up pseudocode you are hiding your problem with your assumptions on where the problem lies. It would be much better if you posted your real code.
... View more
01-27-2017
04:04 AM
|
1
|
3
|
3097
|
|
POST
|
Rather than a list of geometries a dictionary of geometries is more direct to insert.
... View more
01-27-2017
03:55 AM
|
0
|
4
|
3097
|
|
POST
|
Is this too simple? If the geometry is WKT format then the insert should use tmpRow[2] not tmpRow[1] because the field spec you must have is SHAPE@WKT
... View more
01-27-2017
03:52 AM
|
0
|
0
|
3097
|
|
POST
|
Ok, well how many features are in the layer definition? Can you print out the ID and featurecount? I assume you are using some sort of index based on the ID to get the respective geometry to add? Why are you getting the geometry out twice in the updateCursor?
... View more
01-27-2017
03:30 AM
|
0
|
7
|
3097
|
|
POST
|
You have skipped the key item - what geometry are you adding? How did you get it? Is it really a geometry? I don't think you can join two featureclasses and retrieve both geometries at once. You are probably just replacing the geometry with itself. I would create a python dictionary of source geometries keyed by the id using a list comprehension and a ReadCursor. Then close the cursor and open an UpdateCursor and iterate over the list. You could even speed it up by using an SQL query to only select records to be updated with an IN sql clause of the keys.
... View more
01-27-2017
01:40 AM
|
1
|
1
|
3097
|
|
POST
|
I never use an arcpy tool in a loop. They are not designed to do that. You could assemble your list of FIDS into a list, convert to a string and use a SQL "IN" statement to select in one step. Faster, easier to understand, easier to debug and easier to create. Why do you need to check if the parcel id exists? If it doesn't it won't matter in an IN list. # list of valid ids (do a regular expression in a list comprehension to validate print(len(FIDS)) # just to see how many, limit 50,000 should be fine, if more then partition, can use 1M if integers not strings the_list = str(tuple(FIDS)).replace('u','') # strip off any unicode tags sql = "{} in {}".format(the_field,the_list) print (sql[0:40], sql[-40:]) # check syntax # make sure FID is indexed for performance arcpy.SelectLayerByAttribute_management(parcels, "ADD_TO_SELECTION", sql)
... View more
01-27-2017
01:12 AM
|
1
|
2
|
1789
|
|
DOC
|
Yes we all got this! Install qt yourself: conda install qt-4.* Then try the spyder install again conda install spyder This will trigger yet another upgrade of qt to 5.6.0, but let it run to completion. You have to install the 4.* version first. I found that spyder then opened from the start menu shortcut. So much for conda handling dependencies! Who would have thought of this?
... View more
01-02-2017
03:19 AM
|
0
|
0
|
3345
|
|
DOC
|
This did work for me but, using this roundabout process: Could not uninstall qt, could not reinstall 4.8.7-vc10_4 because not found I could however install a variation using conda install qt-4.* which found a later version This then enabled spyder to install conda install spyder which then immediately upgraded qt to 5.6.0-vc10_0 so I didn't argue since it was not numpy or scipy So now spyder will open from the shortcut in the start menu. I am staying with Windows 7 BTW. So much easier. AVG antivirus objects to Python so I tell it to ignore it. Thanks Clinton, you gave me enough hints to blunder through without resorting to root or reinstalling the operating system.
... View more
01-02-2017
03:12 AM
|
0
|
0
|
3345
|
|
DOC
|
Yes! I got it working without going into Root with a few changes to your suggestions. I am getting the fail when trying to install spyder and the usual error message from User 'ray' who must be a developer of qt. Firstly I could not remove qt because it wasn't installed with ArcPro apparently. I could also not install qt-4.8.7=vc10_4 because it is now qt-4.8.7-vc10_9 [vc10] I got around this by using a wildcard to install qt : conda install qt-4.* Then I was able to restart the spyder install: conda install spyder, which upgraded qt to qt-5.6.0-vc10_0 anyway so I didn't argue as it wasn't numpy or scipy Now I can open spyder from the shortcut in the start menu. The next stage is to work out how to get the ARcPro licencing fixed up, but it is a pubic holiday today here. This is all distressingly complicated. I will have to set aside half a day for what goes wrong with Python setup in the new ArcPro training course.
... View more
01-02-2017
02:41 AM
|
0
|
0
|
3345
|
|
POST
|
Ok, so you can create a Spatialite database in Arcpy. But what can you do with it? Where is the documentation on which functions and tools support Spatialite? The help is completely silent on this. The reason I even put in 10.4 was because of the new tool arcpy.management.CreateSQLiteDatabase. I assumed that there would be lots of new (hidden) support for spatialite in arcpy. But maybe I was too hopeful. Could we users need to set up a Wiki for information on this? Any suggestions for the most suitable platform? My experiments are a mishmash of SQL calls using a number of python APIs to sqlite or spatialite plus some arcpy calls. Some are excellent, others are very slow or impossible. I switch between the obvious and obscure as I explore the limits. It would be nice to have a consistent simple interface that worked the same way as the venerable file geodatabase. Perhaps a new thread discussing the limits would be better.
... View more
07-17-2016
02:22 PM
|
0
|
0
|
486
|
|
POST
|
It fails in either environment. Standalone is a good idea these days if you are doing batch processing because it can use the 64 bit version of Python that has more memory for those crude memory hog routines that are now so popular. By the way, partitioning is the solution for this, cartographic partitioning is now used for some tools and one can adopt the same technique to reduce memory and speed up processing.
... View more
07-14-2016
03:00 PM
|
0
|
0
|
2049
|
|
POST
|
It is a good idea.I am already using pyspatialite to handle sqlite based tables and featureclasses. But converting back to file geodatabases needs a conversion tool. In theory this is supported by the conversion utilities, otherwise I have to complicate the workflow by using FME or a complex dump/reload. Some tables have geometry so they turn into a featureclass. Most of my customers are still more comfortable with a file geodatabase. I cannot (yet?) use database relates or store metadata for example. But I have other customers that do not have a GIS so they need data in a database exchange format. What to use? Access database have been deprecated and anyway they have 2GB limits which I have hit. File geodatabases are not an option. I could use SQL Server and attached databases if I splashed out for that. Linux based customers do not use SQL Server. PostGIS only has a crude dump. So sqlite looks ideal as a modern, compact, open, supported(!) exchange format for tables and featureclasses. Since spatialite (or geopackages) are being used for Esri Mobile applications this new 'personal' geodatabase format is gradually being supported. I have found spatialite much faster and more elegant for some operations. I switched to that format for a mirror of external data held in PostGIS. The replication has to be a 'homemade' workflow which is difficult to make robust but was easier if I also went with a similar database to PostGIS. Maybe I should have used PostGIS locally, but Sqlite is much faster and easier for a non-distributed purpose. I also found WFS unreliable so I went with CSV extracts using WKT for the geometry (on advice).
... View more
07-14-2016
02:50 PM
|
1
|
5
|
2049
|
|
POST
|
Using a SQL filter in the TableToTable tool fails in the same way.
... View more
07-14-2016
02:39 PM
|
0
|
0
|
2049
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-26-2025 03:48 PM | |
| 1 | 05-08-2025 02:07 PM | |
| 1 | 05-07-2025 05:13 PM | |
| 3 | 04-04-2025 03:16 PM | |
| 2 | 05-07-2025 05:21 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2025
06:39 PM
|