Vanuatu GIS Feed
banner
vanuatugis.bsky.social
Vanuatu GIS Feed
@vanuatugis.bsky.social
The Vanuatu GIS Feed will be used to aggregate site posts. It is monitored, but will probably not be very 'personal'. - @raetlomi.bsky.social
Technology Feed @vanuatutech.bsky.social.
231124
Not able to get Data Driven Pages to export to PDF using ArcPy
I am trying to export data driven pages using ArcPy. I can manually export the data driven pages into a PDF so it seems like it is set up correctly. I followed the script to export DDP on the Esri site, but I'm not having any luck. I'm sure it is something simple I am overlooking, but I have been playing around with this for hours and could use another set of eyes. Sometimes my script will run but nothing is produced. Most of the time I get this error: File "c:\program files (x86)\arcgis\desktop10.8\arcpy\arcpy\utils.py", line 182, in fn_ return fn(*args, **kw) File "c:\program files (x86)\arcgis\desktop10.8\arcpy\arcpy\utils.py", line 182, in fn_ return fn(*args, **kw) File "c:\program files (x86)\arcgis\desktop10.8\arcpy\arcpy_mapping.py", line 450, in exportToPDF return convertArcObjectToPythonObject(self._arc_object.exportToPDF(*gp_fixargs((out_pdf, page_range_type, page_range_string, multiple_files, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info, jpeg_compression_quality, show_selection_symbology), True))) AttributeError: PageLayoutObject: Error in exporting pages I had some code working at one point, but as soon as I switched to a different way of making the grid, it stopped working even though the grid is saved under the same name in the same location. I thought maybe it was the change in grid, but I went back and reran that code and it doesn't work anymore either. The only thing I can think of is I made a change in the .mxd template itself that is causing an issue. I don't think I altered the initial code at all before I saved it as a working version. Any thoughts on what I could try? import arcpy import os output = r"C:\Users\name\Desktop\junk\testing\test6" mxdpath = r"C:\Users\name\Desktop\junk\testing\test6\testing.mxd" tempmap = arcpy.mapping.MapDocument(mxdpath) tempddp = tempmap.dataDrivenPages temp_filename = os.path.join(output,"grid.pdf") if os.path.exists(temp_filename): os.remove(temp_filename) tempddp.exportToPDF(temp_filename,"ALL") Using information from this website https://support.esri.com/en/technical-article/000022852 I changed the code to the following: Output_Location = arcpy.GetParameterAsText(0) map_copy2 = os.path.join(Output_Location, "grids.mxd") mxd = arcpy.mapping.MapDocument(map_copy2) for pageNum in range(0, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum OutF = os.path.join(r"C:\Users\coburm1\Desktop\junk\testing\test20" ,str(pageNum) + ".pdf" ) arcpy.mapping.ExportToPDF(mxd, OutF) The second script will run without errors, but nothing is produced. If I run the second script in the python window in Arcmap, it will produce pdfs, however, each grid is an individual pdf so if I have an index with 250 squares, I get 250 pdfs. I need to figure out why it is not running as a stand alone script, and how to get it to produce one pdf with multiple pages instead of multiple pdfs.
gis.stackexchange.com
December 20, 2025 at 4:12 AM
Find duplicates and merge attributes arcpy
I have a point shapefile which has duplicate points based on an "ID". ID1 + permit1 + resources associated to permit ID1 + permit2 + resources associated to permit ID2 + permit1 + resources associated to permit etc. In my output I want 1 point for each ID but want to merge all associated permit and resources information for that one point into one row. I have found some helpful scripts online (credit specifically to Xander Bakker: https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/td-p/534281) on how to use search cursors, dictionaries, and update cursors to merge attributes into just one field (permits). However, I am struggling to adjust my script to also update additional fields (resources). Additionally, I think I need to create new fields with a greater character limit and populate those fields instead of the existing fields so I don't run into an issue with limited character spaces in the existing fields. See photos below for desired output. How do I manipulate and/or simplify my code to update not just one field but both fields (permit and resources)? Dictionaries are confusing! Current script (which is only updating the existing permit field): def main(): fc_in = intersect_output fc_out = r"D:\DRC\vector\intersect_output_clean.shp" fld_id = "ID" fld_permit = "Permit" sr = arcpy.Describe(fc_in).spatialReference # create empty output fc fc_ws, fc_name = os.path.split(fc_out) arcpy.CreateFeatureclass_management(fc_ws, fc_name, template=fc_in, spatial_reference=sr) # create dictionary with ID's to store related permits flds = (fld_id, fld_permit) dct = {} with arcpy.da.SearchCursor(fc_in, flds) as curs_in: for row_in in curs_in: p_id = row_in[0] p_permit = row_in[1] if p_id in dct: dct[p_id] += "+ {0}".format(p_permit) else: dct[p_id] = p_permit del row_in, curs_in # now do the update: flds = correctFieldList(arcpy.ListFields(fc_out)) with arcpy.da.InsertCursor(fc_out, flds) as curs_out: with arcpy.da.SearchCursor(fc_in, flds) as curs_in: for row_in in curs_in: lst_row = list(row_in) p_id = row_in[flds.index(fld_id)] if p_id in dct: permits = dct[p_id] lst_row[flds.index(fld_permit)] = permits tmp = dct.pop(p_id) curs_out.insertRow(tuple(lst_row)) def correctFieldList(flds): flds_use = ['Shape@'] fldtypes_not = ['Geometry', 'Guid', 'OID'] for fld in flds: if not fld.type in fldtypes_not: flds_use.append(fld.name) return flds_use if __name__ == '__main__': main()
gis.stackexchange.com
December 20, 2025 at 2:06 AM
FilterFactory2 overlaps/intersects
I am creating WPS for measuring area of two overlapping polygons. Its working fine but now I want to implement FilterFactory2 . I am not sure if use Overlap or Intersect method and than, how to feed data into the filter. I found some examples and this is how far i come String overlayPolygonsWithFilter() throws IOException { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); String areas = "Object : Area of overlay"; ShapefileDataStore sfds = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\chranene_uzemi_cr.shp")); SimpleFeatureSource fs = sfds.getFeatureSource(); ShapefileDataStore sfds2 = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\lesy_cr.shp")); SimpleFeatureSource fs2 = sfds2.getFeatureSource(); SimpleFeatureCollection sfc = DataUtilities.collection(fs.getFeatures()); SimpleFeatureCollection sfc2 = DataUtilities.collection(fs2.getFeatures()); ListFeatureCollection sfcList = new ListFeatureCollection(sfc); ListFeatureCollection sfcList2 = new ListFeatureCollection(sfc); SimpleFeatureIterator sfi = sfcList2.features(); double sum = 0; while (sfi.hasNext()) { SimpleFeature sf = sfi.next(); MultiPolygon mp2 = (MultiPolygon) sf.getDefaultGeometry(); Filter filter = ff.intersects(ff.property("THE_GEOM"), ff.literal(sf.getDefaultGeometry())); SimpleFeatureIterator sfi2 = sfc.subCollection(filter).features(); // TODO while using ListFeatureCollection, FAIL ON ROW BELOW //SimpleFeatureIterator sfi2 = sfcList.subCollection(filter).features(); Polygon p2 = (Polygon) mp2.getGeometryN(0); // TODO FAIL ON ROW BELOW while (sfi2.hasNext()) { SimpleFeature sf2 = sfi2.next(); MultiPolygon mp3 = (MultiPolygon) sf2.getDefaultGeometry(); Polygon p3 = (Polygon) mp3.getGeometryN(0); Geometry p4 = p2.intersection(mp2); if (p4.getArea() != 0) { sum += p4.getArea(); areas = areas + "\n" + p4.getArea()+ " : " + p2.getArea() + " : " + p3.getArea(); } } sfi2.close(); } sfi.close(); sfds.dispose(); sfds2.dispose(); return "Objects found: " + areas + "\nTotal sum: " + sum; } I commented rows where its failing. Exception in thread "main" java.util.ServiceConfigurationError: org.geotools.filter.expression.PropertyAccessorFactory: Provider org.geoserver.wps.property.ExecutionStatusAccessorFactory could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:232) at java.util.ServiceLoader.access$100(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at org.geotools.filter.expression.PropertyAccessors.(PropertyAccessors.java:51) at org.geotools.filter.AttributeExpressionImpl.evaluate(AttributeExpressionImpl.java:213) at org.geotools.filter.AttributeExpressionImpl.evaluate(AttributeExpressionImpl.java:189) at org.geotools.filter.GeometryFilterImpl.getGeometries(GeometryFilterImpl.java:108) at org.geotools.filter.GeometryFilterImpl.evaluate(GeometryFilterImpl.java:237) at org.geotools.data.store.FilteringFeatureIterator.hasNext(FilteringFeatureIterator.java:60) at cz.val0065.wps.Process.overlayPolygonsWithFilter(Process.java:129) at cz.val0065.wps.Main.main(Main.java:12) Caused by: java.lang.NoClassDefFoundError: org/geoserver/platform/ServiceException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.geoserver.wps.property.ExecutionStatusAccessorFactory.(ExecutionStatusAccessorFactory.java:19) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 10 more Caused by: java.lang.ClassNotFoundException: org.geoserver.platform.ServiceException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 29 more C:\Users\David\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)
gis.stackexchange.com
December 20, 2025 at 1:08 AM
New Content Highlighting Federal Spending Data
Federal Spending from USAspending.gov ArcGIS Living Atlas of the World now includes data from USAspending.gov, offering a detailed view of how federal dollars flow across the United States. New content, U.S. Federal Spending by Geography – 2025, allows users to visualize total aggregated spending for three levels of geography (state, congressional district, and county) for funds received in fiscal year 2025. The data is symbolized by the percentage of spending that each geography level received compared to the total national spending amount that was aggregated from the federal transactions for fiscal year 2025. This provides a initial pattern to see which regions received more funding, but users can dive deeper by exploring additional attributes like per capita spending. Spending By Federal Agency In addition to the total spending by geography, there are related tables integrated with the feature layers that provide insight into which federal agency contributed to funding. These values are also aggregated by total dollars awarded by a particular agency. Pop-ups for each geography level provide a ranking of the top 10 awarding federal agencies as well as other agencies outside the top tier. Potential Use Cases Leveraging this data in interactive maps and dashboards makes it easy to compare states and regions, uncover patterns, and integrate spending information with demographic or infrastructure layers for deeper context. These visualizations enhance situational awareness and support informed decision-making for policymakers and planners, who can quickly identify funding concentrations and agency priorities. Local governments and nonprofits can use these insights to advocate for underserved areas, while researchers can analyze economic impacts and trends across the country. In the future, adding additional years of spending data could reveal even more patterns and trends about where money is being allocated across the country. Layers and Maps Take a look at a couple of maps started for inspiration! Laura Phoebus Laura is a Product Engineer on ArcGIS Living Atlas of the World's Policy Maps team. She is passionate about climate science, human geography, and can only function with a good cup of coffee (or three).
www.esri.com
December 19, 2025 at 10:21 PM
Couldn't load qgis.user
On Microsoft Windows 11 Enterprise Multi session using fslogix 25.04 when I am logging in using an fslogix account and attempting to launch QGIS 3.40.6 it is advising the following error: Couldn't load qgis.user. Python support will be disabled. Traceback (most recent call last): File "", line 1, in File "C:\PROGRA~1/QGIS34~1.6/apps/qgis-ltr/./python\qgis\utils.py", line 1100, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1/QGIS34~1.6/apps/qgis-ltr/./python\qgis\user.py", line 97, in os.makedirs(expressionspath) File "", line 225, in makedirs FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:/Users/Test/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python\\expressions' Python version: 3.12.10 (main, Apr 9 2025, 08:14:47) [MSC v.1943 64 bit (AMD64)] QGIS version: 3.40.6-Bratislava 'Bratislava', 5d7f6a3e26 Python path: ['C:/PROGRA~1/QGIS34~1.6/apps/qgis-ltr/./python', 'C:/Users/Test/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 'C:/Users/Test/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 'C:/PROGRA~1/QGIS34~1.6/apps/qgis-ltr/./python/plugins', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\grass\\grass84\\etc\\python', 'C:\\WINDOWS\\system32', 'C:\\Program Files\\QGIS 3.40.6\\bin\\python312.zip', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\DLLs', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\Lib', 'C:\\Program Files\\QGIS 3.40.6\\bin', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\Lib\\site-packages', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\Lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\Lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGIS34~1.6\\apps\\Python312\\Lib\\site-packages\\Pythonwin', 'C:/Users/Test/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python'] If I remove the Expressions folder this recreates its self and then can launch but this repeats its self with the same error when trying to launch qgis again. Running qgis as an administrator allows me to launch qgis I was prior using 3.34.10 but this also had the same issue, this issue is affecting multiple servers and fslogix profiles I have fully uninstalled QGIS and reinstalled QGIS but with no luck
gis.stackexchange.com
December 19, 2025 at 10:07 PM