texts: GeoServer with SQL server consuming all my CPU

texts:
This question is long please bear me and my problem.
SQL Server Query profiler
The Sample Query from profiler that GeoServer is running that corresponds to SLD I am using and not the SQL SERVER view I am using is:

SELECT "siteId","Vendor",CAST("SP_GEOMETRY".STSrid as VARCHAR) + ':'
+ "SP_GEOMETRY".STAsText() as "SP_GEOMETRY" FROM "Data"."sites"
WHERE ("SP_GEOMETRY".Filter(geometry::STGeomFromText
('POLYGON ((80.12878722280502 28.280198584198256,
    80.12878722280502 29.559126104578176, 81.58996886322707
 `29.559126104578176, 81.58996886322707 28.280198584198256,
 80.12878722280502 28.280198584198256))', 4326)) =
1 AND ( UPPER("Vendor") LIKE 'A%'  OR  UPPER("Vendor") LIKE 'B%' ))`

I have used JavaScript as suggested by this to redraw pages at 5 minutes interval. It shows 100% CPU utilization when layer is refreshed.
IF I open multiple pages then page just gets locked.

I have Computer with following configuration used for GeoServer, SQL Server and Apache Tomcat.   The person who was using it until I demonstrated my project was only me but when I ran this only with 5 person the page just hang(chrome browser) and same thing is happening when I open 5-6 window with same address. I am using GeoServer WMS layer with OpenLayers and Google Maps. The Google map loads very fast but my layer loads very slow 1/2 min. The zooming takes similar time. I have used JAI and all for GeoServer. Database is indexed and the query takes 0 ms when I do it from SSMS. The GeoServer is deployed inside Tomcat and data directory is outside the war. I have problem accessing only map pages and believe the memory requirement is more for maps but I am unable to find actual problem.
SQL Server is actually consuming most of the CPU and Tomcat is consuming most of the memory.

The task manager shows following usage:

The perfmon shows following usage:


texts: Google Earth Engine: undefined value conversion


texts: Projecting urban political boundary files onto U.S. Census blocks QGIS -- Cannot get them to map correctly

texts:
I am trying to project cities' political boundaries (each city is its own shapefile) over a national Census geography layer of Census block groups in QGIS. I know reprojection questions have been answered ad nauseum here regarding how to set the CRS for a project and for each shapefile therein. I have followed all of those directions and have set the CRS appropriately as far as I can tell, but every time I try build my map, my city geographies wind up in a tiny speck of space somewhere in (I think) Oklahoma. The desired (and applied) CRS for all files and the project is WGS 84 EPSG:4326.

Example files causing issues:
New York City: https://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/nycc_20a.zip
Austin, Texas: https://data.austintexas.gov/Locations-and-Maps/Council-Districts-Fill/hdpc-ysmz
NHGIS Block Group file can be obtained at https://www.nhgis.org/. (I don't believe I'm permitted to reproduce or share the file, but it's publicly accessible.)

EDIT w/ SOLUTION:
The problem was apparently caused by manipulations I'd done to the city-level files, creating intersections which I was then trying to project onto the national map. Re-downloading the original files, placing them as raw QGIS layers in a new project, and setting the project CRS to WGS 84 EPSG:4326 solved the problem.


texts:
I want to intersect contours with polygon like in the image below. But I got this error:

Warnings:
GEOS geoprocessing error: One or more input features have invalid geometry.
Some output geometries may be missing or invalid.

I don't know what's wrong with my geometries. I even don't know, where to search. I tested it also with a simple single-line. Same thing happened.
The result: a empty shapefile

What should I do now? Where can I expect an invalid geometry? Or is it because of the shapefile (OGR ESRI)? Please help!


texts: Adding feature names to coded value list for domain using ArcGIS Desktop?

texts:
I've got two feature classes, "Points" and "Lines", the first is a feature point class, the other is a line class. I've got a coded value domain field for the "Points" class, that I'd like to add the names of the "Lines" features to as I add more "Lines" features.

Ex. If there were two line features on the "Lines" layer named "Line1" and "Line2", and a point feature on the "Points" layer named "Point1", I'd like the "Pick a Line" domain field for "Point1" to contain "Line1" and "Line2". If I were to add a "Line3" to the "Lines" layer, I'd like "Pick a Line" to now contain "Line3".

Would I need ArcPy to accomplish this, or is this already doable?

Would it be easier to set up a "relationship" between the two layers?


texts:
I have been using a publicly available tool in ArcGIS called SPreAD-GIS. It is a series of python scripts that are "implemented as an ArcGIS toolbox" (with tbx file).

I am new to QGIS.

Is there a way to incorporate and use SPreAD-GIS in QGIS?


texts: Rasterizing lines with “gdal_rasterize” in R return no result and status 1

texts:
I am using gdal_rasterize in the gdalUtils package to convert lines in a Shapefile to a raster.

library(gdalUtils)
src <- "D:/Test/sample.shp"
dst <- "D:/Test/raster.tif"
raster <- gdal_rasterize(src,dst, tr = c(20,20), verbose = T)

The function runs and returns a warning "had status 1" and no raster is produced in the destination folder.

Checking gdal_installation...
GDAL command being used: "D:\Program Files\QGIS 2.18\bin\gdal_rasterize.exe" -tr 20 20 "D:/Test/sample.shp" "D:/Test/raster.tif"
Warning message:
running command '"D:\Program Files\QGIS 2.18\bin\gdal_rasterize.exe" -tr 20 20 "D:/Test/sample.shp" "D:/Test/raster.tif"' had status 1

Am I missing something? This seems like it should be very simple


texts: Why am I getting this error when importing a GDB into QGIS?

texts:
I've downloaded the Lunar geology data from USGS here:

https://astrogeology.usgs.gov/search/map/Moon/Geology/Unified_Geologic_Map_of_the_Moon_GIS

While the topography is in ESRI Shapefile format and works just fine in QGIS 3.12, the annotations are in GDB format. When I try and add this as via New Vector Layer > Directory with OpenFileGDB type, I get the following error:

Invalid Data Source: /GIS/Unified_Geologic_Map_of_the_Moon_GIS/Lunar_GIS/LunarAnnoGeodatabase_08-14-2013.gdb is not a valid or recognized data source.

Any ideas?


texts: Cloudmade geocoding API: what are the volume limitations?

texts:
I'm trying to understand the TOS of the Cloudmade's Geocoding API, but it's not very clear.

It says in section 6:

  use CloudMade APIs in a manner that exceeds request volumes that are set by CloudMade in its sole discretion and published to CloudMade’s website at www.cloudmade.com.

Unfortunately I can't find it anywhere on their website (page on geocoding API).


texts: Sun glints and landsat 8 surface reflectance product

texts:
I was wondering if the Landsat 8 surface reflectance product needs to be corrected for sun glints if I want to use it for atmospheric correction over water surfaces.

I'm actually working on satellited derived bathymetry and I'm using Hedley's 2009 approach for sun glint correction. Just wanted to be sure I still have to deglint Landsat SR products.


texts: how to calculate distance in sub pixel mapping from Atkinson's paper?

texts:
Condition from atkindon's paper http://info.asprs.org/publications/pers/2005journal/july/2005_july_839-846.pdf

for every sub-pixel the attractiveness Ai of a pixel
i is predicted as a distance-weighted function of its j  1,2,
. . . , J neighbors:

A(i)= sum (j=1 to J) { lambda(i,j)*z(x(j))}

where z(x(j)) is the (binary) class of the jth pixel at location x(j),
and lambda(i,j) is a distance-dependent weight predicted as:

lambda(i,j)= exp(-h(i,j)/a)

where h(i,j) is the distance between the location x(i) of pixel i
for which the attractiveness is desired, the location x(j) of a
neighboring pixel j, and "a" is the non-linear parameter of the
exponential model.

My question is how to calculate h(i,j) and what is going to be the input for x(i) and x(j), the things I know as input are the class labels of the subpixels but how to calculate distance using them.

As in my case x(i) can be 1 as class label and x(j) can be 2. till now I am able to randomly fill the subpixel classes in a finer grid.


texts: I have a large number of small tiles merged into a single VRT. The rasters are only viewed at large scale, so only a few of them are visible at the same time. The map refresh in qgis is slowing down however, as the number of tiles in the vrt increases. Is there any indexing of raster possible in the vrt format itself or perhaps inside pyqgis (manipulating the raster layer that links to my .vrt).


texts: Automatic cleaning of polygon overlap based on attribute in QGIS

texts:
I have a shapefile with overlapping polygons. I need to clean these overlaps based on an attribute: in case of polygon overlap, the polygon with the lowest value of a given attribute needs to be clipped, while the polygon with the highest value of attribute remains the same. Any idea?

Ideally I'm searching for an automated solution with a plugin or a script. However my dataset is not really big (around 20 shp with about 50 features each and three different values of the attribute; no need to clear overlap between different shps), so manual work would also be ok, but which tool would be the most efficient in this case?

PS: this question could be a possible solution, but I don't have access to arcGIS.


texts: Geoserver styles - changed feature icon on mouse over

texts:
I am using OpenGeo and OpenLayers 3. I managed to set a WMS layer from PostGis (Configure new SQL view) where I show points from coordinates I have in database.
I also managed (following tutorial on docs.geoserver) to set the custom icon as graphic.

The next step is that this graphic icon changed on mouse over. I understand, that only image is transferred to client from GeoServer since I am using WMS. But there must be a way to do that. Is it? I think I must use WFS, but maybe I am wrong. What then? There are not plenty examples for OpenLayers3.

Icon style:

   <FeatureTypeStyle>
     <Rule>
       <PointSymbolizer>
         <Graphic>
           <ExternalGraphic>
             <OnlineResource
               xlink:type="simple"
               xlink:href="image.png" />
             <Format>image/png</Format>
           </ExternalGraphic>
           <Size>32</Size>
         </Graphic>
       </PointSymbolizer>
     </Rule>
   </FeatureTypeStyle>


texts:
I've got a rather large MySQL database containing polygons (coordinates) and their additional properties (e. g. text labels in different languages). I would like to use PHP to connect to my database in order to build GeoJSON polygons on demand to show in Openlayers (e. g. like here). My database structure allows for filtering them by their position so as to load only the necessary ones.

In an earlier version of my application, I used to use Leaflet and XAMPP for testing it locally before uploading it to a "real" web server. Now, with Openlayers I'm using npm as recommended (which might indeed come in handy if I need to use additional packages).  However, doing so, I'm failing with something as simple as loading a php file. I've got XAMPP running, I have started my application using npm start and try to run an AJAX request in my code.

That simple AJAX request (using jQuery) won't work:

  $.ajax({
        type: "POST",
        url: "./php/labels.php",
        data: {extent, resolution},
        dataType: 'json',
        success: function(output) {
          console.log("success");
        },
        error: function() {
         console.log("error");
        }
    });

This outputs the error message and I get jQuery reporting it could not find the php file. Do I have to use some additional package for node.js in order to be able to do that request at all? To me, that seems to be a bit redundant because when I put my code on the "real" web server (using the files from the dist folder), I expect it can directly communicate with the php files without using node.js. So, apparently node is only needed for the process but not for the end product. Or am I understanding this wrong?

I'm sorry if this is not a very clever question but I'm a beginner with npm and can't really wrap my head around how it works.


texts: Reclassifying raster data that falls within polygon using ArcGIS Desktop?

texts:
Thansk I'm using ArcGIS 10.

My task is to map forest cover with the image classification tool. The problem is some of the patches of forest are dark and are been classified as cloud shadows in the image classification. I need to convert raster values that represent cloud shadows into the raster value for forests. But only only want to do this for an area that falls within in a polygon.

Is there way to reclassify a raster but only the cells that fall within a polygon?


texts: Connecting output feature class to newly created geodatabase in ModelBuilder?

texts:
I need the 'New Feature' output to be located in the '1_ExportedFromS" GDB. I cannot get these 2 to "connect" as every time I do so I get an error stating "can only connect a variable to a process."

What type of variable do I need?

The '1_ExportedFromS' GDB is not created until the model has ran, so I cannot enter that path.


texts: Display full directory in ArcMap (10) recent file list in File Menu?

texts:
thought this would be a pretty basic question, but I haven't found anything here or on the ESRI forums on the topic.

Is there any way to change the number of characters displayed for the file pathways listed in the File Menu list of recently used mxd files?

The obvious solution is to create shorter file names, but sometimes that's not as easy you might think!

Hover-over functionality for that list would be an ideal, long-term solution that I'd like to see, but that's neither here nor there...

Thanks!


texts: Identifying activity places in GPS trajectories using R?

texts:
Is there a way in R (a script or package) that would allow identifying activity spots in GPS tracking data?

I have a number of GPS tracks in GPX/CSV formats that follow the movements of people in a city during a day. I would like to identify locations where a person stays longer (stays or walks around a small area - a cluster of trackpoints like the one in the image attached), count these locations, and estimate the time spent in each.

So far I have checked some packages, such as trip and move, etc, but they did not seem to offer this possibility

I think, density-based clustering might be the best approach


texts: Create temporary files as intermediate output to be used as input in concatenation

texts:
Q_PART_I

I need to merge many (MANY) tables in one unique output table by means of the arcpy.Merge_management. Anyway, I'd like to avoid the creation of tons of intermediate files as my script running, having only my final big table rather than a number of "mini-table" for each file I have. I'm converting raster attribute table to table views (by arcpy.TableToTable_conversion), and then using them to run the Merge.
How can I avoid having a table for each raster in the intermediate process?
Hope someone could help me. I've been reading something about the creation of an InMemoryWorkspace, but I couln'd manage it so far.

Q_PART_II

Ok, I tried both Your suggestions, but so far I couldn't make it.
It seems the Merge function cannot recognize the temporary files as input.
Infact, I receive this error:
    ERROR 000735: Input Datasets: Value is required
    Failed to execute (Merge)
Here is my script (the important part is at the end, I can always avoiding this problem by simply having a lot of files, but I'd prefer to be more "clean"):

#import relevant modules, create geoprocessing dispatch object
import win32com.client, sys, string, os, arcpy

gp = win32com.client.Dispatch("esriGeoprocessing.gpDispatch.1")

# Remember to change this to wherever your files are stored
gp.workspace = 'G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\ATTRIBUTE_TABLE'
# Remember to change the path to point where you want to store the final tables
out_dir = 'G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\ATTRIBUTE_TABLE'

try:
    rasters = gp.ListRasters("*", "all")
    rasters.reset()
    rst = rasters.Next()

    while rst:
        # Create the new field
        gp.AddField_management (rst, "FILENAME", "text", "", "", "50")

        # Apply the filename to all entries
        gp.CalculateField_management (rst, "FILENAME", '"' + rst + '"')
        rst = rasters.Next()

except:
    print gp.GetMessages ()

listRaster = arcpy.ListRasters ()

# Create a table view from each raster to be used as input for the next Merge function:
for raster in listRaster:
    arcpy.TableToTable_conversion (raster, "in_memory", 'Tab_'+ raster)

listTable = arcpy.ListTables ()

# Change the name of the output table as needed!!!
arcpy.Merge_management (listTable, 'Cl_Rio_Aconcagua.dbf')


texts: Improve gdaldem hillshade output (lighten up flat parts)

texts:
I have a hill-shading that I made using gdaldem hillshade which is already pretty good. I used the option -alt 60 to get nice contrast, but the problem is, that with lowering the light-source, also parts in the valley that are quite flat, are not really bright (white).

How could I improve that? I've seen that gdaldem hillshade doesn't have many options.

What other program could I use to improve that? I'd like to say for example: Everything below 20% incline should be a bit lighter.


texts: MODIS HEG tool - integerized_sinusoidal projection not supported in swtif for MOD021KM

texts:
I tried to use the swtif command line in HEG tool to convert the MOD021KM swath to standard sinusoidal grid.
Since the standard sinusoidal projection is not supported in the version of 2.5, I used the INTEGERIZED_SINUSOIDAL projection but failed and got the error message: "Projection INTEGERIZED_SINUSOIDAL is not supported".
root@CentOS:mod021km# swtif -P hdf2tif.prm
===  Parameter file input variables ====
  ...INPUT_FILENAME:            MOD021KM.A2019182.0440.061.2019182130914.hdf
  ...OBJECT_NAME:               MODIS_SWATH_Type_L1B
  ...FIELD_NAME:                EV_500_Aggr1km_RefSB
  ...upper left(lat):           0.000000
  ...upper left(lon):           0.000000
  ...lower right(lat):          0.000000
  ...lower right(lon):          0.000000
  ...OUTPUT_PROJECTION_TYPE:    INTEGERIZED_SINUSOIDAL
  ...Output Ellipsoid Code      WGS84=12
  ...OUTPUT_PROJECTION_PARAMETERS: (
  6378137.000000  6356752.314245  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  )
  ...OUTPUT_PIXEL_SIZE_X:       0.000000
  ...OUTPUT_PIXEL_SIZE_Y:       0.000000
  ...OUTPUT_FILENAME:           MOD021KM.A2019182.0440.061.2019182130914.SIN.tif
  ...OUTPUT_TYPE:               GEO

 Detected ? at the end of /mnt/f/modis/mod021km/filetable.temp_27797 in try #1. No problem with this file.
Error: Projection INTEGERIZED_SINUSOIDAL is not supported.
Encountered a problem, Exiting.
***********************************************

I also tried other projections like ISIN and GEOGRAPHIC, they were also not supported. However, the UTM projection seemed to work well for the conversion. My usage information is as follows:

List item
HEG version: v2.15 (hegLNX64v2.15.Build9.8.tar.gz)
platform: Linux (CentOS-7) (on WSL)
Data Product: MOD021KM
Operation: swtif, convert the swath data to standard sinusodial grid, with output format type of HDF
parameters file:

NUM_RUNS = 1

BEGIN
INPUT_FILENAME = MOD021KM.A2019182.0440.061.2019182130914.hdf
OBJECT_NAME = MODIS_SWATH_Type_L1B
FIELD_NAME = EV_500_Aggr1km_RefSB|
BAND_NUMBER = 1
# OUTPUT_PIXEL_SIZE_X = 15.0
# OUTPUT_PIXEL_SIZE_Y = 15.0
# SPATIAL_SUBSET_UL_CORNER = ( 43.957176 -100.096085 )
# SPATIAL_SUBSET_LR_CORNER = ( 43.26889 -99.035063 )
# RESAMPLING_TYPE = NN
OUTPUT_PROJECTION_TYPE = UTM
ELLIPSOID_CODE = WGS84
OUTPUT_PROJECTION_PARAMETERS = ( 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 )
OUTPUT_FILENAME = MOD021KM.A2019182.0440.061.2019182130914.SIN.tif
OUTPUT_TYPE = GEO
END

I want to use the projection of MODIS standard SINUSOIDAL not the INTEGERIZED_SINUSOIDAL, so I was thinking to use previous HEG release like v2.13 or 2.14, but the download link is unavailable on the website (https://wiki.earthdata.nasa.gov/pages/viewpage.action?pageId=170800768).
Could you give me some advice on how to convert the swath to sinusoidal grid correctly by the HEG tool?


texts: Automate multiple repetitive ArcGIS 10.2 Table Relates?

texts:
I have a situation where multiple users will be creating many file gdb's in ArcGIS 10.2 using just the basic license.  The data format is standardized and will have a feature layer with point data and a set number of fields and then many pre-generated tables of data that summarize the points.  For example a table with counts for a specific field value, or counts for a specific category of data based on a field in the points layer.  The current workflow is then to manually create table relates so that the user can highlight summary data and then have that highlight the relevant records in the points data.

As the data will always have the same fields (only the data changes) and the summaries will always be the same I'd like to automate the building of the table relates instead of the user having to go in and do them all by hand.  The desired result being that the user gets that interactive selection that comes with a table relate.

After looking around for possible solutions I've found several that are similar...for example using joins, or using the Make Table View to 'relate' data...but none of them address the interactive selection piece which is what I want.

This is the Basic License so Relationship Classes in the gdb are not an option.  It looks like ArcGIS Pro adds the functionality in ArcPy as arcpy.AddRelate_management but that same feature is not available in 10.2.

I'm open to ArcPy, the ModelBuilder or some other solution.


texts: OpenLayers 3 - Adding layer with administrative labels and borders

texts:
I am in the process of migrating a website from the Google Maps API to OpenLayers 3.

This site shows a map with custom tiles and administrative labels and borders on top of them (country/region/city limits and names). This uses a transparent overlay, where features are selected using a Google Maps styled map (i.e. leaving the roads and labels on, but disabling the terrain features).

I have tried selecting an OpenStreetMaps layer as an overlay (transparent: true, opaque: false), but the OSM layer fully occludes the custom layer below. Only the labels and borders should be visible in this layer.

So far, the options I have found are:

Create a custom layer styling OSM data. As I understand, in case of OSM this is not something I can request dynamically from the OSM website (as it is the case with Google's Styled Maps); I would need to prepare data and serve it from my own web server (which is already at the limit of the number of files allowed).
CartoDB offers 2 layers with only labels: https://cartodb.com/basemaps, with basemap names "light_only_labels" and "dark_only_labels". Whereas this is close to solution, these layers are missing the administrative borders (countries, regions, etc).
Embed a Google Maps layer on top of the map, using https://github.com/mapgears/ol3-google-maps
Overlay a vector layer over the map. I have seen an example at http://openlayers.org/en/v3.2.1/examples/image-vector-layer.html , but the result is too simple, only containing some minor detail of countries, but no regions, cities, names, etc.

Are there other ways to overlay administrative labels and limits on top of a custom map, using OpenLayers 3?


texts:
I have a problem with osm2pgsql when it runs in a qgis plugin. The function i use looks like this:

    osm2pgsql = "osm2pgsql -s -d {databaseName} -U {databaseUser} -H {databaseHost} -E {SRID_GEOMETRY} {osm_file}"\
        .format(databaseName=connParam[0],
                databaseUser=connParam[2],
                databaseHost=connParam[1],
                SRID_GEOMETRY=srid,
                osm_file=down_file)

    os.system(osm2pgsql)

When i run this function in the python console in QGIS it runs without a problem. But when this function is used in a plugin it doesent't work. The osm2pgsql function starts with the console output

 Using projection SRS 32632 (EPSG:32632)
 Setting up table: planet_osm_point

but then nothing happens and qgis freezes. When I close qgis the function starts running and finishes successfully.

Has anyone an idea why this happens?


texts: Opening a shapefile with roads, how to display the road names?

texts:
I am using

((AxMapControl)myMap.AddShapeFile( directory, shapeFileName)

To display a shapefile which has road data.  Now the roads display properly, but the road names aren't displaying.  How can I turn on the roads?

I don't need exact instructions just point me in the right direction please. I'm sorry this is such a novice question.  I'm using ArcEngine 2010 and C#.


texts: Predicting in advance which is the best interpolation method for my data

texts:
I need to interpolate in ArcGIS 10.1 soil data (organic matter content, nutrient content, pH, etc.) from a set of soil sampling points to the surface which this set of points lays on.

I am considering Kriging or Inverse Distance Weighted.

I guess that using the Geostatistical wizard (in the Geostatistical Analyst toolbar) is the best option since the wizard has “Optimize the entire model” and “Optimize power value” buttons for respectively both interpolation methods.
But I have seen that for certain attributes or values to interpolate, it can be obtained a lower RMS by Kriging than by IDW, and on the contrary for other attributes.

How to know in advance which method gives better interpolation result (lower RMS –or any other quality indicator-)? Or, on the contrary, is it necessary to achieve it by trying to change as many different parameters of both methods as possible?


texts: How can I create an AddIn to ArcGIS Pro and where can I find it from ArcGIS Pro application?


texts: Leaflet draw - Edit event after editing existing feature

texts:
I was inspired by this post
How to edit an existing layer using leaflet? I can click on an item to make it editable.
But this does not "activate" the drawControl to allow me to click save or cancel, so I have not found out how I can catch an "edited" event to store the updated feature to my db?

Is there a way I can toggle the edit function for the drawControl to utilize the save/cancel after I manually made a layer editable?

onEachFeature: function (feature, layer) {
    layer.on('click', function(e){
                if(selectedFeature)
                     selectedFeature.editing.disable();
                selectedFeature = e.target;
                e.target.editing.enable();
           });

As noted by TomazicM. drawnItems.addLayer(e.target); need to go inside the onEachFeature function.

To make the save/cancel option to show up I faked a button click on the edit button. document.querySelector(".leaflet-draw-edit-edit").click(); To fake a click on cancel button document.querySelector("ul li:last-child a").click();


texts: Elevation contours from .JP2 / .J2W files?

texts: Is there a way in ArcGIS, Global Mapper, or CAD to generate elevation contours or any sort of surface data from a .JP2 file? I've never been provided this format before and our client is telling us this is a full LiDAR dataset. Can someone shed some light on this for me?


texts:
In QGIS 1.9.0 Master, when you right click on a raster in the Layers Panel and select "Save As", you can select the output mode to be "Raw Data" or "Renedered Image".

When selecting the Rendered Image option is saves the raster with the layers current styling. How would I do this via the python console? I am able to script gdal_translate, however I am not sure how to preserve the current styling for the layer.


texts: Equidistant projection for northern Delaware

texts:
I'm just getting started on a long-term project involving northern Delaware.  Most of my distances will use great circle distances from the lat/lon, but for a few applications I'll wind up using standard distance functions (e.g. gDistance from rgeos).  I'd like to pick an equidistant projection centered in this area (say, on Lat +39.7033053 Lon -075.6867863).  The distances involved are small (about 15 mile radius), so it's not critical, but it would be nice to not be using a grossly inappropriate projection.

Can I take something like the USA Contiguous Equidistant Conic and re-center it on that point, or is there a better projection for small-area analysis?  If the former, how do I do it and get a proj4string at the end?


texts: QGIS 3.0 (from OSGeo4W Installer) unusable on HiRes Displays?

texts:
Just installed QGIS 3.0 from OSGeo4W Network installer on a 13'' convertible notebook with 3200x1800 resolution (Win10) and it looks like this (toolbars and menu bar cover nearly half the display height, default icon size 24, default font size 8pt):

It is absolutely unusable, and I wonder why the 2.99.0-301 (installed exactly the same way) from last week looked totally normal.

Do I miss something?

cp. https://issues.qgis.org/issues/18246


texts: Is it possible publishing a Python Add-in in a web service?

texts:
I'm trying to make a multiuser web service for editing an ArcSDE geodatabase.
I wanted to know if I can to add my python add-in in Arcgis Server? And if the answer is yes, how can I publish it?


texts: ArcGIS 10 - Text background not showing up when exporting

texts:
I have highways labeled with the standard shield and route number on it. For my main data frame the labels come up correctly. I also have 4 inset maps where only the number will show up, not the shield when exporting to a file (any type).

Here are some things that I tried that did not work:

Exporting the labels to annotation
Creating replacement graphics (in each inset's data frame view)
For each of the above, using .png background instead of .emf

The only solution that seems to work is creating graphics as part of the document itself and overlaying those on top of the inset. This is very bad practise however and the graphics will not pan with the inset.

Just to clarify, the shields (text background) shows up in the layout screen when editing the map but not in the exported product after exporting the map to a .pdf or other extension.

The version of ArcGIS being used is 10.1 SP1. I cannot upgrade or change the installation.

Suggestions tried:

Deleting the main dataframe, then exporting - same result
Moving the inset dataframe to a new document

UPDATE:

It appears that ArcGIS will hide (or not draw) background symbols that are smaller than a certain size compared to the map (% or ratio). When I made the print size smaller (it was originally 34x40 inches) or the symbols larger, the shields showed up.

Does anyone know how to change this option on ArcGIS and possibly show all symbols regardless of size?

Following comment suggestions, the links provided in this forum post did not help.

http://support.esri.com/en/knowledgebase/techarticles/detail/28548
http://support.esri.com/en/knowledgebase/techarticles/detail/30753
http://forums.esri.com/Thread.asp?c=93&f=1731&t=235317
http://forums.esri.com/Thread.asp?c=93&f=1731&t=178684
http://support.esri.com/en/knowledgebase/techarticles/detail/17783

However, following the last link showed that the exported EMF file was not correct, signaling that "the problem exists within ArcMap, usually in converting the elements drawn in the map to the EMF format."


texts: Implementing PostgreSQL extension using PostGIS types?

texts:
I would like to create a new data type for PostgreSQL/PostGIS, but I have some difficulties. Here's what I've done so far:

/* PostgreSQL */
#include <postgres.h>
#include <liblwgeom.h>
#include <lwgeom_pg.h>
#include <utils/timestamp.h>

struct trajectory_elem
{
  Timestamp time_obj;
  LWGEOM *geom_elem;       /* Geometry Object - */
};

#define DatumGetTrajectoryElem(X)      ((struct trajectory_elem*) PG_DETOAST_DATUM(X))
#define PG_GETARG_TRAJECTELEM_TYPE_P(n)  DatumGetTrajectoryElem(PG_GETARG_DATUM(n))
#define PG_RETURN_TRAJECTELEM_TYPE_P(x)  PG_RETURN_POINTER(x)

extern Datum create_trajectory_elem(PG_FUNCTION_ARGS);
extern Datum trajectory_elem_in(PG_FUNCTION_ARGS);
extern Datum trajectory_elem_out(PG_FUNCTION_ARGS);

.....
PG_FUNCTION_INFO_V1(create_trajectory_elem);

Datum
create_trajectory_elem(PG_FUNCTION_ARGS)
{
  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);

  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);

  Timestamp timestamp = PG_GETARG_TIMESTAMP(1);

  struct trajectory_elem *trje = (struct trajectory_elem *) palloc(sizeof(struct trajectory_elem));

  elog(NOTICE, "trajectory_elem called");

  /*|| lwgeom->type != POINTTYPE || lwgeom->type != POLYGONTYPE*/
  if (lwgeom_is_empty(lwgeom) || lwgeom->type != POINTTYPE)
  {
    elog(NOTICE, "trajectory_elem is NULL, or type is not correct");
    PG_RETURN_NULL();
  }

  trje->lwgeom = lwgeom;

  if(trje->lwgeom->type == POINTTYPE){
    elog(NOTICE, "eh ponto");
  }

  trje->time_obj = timestamp;

  elog(NOTICE, "trajectory_elem finish");

  PG_RETURN_TRAJECTELEM_TYPE_P(trje);

 }

Is the way I'm creating my trajectory_elem structure correct?

Can I simply point to the LWGEO type?
Or.. Should I create a new type like the GSERIALIZED ?

How would the input and output functions for this type be?
Could I use the functions already implemented by PostGIS and lwgeom?

I tested some implementations for the I / O functions but when it arrives in PG_RETURN_TRAJECTELEM_TYPE_P (create_trajectory_elem function), the server drops. So they were probably wrong ?


texts: ArcObjects table views or SQLite3 in Python?

texts:
Given a larger csv (1000+ points) with attributes, I need to do both attribute and spatial queries on the data. Would it be faster to read the points into an xy feature class, and do the spatial and data queries as table views and feature layers, or would it be faster to read the csv into a temporary SQLite3 database, do the data queries, then transform the output into an xy class to do the spatial queries?

Also, would it be faster one way or the other if we also needed to include table joins?  Lastly, if you have any alternate methods please add them.


texts:
I am new to GIS technolgies.
I'm working on the final project of my career.

I need to have a background map of somewhere on this map I need to create 1 .. N layers in which a particular user can add, modify or delete information.
I was able to create layers, and I was able to add or delete information about these.
But I can not change information on the layers.
By modified I mean move a point or polygon

My code is like this.

var objectListCustomLayer = jQuery.parseJSON(listCustomLayer);
for (var i=0; i < objectListCustomLayer.length; i++){
    var item = objectListCustomLayer[i];
    loadCustomLayers(item.nameLayerkey,item.layerkml,item.layerForm);
}

the objectListCustomLayer take info from server and have information over the layers.
and here call the loadCustomLayers...

function loadCustomLayers(name,customKml,customForm){
    var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
    renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;

customLayer = new OpenLayers.Layer.Vector(name,renderer);

var info = new infoCustomLayer(customLayer.id,customForm,customLayer);
vectorCustomLayer.push(info);

map.addLayer(customLayer);

deserialize(customKml,customLayer);

var drag = new OpenLayers.Control.DragFeature(customLayer,{ onStart: startDrag});
var select = new OpenLayers.Control.SelectFeature(customLayer, {box: true, multiple: true,onSelect: addSelected,onUnselect: clearSelected});

var drawOptionsPoint = {
    callbacks : {"done": doneHandlerPoint,
                "point": pointHandlerPoint
                 },
    };

var drawOptionsPath = {
    callbacks : {"done": doneHandlerPath},
    };

var drawOptionsPolygon = {
    callbacks : {"done": doneHandlerPolygon},
    };

controls = {
    point:  new OpenLayers.Control.DrawFeature(customLayer,OpenLayers.Handler.Point,drawOptionsPoint),
    line:   new OpenLayers.Control.DrawFeature(customLayer,OpenLayers.Handler.Path,drawOptionsPath),
    polygon:new OpenLayers.Control.DrawFeature(customLayer,OpenLayers.Handler.Polygon,drawOptionsPolygon),
    drag:   new OpenLayers.Control.DragFeature(customLayer,{ onStart: startDrag}),
    select: select
    };

for(var key in controls) {
            map.addControl(controls[key]);
        }

}

The function loadCustomLayers is call N times.
My problem is when I select OpenLayers.Control.DragFeature this works over one layer, but does not work over the layer selected by me.

controls[key] is a vector that stores the name of the controls, is used by a call for a javascript event that allows me to indicate what to do (draw, select or drag) on a given layer.


texts: QGIS: LIKE-comparison with wildcard between value from table and value from atlas_feature for filtering an attribute table

texts:
I am trying to filter an attribute table in QGIS Print Composer based on the current active atlas feature:

I have a table with an "id" column with and some records that have these values in the "id" column:

048-
048-1
048-2
048-2i
048-2ii

My current atlas feature is 048-2 (i.e. @atlas_feature, 'ref' evaluates to "048-2")

I'd like the table to filter (show) only the records that contain "048-2" and may contain more characters after it, so it should filter to this:

048-2
048-2i
048-2ii

If I use the expression:

"id" LIKE attribute ( @atlas_feature, 'ref' )

I only get "048-2" which makes sense.

Filtering by

"id"  LIKE  '048-2%'

gets the results I need.

But how can I filter this table according to my need by using attribute ( @atlas_feature, 'ref' ? – or, where to put the "%" in the following expression?

"id" LIKE attribute ( @atlas_feature, 'ref' )

Thank you.


texts: Speed up union for tessellating polygons

texts:
I'm doing a union of a large number of complicated polygons using nettopologysuite and it is very slow.  As these polygons are perfectly tessellating is there something I can do to speed things up?

What I've tried so far

List<IGeometry> collection = GetLargeCollectionOfComplicatedMultiPolygons();

x = new NetTopologySuite.Operation.Union.UnaryUnionOp(collection).Union();//00:24:05

x = new NetTopologySuite.Operation.Union.CascadedPolygonUnion(collection).Union();//00:36:17

x = new GeometryCollection(collection.ToArray()).Buffer(0);//00:07:17

I've also tried to do stuff in parallel but it's not really helped.


texts: Append Tool - 000117 : Warning empty output generated

texts: I recently had to reinstall ArcGIS (10.2.2) and I am now having trouble running the Append Tool. I am trying to append a point Shapefile into a point Feature Class. I have completed this process hundreds of times, but for some reason after the reinstall I am getting the error message "000117 : Warning empty output generated." I have tried it multiple times with 'No Test' Field Map options on and off and get the same result each time. Both data sets have the same projected coordinate systems and I have also tried selecting only a few samples and still getting the same result. Any thoughts?


texts: Choosing Imagery type for ArcGIS Server (without Image Extension)?

texts:
I am exploring the best options to serving raster imagery on ArcGIS Server 10.2.2.

As a background, I currently have roughly 200 .jp2 files of about 3mb each. All of these files are currently served locally via the Mosaic Dataset function. However, Mosaic Dataset is not supported in ArcGIS for Server unless you have the Image Extension (which I do not).

I have used some techniques in QGIS to merge the .jp2 rasters but the size becomes too massive to serve over ArcGIS Server (roughly 20 gb). The merge I have run was for .TIFF and .IMG.

How do I serve multiple .jp2 or condense the .jp2?


texts: Polygonize raster file according to band values?

texts:
I want to polygonize a raster by using GDAL in python. I found this webpage:
Polygonize a Raster Band. But it creates a polygon feature layer. I want every band with the same value to create one feature.

For instance, even if band values are far away from each other but the same value, they should be one feature (maybe multipolygon)

EDIT
Here is my polygonize code:

from osgeo import gdal, ogr
import sys
# this allows GDAL to throw Python Exceptions
gdal.UseExceptions()

#
#  get raster datasource
#
src_ds = gdal.Open( "INPUT.tif" )
if src_ds is None:
    print 'Unable to open %s' % src_filename
    sys.exit(1)

try:
    srcband = src_ds.GetRasterBand(3)
except RuntimeError, e:
    # for example, try GetRasterBand(10)
    print 'Band ( %i ) not found' % band_num
    print e
    sys.exit(1)

#
#  create output datasource
#
dst_layername = "POLYGONIZED_STUFF"
drv = ogr.GetDriverByName("ESRI Shapefile")
dst_ds = drv.CreateDataSource( dst_layername + ".shp" )
dst_layer = dst_ds.CreateLayer(dst_layername, srs = None )

gdal.Polygonize( srcband, None, dst_layer, -1, [], callback=None )

If there are 500 different band values I should get a layer with 500 features.


texts: Is there a way of converting polygon vertices to points using GDAL python?

texts: I have an ArcGIS standard license and I want to convert polygon vertexes to points in a script.  Since I don't have a good enough ArcGIS license I've been using ET Geowizards to get the points.  The problem is you can't run ET Geowizards in python without having the full license.  So I was curious if any other open source geo tools can do this in python, specifically GDAL.  Is it worth looking into this for a solution?


texts:
How do you split an OpenLayers Vector Feature (Polygon or a LineString)?

i.e

ux: select feature, select a 'split' UI button, draw a split on-top of the polygon or through the line. The feature would then be split into multiple features that I have access too.

Are there any Split functions/interactions from either OpenLayers or a 3rd party library that you can use or how would you implement this manually?


texts: Switching between alias names and table names using ArcPy in ArcGIS Pro

texts:
Whenever I add standalone tables from my file geodatabase to an ArcGIS Pro map, the alias names are displayed instead of the table names. I want to view these tables using only their table names. Furthermore, I could not find any ArcPy functions that can automate these changes nor could I find any geoprocessing tools.
Is there any way to change all of the table names in my ArcGIS Pro project without having to manually go through each one?


texts: Grass NVIZ has no output in QGIS 2.8.1 ubuntu 14.04

texts:
I am trying to use the Grass7 NVIZ algorithm from the QGIS 2.8.1 toolbox, on ubuntu 14.04.

I have enabled Grass7 in the QGIS processing preferences.
I have compiled Grass7 from source, and Grass executes fine on its own. - Before this QGIS would respond with an error saying it could not find my Grass installation, however now it seems to be able to execute Grass now.

While running NVIZ the Grass console outputs the errors seen below, but runs through the entire algorithm nonetheless. When finished there is no output - the NVIZ window just closes and nothing else happens.

The errors seem to be connected to an expected version of GDAL. However the file called for (/usr/local/lib/libgdal.so.1) already exist at this location, so I am thinking it might be a an issue concerning the /etc/local/lib dir privileges, however granting read/write privileges to my user:group using chmod, has no effect.
Also re-installing GDAL has been fruitless.

I am at a loss right now as to a possible solution. Maybe someone has an idea how to proceed?

Algorithm nviz7 starting...
Starting GRASS GIS...
Executing '/home/hvitnov/.qgis2//processing/grass7_batch_job.sh' ...
g.region: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_gproj.7.0.0.so)
g.region: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_vector.7.0.0.so)
v.in.ogr: /usr/local/lib/libgdal.so.1: no version information available (required by v.in.ogr)
v.in.ogr: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_gproj.7.0.0.so)
v.in.ogr: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_vector.7.0.0.so)

GRASS_INFO_ERROR(29274,1): Unable to open data source
GRASS_INFO_END(29274,1)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by r.in.gdal)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_gproj.7.0.0.so)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_vector.7.0.0.so)

GRASS_INFO_WARNING(29275,1): Over-riding projection check
GRASS_INFO_END(29275,1)

GRASS_INFO_MESSAGE(29275,2): Raster map created.
GRASS_INFO_END(29275,2)

GRASS_INFO_MESSAGE(29275,3): r.in.gdal complete.
GRASS_INFO_END(29275,3)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by r.in.gdal)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_gproj.7.0.0.so)
r.in.gdal: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/grass70/lib/libgrass_vector.7.0.0.so)

GRASS_INFO_WARNING(29280,1): Over-riding projection check
GRASS_INFO_END(29280,1)


texts:
I`m trying to create a sphere-like view using qgis and the "world from space"-projection http://spatialreference.org/ref/sr-org/6980/ (essentialy an ortho-projection). ArcGIS wraps the shapes correctly but QGIS (2.01) produces nasty artifacts.

I have to produce the globes on a regular basis with different angles so does anyone out there have an idea how to fix this problem?


texts: Anti-aliasing in Carto markers makes them look "fuzzy"

texts:
Can you sharpen up the points in a Carto map so they have a less "fuzzy" aesthetic?

Here's what I've tried so far, and what I've learned:

First of all, I think this issue is about anti-aliasing. I see CartoCSS options to change this for polygons and lines, but not markers
I've tried adding a border or halo. But they are also fuzzy.
I've tried setting other "blending" types. But I believe these refer to "the composite operation that defines how the symbolizer behaves relative to layers atop or below it." So not relevant here.
I've tried to set the CSS marker-file to other marker types, but those are all fuzzy as well

Questions:

Does the fuzziness have to do with how the marker renders (anti-aliasing)? Is this just a Carto default?
Is there a CSS marker property that can change this? I went through all marker properties in the Carto docs and I'm not seeing anything.

(And, no, the fuzziness is not a function of me taking a screenshot. This is exactly what it looks like right in the Carto map.)


texts: Combine Community Layer with County Layer in ArcMap?

texts:
I have a County shapefile that I am trying to combine with an updated community or jurisdiction shapefile. I have tried Unioin, Merge, and Spatial Join, but am not getting the desired results. The end product is going to be a spreadsheet where you can filter by county, state that the Jurisdiction layer does not currently have.

The closest I have gotten to the correct output is doing a spatial join with County as the Target layer, Jurisdiction as the join layer and doing a one to many join. Also choosing "within" as the match option.

This is close, but is not joining any jurisdictions on the boarder of the county or the county boundary. It only seems to be taking the jurisdictions completely within the county border.


texts:
I have a vector layer which has lines (rivers) from a watershed and I want to clip the layer with the polygon of the watershed. I have tried clip, intersect, so on, so on. But I get error msgs.
Even if I ignore invalid input features, I can’t clip it. How can I complete this geoprocess? Is it possible? I want only the lines of the river layer falling within the watershed.
I checked that both layers have the same EPSG. I tried by selecting the “no filter” option and I get a msg that simply says, intersection failed at such time. It says that some features have invalid geometry. When I select the “skip invalid geometry” option, I get a msg about no index and although it completes the clipping process, it comes out empty.


texts: Tiled Map and Picture Marker Symbol not rendered using Print Task with ArcGIS JavaScript API

texts:
I have located a hospital and provided a new symbol to it. Also added a STREETS basemap to it.

I can see both of them on the map on screen. But when I try to generate a report (using Print Task), every detail is present in the report, except for the symbol and the basemap.

This is how I added the basemap:

    var url = "http://services.arcgisonline.com/arcgis/rest/services
              /World_Street_Map/MapServer";
    var tiledLayer = new ArcGISTiledMapServiceLayer(url,{"id":"Streets"});
    map.addLayer(tiledLayer);

This is how I added the Picture Marker Symbol:

    myLayer.add(new Graphic
    (
        locateFeature.geometry, featureicon2, locateFeature.geometry.attributes
    ));

Both of them are rendered on the map but not in the report (after the Print Task is executed).

Is there any way to get them rendered? Please help!


texts: why is a gdb query WHERE clause invalid according to the ArcGIS REST API?

texts:
Update: This only occurs when the layer being queried has a join.
It doesn't matter if it has a join to a different database or not. And the query that fails is not trying to access columns in the joined table.

In order to more accurately express the problem, I've used fully-qualified (4-part) column names below where required. See the updated WHERE clause below.

Original question:

We are using ArcGIS Server 9.3.1, Java, and ArcSDE with SQL Server 2005 sp2.

It would be very useful for us to be able to monitor our data periodically for defects, with a query such as

select * from sdeDLM.SDE.Lang_Polygons
where ISO_LANGUAGE_CODE_ID <> LEFT(ID , 3)

In ArcMap, I can do that query using Select by Attributes. I enter the above where clause and click 'Verify', and the expression is verified successfully.

But in order to monitor the data we need to use the REST API. We can successfully do REST queries with a where clause such as

WHERE sdeDLM.SDE.Lang_Polygons.ISO_LANGUAGE_CODE_ID IS NULL

or just

WHERE ISO_LANGUAGE_CODE_ID IS NULL

Those work just fine. FWIW, the URL for that REST query is:

http://ourServer:8399/arcgis/rest/services/DLM21_query/MapServer/2/query?text=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&where=ISO_LANGUAGE_CODE_ID+is+NULL&returnGeometry=false&outSR=&outFields=&f=html

But when I try a REST query with a where clause like

    WHERE sdeDLM.SDE.Lang_Polygons.ISO_LANGUAGE_CODE_ID <> LEFT(sdeDLM.SDE.Lang_Polygons.ID , 3)

the REST API returns the message:

Unable to perform query. Please check your parameters

As best I can tell, it's the LEFT() function that makes the difference. I have been able to successfully use where clauses with everything else in them, including '<>'.

The REST API docs for querying a layer say that "Any legal SQL where clause operating on the fields in the layer is allowed."

The URL for the query that gives an error is:

http://ourServer:8399/arcgis/rest/services/DLM21_query/MapServer/2/query?text=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&where=sdeDLM.sde.Lang_Polygons.ISO_Language_Code_ID+%3C%3E+Left%28sdeDLM.sde.Lang_Polygons.ID%2C+3%29&returnGeometry=true&outSR=&outFields=&f=html

Is there a way to get the REST API to accept a where clause using Left()? Or a way to find out why it's not working?

I tried browsing the latest logs in C:\Program Files\ArcGIS\server\user\log. The file Server-20100929-143218.dat shows the following output from the time when the query failed:

String request received. Request size is 2629 characters.
QueryFeatureData2 has started.
Preparation for method: QueryFeatureData2 has started.
Preparation for method: QueryFeatureData2 has completed.
Query Operation for method: QueryFeatureData2 on layer &apos;Language Polygons&apos; has started.
**GeoDatabase Error :An invalid SQL statement was used.**
QueryFeatureData2 has completed.
Method failed.HRESULT = 0x80040207 : This is a FACILITY_ITF error that is specific to the interface that returned this error. See the documentation of the interface that returned this error for information about this HRESULT.
ERROR INFO = An invalid SQL statement was used.

But why is the SQL statement invalid? Clearly the WHERE clause has been tested as valid elsewhere. And why would some of my WHERE clauses be accepted as valid, but not the one with LEFT() in it?


texts:
I have a simple Leaflet app that maps some custom points (bars, restaurants, etc...).

Currently, when the user clicks on on of the marker icons, a popup appears that displays a hyperlink of the location's name (ex: Slim's bar). If the user clicks on the hyperlink name, it takes them to the website (ex: www.slimsraleigh.com). The problem is that, in doing so, it takes the user out of the app and to a completely new page. What I'd like to have happen is that the page still comes up, but inside of a modal that the use can X out of once they are finished and want to view another locations website; basically, they remain in the app. How would you suggest I do this? I see there is a Leaflet Modal that can be loaded via NPM (I am using Node JS, so that should be easy), but the logistics of linking the modal to a click event of the hyperlink is where I am stuck. Below is the code where .Name and .Link (2 properties of my geoJson data) are utilized to make the hyperlink in the popup. Can anyone suggest a way I can accomplish my goal if getting the hyperlink tied to the modal?

L.geoJson(dtr_points, {
onEachFeature: function (feature, layer) {
    layer.bindPopup("" + feature.properties.Name + "");

     if(feature.properties.Type == "beer") {
        layer.setIcon(beer);
     };
     if(feature.properties.Type == "bar") {
        layer.setIcon(bar);
     };
     if(feature.properties.Type == "restaurant") {
        layer.setIcon(restaurant);
     };
     if(feature.properties.Type == "music") {
        layer.setIcon(music);
     };
     if(feature.properties.Type == "culture") {
        layer.setIcon(culture);
     };
     if(feature.properties.Type == "cafe") {
        layer.setIcon(cafe);
     };
     if(feature.properties.Type == "occult shop") {
        layer.setIcon(occult);
     };

  }


texts: How to make labels appear at a different scale than features' scale in Geoserver?

texts:
I'm using Geoserver 2.6.2.

I need to display land parcels and their references (a number). I have specified a maxscaledenominator for the features (polygons) but I don't want references to appear at such a scale for it will be a nonsense (parcels appear very small and dense so that no additional information is needing on the map). Is it possible to specify a maxscaledenominator for labels as well?

Here is an extract of my code:

<UserStyle>
    <FeatureTypeStyle>
        <Rule>
            <MaxScaleDenominator>20000</MaxScaleDenominator>
            <PolygonSymbolizer>
                <Stroke>
                    <CssParameter name="stroke">#000000</CssParameter>
                    <CssParameter name="stroke-width">1</CssParameter>
                </Stroke>
            </PolygonSymbolizer>
            <TextSymbolizer>
                <Geometry>
                    <ogc:Function name="centroid">
                        <ogc:PropertyName>the_geom</ogc:PropertyName>
                    </ogc:Function>
                </Geometry>
                <Label>
                    <ogc:PropertyName>reference</ogc:PropertyName>
                </Label>
                <Fill>
                    <CssParameter name="fill">#000000</CssParameter>
                </Fill>
            </TextSymbolizer>
        </Rule>
    </FeatureTypeStyle>
</UserStyle>


texts: Use results of loop for another raster calculation

texts:
I've been looking extensively to find a solution for what I think is a very simple exercise.

In general, I would like to know how I can extract a variable from a loop in Python and then use it elsewhere in the script. I've limited Python knowledge, however I know from R that this should be fairly simple. More specifically, my case is explained below.

I've two loops both multiplying rasters. I need to extract variables from each of the loops and then add them together.

import arcpy, os
from arcpy import env
from arcpy.sa import *

arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput = True
env.workspace = "D:/Join"
#
outputFolder = env.workspace
#
# A list of two different rasters
wheat = ["a_wheat", "b_wheat"]
for w in wheat:
    r_w=Times("landuse_w",w) # landuse is a raster
    r_w.save(os.path.join(outputFolder, "r_" + w ))
# This will generate r_a_wheat, r_b_wheat

barl = ["a_barl", "b_barl"]
for b in barl:
    r_b=Times("landuse_b",b)# landuse is a raster
    r_b.save(os.path.join(outputFolder, "r_" + b))
# This will generate r_a_barl, r_b_barl
#
# Add rasters
add_a = r_a_wheat + r_a_barl
add_b = r_b_wheat + r_b_barl

The problem with the loops like this is that I need to save everything and then add up. I would prefer to extract from r_w the two rasters (r_a_wheat, r_b_wheat), do the same for r_b and then add up without having to save files. Is that possible?


texts:
I have two point layers each with a single point in them. I want to draw a
line joining the points to use to measure the distance apart.

I have found
various plug-ins which allow this, but is there a way I can actually link
the point coordinates to the line layer so that if I move one of the points
the line will update automatically?


texts: Ogr2ogr importing table with all in text type - how to change geometry accordingly?

texts:
I've imported a large table that has a geometry column, problem is that it is in text format, how to change this to be a point geometry in 27700 CRS?
I've tried SELECT UpdateGeometrySRID('table','geom',27700);
But got hit with
SQL Error [P0001]: ERROR: column not found in geometry_columns table
Where: PL/pgSQL function updategeometrysrid(character varying,character varying,character varying,character varying,integer) line 35 at RAISE
SQL statement "SELECT public.UpdateGeometrySRID('','',$1,$2,$3)"
PL/pgSQL function updategeometrysrid(character varying,character varying,integer) line 5 at SQL statement
I've tried    update table set geom2 = st_setsrid(ST_GeomFromText(geom),27700)
But got hit with
SQL Error [XX000]: ERROR: parse error - invalid geometry
Hint: "" <-- parse error at position 1 within geometry
Is there a different way to change my column type to geometry?


texts:
I can't seem to find much in forums about this - I'm trying to use Tabulate Intersection with two shapefiles.

When run in a model, I get a generic error (Error 999999:Error executing function).
When run in a Python script, I get the following:

    Traceback (most recent call last):   File
    "H:/Scripts/IntersectTable_test.py", line 18, in <module>
    arcpy.TabulateIntersection_analysis (in_zone_features, {'distance'}, in_class_features, out_table, {'INFO'}, '','','')   File
    "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\analysis.py", line
     1122, in TabulateIntersection
     raise e RuntimeError: Object: Error in executing tool

....this makes it difficult to diagnose problem. Anyone with experience/know what I'm missing?
I'm working in Arc10.1 and have all license access. I've edited this post to include the code I'm using to test this before adding it to a larger, more complex script:

    import os
    import arcpy
    import sys
    from arcpy import env
    import csv

    ##Set overwrite
    arcpy.env.overwriteOutput = True

    ##Set variables
    in_zone_features = r'C:\BOEM\QuartRings\Scratch\quartrings_points_proj_multrings.shp'
    zone_fields = 'distance'
    in_class_features = r'C:\BOEM\Basic_NE_Fisheries.gdb\ALL_WEA_Simplified_3_2013'
    out_table = r'C:BOEM\QuartRings\Scratch\buff_intersect_table'

    arcpy.TabulateIntersection_analysis (in_zone_features, {'distance'}, in_class_features, out_table, {'INFO'}, '','','')


texts: Convert a mbtiles tileset folder into a single .mbtiles SQLite file?

texts:
I have a root tileset folder structured with the standard tiling scheme /tileset/{Z}/{X}/{Y}.pbf.
When I try using GDAL, I think I miss something:
$ ogr2ogr -f MVT sqlite.mbtiles ./tileset
FAILURE:
Unable to open datasource `sqlite.mbtiles' with the following drivers.

Second try:
$ ogr2ogr -f MVT sqlite.mbtiles tileset/*/*/*.pbf -oo METADATA_FILE="./tileset/metadata.json"
Warning 1: Invalid value for 'bounds' metadata. Ignoring it and fall back to present tile extent
ERROR 1: Cannot find min and max tile numbers
ERROR 1: Couldn't fetch requested layer 'tileset/10/525/365.pbf'!

(note that this last file does actually exist on the disk).
How to properly convert a tileset/ folder to a single SQLite3-flavoured *.mbtiles file?
I'm working on a Ubuntu server 18.04 through SSH (no GUI).
Some more info:
$ cat tileset/metadata.json
{
  "name":"mytileset",
  "description":"",
  "version":2,
  "minzoom":0,
  "maxzoom":10,
  "center":"7.7459902,45.7073015,0",
  "bounds":"4.5954793,43.3513365,10.8965010,48.0632664",
  "type":"overlay",
  "format":"pbf",
  "json":"{ extra-large dataset }
}

I'm not able to figure out how to launch ogrinfo on the tileset/ folder.


texts: How do I show feature attributes in a Leaflet popup?

texts:
So I have a JSON file displayed on my leaflet webmap. I would like to have it so a popup will appear when a feature is clicked. Right now it is a polygon feature. How do I call up information from the JSON file (Syriashape.json) so it can be displayed? The fields I would like to display are called "Sheet_Num" and "Date"

Currently, this is what I have:

// load GeoJSON from an external file
$.getJSON("Syriashape.json",function(data){
  // add GeoJSON layer to the map once the file is loaded
  L.geoJson(data).addTo(map).bindPopup("Attributes Popup Here");
});


texts: How do I select from a multiband raster?

texts:
I have a multiband raster (RGB) and I'd like to select out the watercourses to create a new raster.

Examining the data it seems I can do so by selecting blue > 100, Red <100, Green <100. Is there a way to create a new raster based on an sql query, where all pixels that meet the criteria are differentiated from those that don't?

I have the spatial analyst extension. I saw the Extract By Attributes tool, but this just allows me to select by Value.

Ideally my end product would be a binary raster that differentiates between those pixels that meet the given criteria and those that do not.


texts:
Is there a way to optimize a PDF using Python?

I am exporting hundreds of .mxds  - that works fine with a loop.  But the file size of each is large.  Right now my option is to manually open each and save as optimized.  I would like to run this process monthly, so I need a better solution than that.


texts: ArcMap 10.3 Attribute Table Showing Wrong Information?

texts:
I have some parcel data with addresses that I am trying to export as a selection. Every time I open the attribute table with a new selection of parcels, the information is incorrect after a certain point in the list.

Below is an example. I have my selection of Parcels 2 and the attribute table with the Owner information 1.  After the first row, all the information is the same after even though that information is incorrect. If there wasn't a selection, the information would be correct using the element information button.


texts:
this is repost of the same question on Stackoverflow where I got no answers so far
https://stackoverflow.com/questions/5687130/how-to-write-into-dbase-tables-using-ruby-on-osx

So, from OSX(Lion) using Ruby(1.9.x), I am trying to update data from an ESRI Shapefile. I didn't find any gem with dbf write support or at least some ODBC driver that I can use on OSX.


texts: Creating management zones in NDVI ortho maps with contour like lines

texts:
This question is hard to explain so if you have a possible answer I would love to hear it.

I work in the precision agriculture business which heavily relies on NDVI calculations but need to create like zones of crop health for field surveyors and field management purposes. The end users for maps I create are not GIS savvy so presentation is everything. Raster Classification, zonal fills, and reclassification's are not what I want because they are vague and distort the data. On the attached map there are geo-coordinate points over areas with possible health strains and areas that appear to be very healthy.

How do I create zone lines, almost like contour lines, to batch similar points into like areas?
For example, in the Northwest portion of the map, the three points are over similar areas. How do I create a boundary lines showing different zones?
I'm looking for 5 areas:
i) worst;
ii) bad;
iii) OK;
iv) good;
v) best,
separated by contour like lines creating zones.  I don't want to disrupt are high resolution photography.


texts: QGIS Graticule at Print Layout starting at from 0

texts:
I would like to add a graticule with coordinates to my map. However, when I add a new grid and modify it the graticule appears but it always starts at 0 and not from its real value.

How could I fix the problem?

All layers are projected in ETRS89/UTM zone 32N.


texts: Increasing Offset Y for Units and Numbers of ArcGIS Pro scale bar does nothing?

texts:
Using ArcGIS Pro 1.3.1 I have created a scale bar using the Scale Line 1 Metric template with a few modifications like:

Show one division before zero
Divisons: 11
Subdivisions: 10
Label Position: Below center
Label: KILOMETRES

It appears as below:

How can I increase the gap between the scale bar line and the units (KILOMETRES) label (circled above)?

I thought that it might have been the Offset Y value (circled in red below) that might do it but that has no effect when I change it from 0 to 5 (as a test) and appears to be a bug.  I think it is a bug because altering Offset X moves the same label as expected.

The same bug appears to affect the positioning of the Numbers on the scale bar too.

The bug is still present in ArcGIS Pro 2.0.


texts:
I have an (1998 manual) old plotter HP PLotter 1050c Plus (only works on Windows XP)... It prints fine, but the Source/Receivers are not showing up on the map nor the legend.  Everything else is displayed.  It is printing off the Adobe PDF created by ArcGIS 10.1

Not sure what the problem is, I have increased the size of the Src/Rec, but not luck. Troubleshooting manual is no help either.

Has anyone experienced this problem and fixed it?


texts:
This problem keeps occuring. Any function within the ArcToolbox gives this error message with different code. The message below comes from using the 'Hillshade' tool.

I've updated my ArcGIS for Desktop 10.2.2 to SP5 and i've tried changing the security settings in Internet Explorer (V. 11.0.9600.17633) but no positive result.

The ''regsvr32 C:\windows\system32\msxml3.dll'' solution doesnt work.
Reinstalling ArcGIS doesn't work either.

also tried these solutions:

https://gisnuts.com/terra/blog/2013/01/22/arcgis-geoprocessing-tools-scripting-error, http://support.esri.com/en/knowledgebase/techarticles/detail/38099, http://support.esri.com/en/knowledgebase/techarticles/detail/33792

no avail


texts:
I currently have two Landsat 5 reflectance value layers that were calculated from the per-processing function in SCP for QGIS. I would like to merge these two images together to create one mosaic layer which can be used for an NDVI calculation. Is this possible? Any time I try to complete this, I still have a white space in the overlapping portion of the images.

The images I am trying to merge:

The files selected in the merge tool options:

The merge settings:

My incorrect results:


texts: Gathering information from a point to nearest polygon in QGIS

texts: I am using QGIS and would like to know what the nearest vegetation type is from a point (animal location). Could someone help me figure out what tool I should use?


texts:
I tried to download data from WFS server but it doesn´t work with Qgis 3.2.2.
I connected to https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_vereinfacht Then I connect to server and wanted to preselect a specific area by

Query e.g. select * from flurstueck where city= 'köln',
or:
by tagging the "only request features overlapping with the view extent".

But both doesn´t work for me.

Failure message:

  Layer ave:Flurstueck : Download of features for layer ave:Flurstueck
  failed or partially failed: Download of features failed: Error
  transferring
  https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_vereinfacht?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=ave:Flurstueck&COUNT=500000&SRSNAME=urn:ogc:def:crs:EPSG::25832&FILTER=%3Cfes:Filter
  xmlns:fes%3D%22http://www.opengis.net/fes/2.0%22%3E%0A
  %3Cfes:PropertyIsEqualTo%3E%0A
  %3Cfes:ValueReference%3Egemeinde%3C/fes:ValueReference%3E%0A
  %3Cfes:Literal%3EKöln%3C/fes:Literal%3E%0A
  %3C/fes:PropertyIsEqualTo%3E%0A%3C/fes:Filter%3E%0A - server replied:
  Bad request. You may attempt reloading the layer with F5


texts:
Is it possible to create this type of "square legend" in QGIS?

It is the first time that I see this type of legend and I really liked it.

Source: https://twitter.com/Caroline_OF_B/status/1249699201392484354


texts: Labels on tiled map sometimes unavailable

texts: I have following case. Map of highway with labeled points placed by some interval. Problem is with labels that are partially on particular tile. Sometimes they are not drawn completely. I tried to find out which code is responsible for exact drawing but geoserver is too complicated for me on first attempt. I'm looking for help with schema around drawing flow in just master branch of geoserver or any practical resolution of my case.


texts:
I want to draw all London bus routes. I have the associated bus stop locations and sequences. Is there a quick way to draw the routes?

My end product would be a shapefile or layer file / table with all the routes.


texts: How was GPS not freely available for civilian use before 1983

texts:
In 1983 GPS was made freely available for civilian use, https://en.wikipedia.org/wiki/Global_Positioning_System:

  President Ronald Reagan issued a directive making GPS freely available
  for civilian use, once it was sufficiently developed, as a common
  good.

How (technically) it was not freely available for civilian use before 1983?

Was the signal not on public radio frequency, obfuscated, coded, ciphered? Maybe the HW (e.g. chips) was not available to civilian electronics devices manufacturers?


texts: Openlayers: Making the map move with moving vector layer (airplane) on map

texts:
So currently I have a map that has some plane data. There is a setInterval function that updates the plane data every 5 seconds, making the plane move from point to point. That is working well.

function planeInterval() {
    setInterval(function() {planeMovement()}, 5000);
    //this is currently working
}

function planeMovement() {
    //do some stuff to make the plane move around
    //this is currently working

}

Now, I would like to set up a checkbox or some sort of toggle to:

-toggle on: as the plane moves across the map, the map MOVES as the plane moves

-toggle off: the plane just does what it usually does: moves across the map while the map stays stagnant.

I was looking into OL panTo but I don't think that's the answer here. What would be the best/most simple approach in achieving this?


texts: Recommended opensource solution for storing, publishing and querying GIS data

texts:
Our company has millions of feature classes currently stored through ArcSDE on SQL Server 2008 R2. We are kind of slowly making our way to opensource software.

What we want to achieve is to be able to migrate all our spatial data off ESRI to opensource database, and then be able to publish the data to our intranet, and allow end users to search and view the data.

I have been thinking of a solution stack of of PostgresSQL/PostGIS, GeoNetwork and GeoServer. How much time/effort would you expect it to be? Any other best-practice recommendations?

Thanks!


texts: Tracking Map Events in ArcObjects Dockable-Window Addin?

texts:
I'm building an Addin for ArcGIS 10.2 with c#.

It is a dockable Window, that will host some controls for our custom export solution.

I want to listen to Map-Move events of the main map (IActiveView), to update the display of the current bounding box coordinates within the dockable window.

My problem is, I can't find a good way to listen to the mapevents.
The only way I found is by creating a new IMapControl->IMapControlEvents2 object and listen to the OnExtentUpdated Event.

Is there something that I can use by casting from IActiveView or do I have to create a new IMapControl object?


texts: Open project made on OSX lion on a windows computer with QGIS

texts: I made a project in my personal computer (mac OS Xlion) and now I would like to modify it on my work computer (windows 7), Is it possible?


texts: Can MBTiles file exported with QGIS "Generate XYZ Tiles" tool be uploaded as a tileset to Mapbox?

texts: I am wondering if the files generated with this tool are analogous with the exports from the discontinued Mapbox styling UI TileMill. My test of exporting the same display with both tools yields two .mbtiles files with wildly different file sizes. Has anyone tried to upload a .mbtiles file exported with this QGIS tool into Mapbox?


texts: Eliminating small polygons from shapefile after polygonize in R

texts:
I have a shapefile "shape_clara" that was polygonized using function rasterToPolygons(x, dissolve=TRUE). But then I have multipolygons for each class, and I want to eliminate the small polygons by area. So I have to access each polygon inside the multipolygon.

I did that:

listao<-list()
for (j in 1:length(shape_clara@polygons)){
lista<-vector()
for (i in 1:length(shape_clara@polygons[[j]]@Polygons)){
if (shape_clara@polygons[[j]]@Polygons[[i]]@area<50000) lista<-rbind(lista,i)
}
listao[[j]]<-lista
}

Ok so far, listao give me all the small polygons ID.

And then to remove the small polygons:

for (i in length(shape_clara@polygons)){
shape_clara@polygons[[i]]@Polygons<-shape_clara@polygons[[i]]@Polygons[-as.vector(listao[[i]])]
}

But when I look the result, they are still there.

Any tips about how to remove them?


texts: Summing pixel values from several raster layers with partial overlap in QGIS?

texts:
I have several presence maps (rasters values 1 and 0) from different species. They are all from South America, but they do not have the same extend (i.e., different sizes).

So, I am trying to develop a "richness" map, trying to sum all these values, which would give me a value of the number of species for each pixel (from 1 to 6, as they are six species).

However, when trying to use the raster calculator and other grid analysis tools, this fails because: 1) it shows me only a map with areas where they all overlap (this happens with raster calculator), or 2) fails because the layers are different (different extent, this happens with grid sum, and other analysis tools).

How can I have a map that sums all pixels values, and includes the areas of all the different presence maps?


texts: Deleting polygon created with Add Polygon Feature in QGIS

texts: I was playing with the "Add polygon Feature" in QGIS. I ended up with some weird ugly polygon. How do I delete the polygon?


texts: Error while trying to integrate Leaf Area Index into ui.DateSlider

texts:
I am trying to calculate Leaf Area Index in GEE by deriving LAI from NDVI (I found the formula in this thread from Research Gate forum https://www.researchgate.net/post/How_to_calculate_LAI_Leaf_Area_Index_from_Satellite_Images) and also I want to integrate it into a ui.DateSlider widget.
var sentinel_dataset = ee.ImageCollection("COPERNICUS/S2_SR")
 .filterDate(Start_period, End_period)

//Create NDVI
var collectionNDVI = sentinel_dataset.map(
    function(img) {
         return img.normalizedDifference(['B8','B4'])
               .rename('NDVI')
                  .copyProperties(img, ['system:time_start']);
                      });

//Create LAI
var collectionLAI = sentinel_dataset.expression(
    '0.57 * exp(2.33 * NDVI)', {
      'NDVI': (collectionNDVI),
});

When I run this code, the console brings up this error: sentinel_dataset.expression is not a function
This is the link for my code https://code.earthengine.google.com/47d695de6faf894006516a447d095804
I tried multiple ways to write the expression but nothing seems to work. Is there another way to create LAI in this context?


texts: Can you force cartoDB to read a file as a synced table

texts: I'm writing a script that downloads from a data source every hour. I then do some processing on it and convert it to a kml saved in my google drive. As the data is updating every hour I want to be able to sync it with cartodb. However, the sync options are all greyed out. Do I need to upgrade to have access to synced table functions or is there a way to force cartoDB to recognise it as a synced table?


texts: How to provide INSPIRE metadata from GeoServer

texts:
AFAIU the GeoServer INSPIRE extension adds some stuff to the extended capabilities document that provides the URL to the metadata.

But is there any way that the INSPIRE-compliant metadata file can be compiled by GeoServer?


texts: Splitting shapefile based on part of field in attribute table using ArcPy?

texts:
I'm new to Python and I need a script that can split my huge shapefile based on a certain attribute.

SO what I have is a big shapefile (over 3M records) with a field named "NISCODE".
In this code are values ranging from 11001 to 73109. But only the first number of the value is important to me, that's the base on which the shapefile needs to be split on.
So I need 7 shapefiles; everything starting with 1, with 2,...

I know I'll probably need a for loop, but I don't know how to put it in my code correctly.
Here is what I have so far, this was just a test to see if I could already make a selection for the 1st part (everything starting with 1...), but already that fails.

# Import system modules
import arcpy
from arcpy import env
env.overwriteOutput="True"

# Set workspace
# setting the environment
workspacedir= r"C:\..."
env.workspace= workspacedir

shp = r"C:\....\Adp.shp"

r=arcpy.Exists("Adp.shp")
print r
### Make a layer from the feature class
arcpy.MakeFeatureLayer_management("Adp.shp", "Vl_lyr")
##
# Wselect only those that have id starting with 1
arcpy.SelectLayerByAttribute_management("Vl_lyr", "NEW_SELECTION", ' "NISCODE" = 1* ')
##
# Write the selected features to a new featureclass
arcpy.CopyFeatures_management("Vl_lyr", "Vlaanderen_1.shp")

EDIT:

The new code looks now like this:`

# Import system modules
import arcpy
from arcpy import env
env.overwriteOutput="True"

# Set workspace
# setting the environment
workspacedir= r"C:\..."
env.workspace= workspacedir

shp = r"C:\...\Adp.shp"

arcpy.AddField_management(shp, "newNISCODE", "TEXT")

arcpy.CalculateField_management(shp, "newNISCODE", '"newNISCODE" = NISCODE[0]', "PYTHON")

list = []
with arcpy.da.SearchCursor(fc, "newNICODE") as cursor:
    for row in cursor:
        list.append(row)
num_list = sorted(set(list))

for i in range(1, len(num_list)):
    arcpy.Select_analysis(shp, "{}_shp".format(i), 'newNICODE = "{}"'.format(i))`

but the code fails on the Calculatefield step:

Traceback (most recent call last):
  File "C:\...\SplitShape.py", line 15, in <module>
    arcpy.CalculateField_management(shp, "newNISCODE", '"newNISCODE" = NISCODE[0]', "PYTHON")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 3663, in CalculateField
    raise e
ExecuteError: ERROR 000539: SyntaxError: invalid syntax (<expression>, line 1)
Failed to execute (CalculateField).


texts: How to automatically compare two aerial photographs with a GIS with regard to certain features?

texts:
At present, we are trying to automatically record the new use of land by buildings by systematically comparing aerial photographs (e.g. 2007 farmland -> 2008 warehouse). For this purpose, high-resolution aerial photographs are available every year since 2000 as WMS service.

Is there a plugin for QGis or ArcGis that could help here? Or is there another tool that you can buy for this purpose? Has anyone done something similar before?


texts: Why can't QGIS connect to remote PostGIS installed on an Amazon-Lightsail VM?

texts:
I've setup a local installation of PostGIS in the past, and had no problem connecting QGIS to it in Localhost. However, I recently rented an Amazon Lightsail Ubuntu virtual machine to make my PostGIS database available remotely, and I can't figure out how to connect QGIS to it.

Possible problem #1: One of the big differences I noticed between installing PostgreSQL/PostGIS locally with the installer (from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads), and with the command lines (apt-get install postgresql postgresql-contrib and apt-get install postgis) is that, with the former, the installer asked me for a 'postgres' superuser password, and no password was asked to me in command line. Hence, when I try to connect to PostGIS in QGIS, the password part is a mystery.

I therefor looked at how to setup a password with the command \password and restarted the server, but QGIS still can't connect:

Possible problem #2:
I looked for a solution and found this answer : https://stackoverflow.com/questions/38466190/cant-connect-to-postgresql-on-port-5432. Which suggests to modify the file postgresql.conf and set this parameter as such: listen_addresses = '*'.

However, I'm not sure where to find this file in my Amazon Lightsail VM. Also, this seems like a "hacky" solution. Has anyone had this kind of problems before? Is there a trick I'm overseeing? In short: what's the proper way to fix this?


texts: Is it possible to install 9.3 Desktop Administrator as a standalone program?

texts:
I have ArcServer 9.3 installed on a server that I use for running scheduled Python geoprocessing scripts.  I have several running, and now I'm trying to schedule one to rec/post, delete and recreate our database versions.  The issue that I'm having is this line of code

gp.SetProduct("ArcEditor")

Apparently to run the versioning tools, I need to have valid license of ArcEditor or higher availible to the server.  I would really rather not install ArcGIS desktop on my server box, but I'm stuck for a solution.  My main question is, is it possible to install the 9.3 Desktop Adminstrator as a standalone program, then point it at my license manager so that the script can find a license file?  If not, that's fine, any ideas are appreciated.


texts: Empty mapper window when I open a OSGB36 shapefile in MapInfo Professional. How can I see the data?

texts:
I have a set of shapefiles which I'm trying to open in MapInfo Professional 7.8. Each of the shapefiles has a .prj file which looks like this:

PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936"
  ,DATUM["D_OSGB_1936"
  ,SPHEROID["Airy_1830",6377563.396,299.3249646]]
  ,PRIMEM["Greenwich",0]
  ,UNIT["Degree",0.017453292519943295]]
  ,PROJECTION["Transverse_Mercator"]
  ,PARAMETER["False_Easting",400000]
  ,PARAMETER["False_Northing",-100000]
  ,PARAMETER["Central_Meridian",-2]
  ,PARAMETER["Scale_Factor",0.999601272]
  ,PARAMETER["Latitude_Of_Origin",49]
  ,UNIT["Meter",1]
 ]

When I open these files I'm asked for a projection setting, I've tried the 'Latitude/Longitude (OSGB 36)', 'British National Grid' and a fair few others but always see an empty mapper window. If I try to look at the coordinates using MapInfo Professional's SQL query options then rather strangely I see blank values for CentroidX(obj),CentroidY(obj).

If I use the Universal Translator to convert one of the shapefiles to MID/MIF then I can see the coordinates, like this:

VERSION 300
DELIMITER ","
 CoordSys Earth Projection 8, 104, "m", -2, 49, 0.999601272, 400000, -100000
COLUMNS 1
    ID decimal(5,0)
DATA
LINE 534061.554 182550.177 534062.547 182550.525
LINE 534062.547 182550.525 534064.181051453 182547.058664689
LINE 535691.843 183008.914 535693.182 183007.166
LINE 534840.184 182700.747 534839.889 182701.372
LINE 536273.212731382 183548.850943691 536271.824 183548.284
LINE 533330.033439369 182375.414376181 533329.876996451 182376.898647792
(etc...)

I need to be able to edit these files in MapInfo Professional and then need to convert them to WGS84 but am rather stuck. My question is how I can open these files so that I can see and edit the data?

Thanks!

UPDATE: Having taken James S's advice most of my files are now appearing in MapInfo, great, thanks James S! But I have a small set of files which didn't work and if I convert those to MID/MIF I see a different kind of coordinates, as follows. Note that the .prj file for these shapefiles appears to be exactly the same as that above. How can I deal with these ones?

 VERSION 300
 DELIMITER ","
CoordSys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (-7845061.1011,-15524202.1641) (8645061.1011,4470074.53373)
 COLUMNS 7
    ID0 char(21)
    NUMBER char(254)
    ID char(254)
    DESCRIPTIO char(254)
    STATUS char(15)
    TYPE char(9)
    DURATION char(10)
DATA
PLINE 65
386065100 336732200
386062540 336736210
386061790 336737010
386058060 336739750
386057400 336740120
386054630 336741240
386054180 336741470
386050910 336743490
386050660 336743630
(etc...)


texts: Error 999999, Table name is invalid - Zonal Stats as table

texts:
I am attempting to run a model that iterates rasters and computes zonal statistics returning a table. The raster's statistics are computer across all polygons in a specific shapefile. This model worked for a small amount of files (3), but when I am trying to use it for my entire Geodatabase it will not work, returning the error shown below.

My model looks like this:

I have around 300 rasters I am trying to find the statistics for, and they are listed in my geodatabase like this:

I am using the file pathway of a new folder followed by %Name% as shown in the Model Diagram. When executing the model non-iteravely,it completes when the file name is something random, say, "new", but when using the /%Name% as the file name, it returns that the characters are invalid.

I am very confused as to why this model worked for the test run of just a few files but not for the entire geodatabase.


texts: 3D information is lost when using "Regularize Building Footprint" in ArcGIS

texts:
Currently I am working on the extraction of building footprints using ArcGIS/ArcPy and Lastools. Using LasBoundary I extract all buildings from the lidar dataset and get the building outlines as 3D polygons (Polygon ZM). In order to improve/enhance the geometry of the outlines I perform a smoothing by means of "Regularize Building Footprint" as a subsequent step.
arcpy.ddd.RegularizeBuildingFootprint(<input polygons>, <output polygons>, 'ANY_ANGLE', "0.20", "0.20", "0.15")

Unfortunately I only get 2D-polygons (Polygon) as result. Is there a possibility to keep the 3D information or to add it again or another possibility to smooth the outlines of a Lidar generated footprint of a building?


texts: Using ModelBuilder to Iterate through rasters and reclassify them

texts:
I'm trying to iterate through a folder which contains many Lidar-Intensity Images as .jpg files.
I want to reclassify them all with the same thresholds (3 classes). I used the "Iterate Raster" and after that the "Reclassify" tool. But the result in the output folder doesn't create a single output raster.
I also tried to use "classify by table" without any success too. It also doesn't work if I try to use other tools like "select by mask" or the raster calculator. When I use these functions on the .jpg files manually (not in the ModelBuilder) it works without any problems.
Here is my model, has anyone suggestions?


texts: How to aggregate properly 8-days MODIS ET to a monthly ET?

texts:
I am looking for a robust method to aggregate the 8-day MOD16A2 (or MOD16A2GF) ET_500m values to monthly ET. Since ET_500m and PET_500m, are the summation of 8-day total water loss (0.1 kg/m2/8day).
I tried with a sum of all values within a month but when I saw the dates (i.e. 01/25/2000 02/02/2000 02/10/2000 02/18/2000 02/26/2000 03/05/2000) I realized that some months have 3 or 4 data, these would affect the monthly summation, causing a loss of reliability of this process.
Is there any other method to do this task or to improve this method?
The monthly MODIS ET dataset will be used to validate SWAT ET.


texts: Numpy ndarray written to GeoTIFF is distorted when ndarray is not a square

texts:
I'm writing an image stored in an Numpy ndarray to a GeoTIFF file, knowing the extent of the image in degrees.
As long as the ndarray shape is a square the image is created correctly, even when the extent is not a square at all.
When the ndarray size is not a square the result is distorted, the top left corner is in the expected position but the bottom right one is not.
This is my code:

from random import randint

from osgeo import gdal
from osgeo import osr
import numpy as np

def saveToGeoTIFF(
    latmin: float, latmax: float, lonmin: float, lonmax: float, image: np.ndarray, fname: str):
    nx, ny = image.shape[:2]

    xres = (lonmax - lonmin) / nx
    yres = (latmax - latmin) / ny

    geotransform = (lonmin, xres, 0, latmax, 0, -yres)

    dst_ds = gdal.GetDriverByName('GTiff').Create(fname, ny, nx, 3, gdal.GDT_Byte)

    srs = osr.SpatialReference()
    srs.ImportFromEPSG(4326)
    dst_ds.SetGeoTransform(geotransform)
    dst_ds.SetProjection(srs.ExportToWkt())

    dst_ds.GetRasterBand(1).WriteArray(image[:, :, 0])
    dst_ds.GetRasterBand(2).WriteArray(image[:, :, 1])
    dst_ds.GetRasterBand(3).WriteArray(image[:, :, 2])
    dst_ds.FlushCache()

if __name__ == '__main__':
    image = np.zeros((10, 30, 3), dtype=np.uint8)
    for x in range(0, image.shape[0]):
        for y in range(0, image.shape[1]):
            image[x][y][0] = randint(1, 255)
            image[x][y][1] = randint(1, 255)
            image[x][y][2] = randint(1, 255)

    # coordinates for the Bresso airport landing strip, used here as a reference
    saveToGeoTIFF(45.5331, 45.5465, 9.1986, 9.2056, image, 'newFile.tif')
    # same is done with a 10x30 image, which is distorted

I create two images using the same extent but one is based on a 10x10 ndarray, and the other a 10x30 one. The 10x10 matrix covers the expected area and the pixels appear, correctly, stretched. The 10x30 instead is distorted.
I don't understand what's going on, I am calculating the resolutions on the two axes and placing them in the transformation, but something is missing.
The area of the extent:

The images generated from a random numpy image 10x10 (stretched, correct) and 10x30 (not stretched, wrong)


texts: Looking for Employment Density Data: Employees per unit of area by industry by county (USA)

texts:
What I'm looking for something like this: http://www.bls.gov/cew/ew07fig20.pdf

For those that can't see it, the second page of the PDF has a map of Employment density within manufacturing by county, 2007 (employees per square mile).

But what I'm looking for needs to have

Recent data; preferably 2014-2015 but nothing older than 2010
Data for each major occupation group
Actual numbers, not just a plain image
Preferably data in a GIS format but a table, CSV, or Excel file will work

They never specified exactly how small a unit of area they were looking for but it needed to be smaller than a county.

My immediate need is only for a few counties though data for the entire state may be useful. The counties in question do not touch state lines.

I've been able to find tables of data giving how many employees there are in a county broken out by industry but not how many employees in an industry there are per unit of area. It seems like it ought to exist, the Bureau of Labor Statistics did do that PDF above after all, but I'm unable to find it.


texts: Printing possible for openlayers GeoJson WFS with Mapfish printing service and wkhtmltopdf?

texts:
I searched lots of places but I couldn't find proper examples or documentation to do printing using Mapfish Printing service or Wkhtmltopdf. My application has a few WFS layers from openlayers and geoserver only (no WMS). So is printing possible from the above two methods or not?

Also, I would like to add that I am using OpenStreetMap (OSM) as baselayer.

Actually, I am requesting mapfish printing (integrated with geoserver) service through url. Through my URL, I am getting wms layer in print out but not osm layer and also if you can tell me how I can request for geojson wfs layer through url?

Mapfish printing working properly and this is my info.json details:

{"scales":[{"name":"1:25,000","value":"25000"},{"name":"1:50,000","value":"50000"},
{"name":"1:100,000","value":"100000"},{"name":"1:200,000","value":"200000"},
{"name":"1:500,000","value":"500000"},{"name":"1:1,000,000","value":"1000000"},
{"name":"1:2,000,000","value":"2000000"},{"name":"1:4,000,000","value":"4000000"}],"dpis":
[{"name":"75","value":"75"},{"name":"150","value":"150"},
{"name":"300","value":"300"}],"layouts":[{"name":"A4 portrait","map":
{"width":440,"height":483},"rotation":true},{"name":"Legal","map":
{"width":440,"height":483},"rotation":false}],"printURL":"http://xxxxxxxxxxxx.xxxxxx.xxx:8080/geoserver/pdf/print.pdf","createURL":"http://xxxxxxxxxxxx.xxxxxxxx.xxx:8080/geoserver/pdf/create.json"}

Details for osm layer which I am requesting in url is:

{"baseURL":"http://tile.openstreetmap.org/",' +
          '"opacity":1,' +
            '"singleTile":false,' +
            '"customParams":{},' +
            '"type":"OSM",' +
            '"extension":"png",'+
            '"tiled":"false",'+
            '"tileSize" : [256, 256],'+
            '"maxExtent" : [-20037508.34,-20037508.34,20037508.34,20037508.34],'+
            '"resolutions" : [19567.87923828125],'+
            '}],' +   //am getting error,could not be able to fetch tiles 404 error.

One more thing I would like to ask: is it feasible to have the same screenshot (display) on pdf which the user can see at that moment in browser and click for print request? Since I am using the service and reading it from server side, how can I get the pdf of what the user is seeing in client side if this is possible?


texts:
I enjoyed Avenza Maps until recently...

After their recent move to a subscription model, I am in the market for a comparable app.

Feature requirements:

Load Geospatial PDFs
Capture photos along point data
Does not have to be free, one-off fees qualify (up to 100$).
Platform is iOS, Android if applicable.


texts:
I have a SHP file and a DBF file that has an attribute table with a column for elevation.  Through command line how can I make this these elevations visible when I view the shapefile?

I would like to overlay a shapefile over map to create a topographic map.

I do not want to do this using a GUI.

Update:
I would like to use the tools provided with OSGeo.  This for example is what I want but I'm doing it through QGIS GUI.  Blue is my shapefile, it then created labels (in black) based on my DBF.  I'm pretty sure QGIS uses GRASS commands but I am unsure of how to do this.

I have a file with lots of data like below, but I don't know how to actually overlay it over my shapefile.


texts: QGis import partial PostGIS layer using query builder

texts:
I'm sorry, but I'm terribly new to the GIS scene (and PostGIS & QGis). I have loaded a whole bunch of OpenStreetMap data into a PostGIS database and successfully drawn a map using Mapnik. Now I want to explore the data in my PostGIS database using QGis.

I have successfully connected QGis to my remote PostGis DB and QGis lists the OSM tables. The query builder also displays all sorts of OpenStreetMap attributes and values.

My issue comes when clicking the "Add" button: I assume that QGis is trying to load the complete DB table, this step takes very long (and could be eating a lot of expensive South African bandwidth). I am really just interested in my tiny university campus for testing purposes. I don't yet know how to use the query builder to limit QGis' DB query to a certain latitute/longitude bounding box.

The QGis user manual wasn't helpful to solve this nooby question, sorry.
Thanks!


texts: Multiple layer data in one delimited text layer

texts:
I am a GIS beginner.

I'm exporting several point coords from a Mysql database, and importing into QGIS using delimited text layer.

I need to plot all the points and set the symbology to distinguish them accordly

This is my dataset:

The thing is, that each point has two values to plot (amount and growth) and they have to be grouped by category (in this case weed).

One approach that i was taking was create rule based symbology, eg: one per weed type and amount value. But i think this is not viable, because i have multiple combinations.

Other approach, was to split the dataset. One per weed type. But also not viable.

Is there a better way?

Can QGIS take one delimited text layer and split and import several layers based on some param?

I've tried the Split vector layer tool, but no auto import. Only split.

Maybe with some virtual layers?