texts: Unable to use Map Service in Web App Builder

texts:
I've published a symbolized data set as a Map Service from ArcMap to my company's Server. I've successfully added this service to our ArcGIS Online account, using the "Add Item from Web" function and pointing to the REST url of the service hosted on the server.

From there, I created a Web Map in AGOL that properly displays the uploaded map service. In the Web App Builder under Map--> Choose Web Map, I chose the aforementioned web map. The app will load for about 30 seconds, but fails to display the map. All that is shown is the initial base map. The Web Map title (AK_Field Map) and description are visible under the "Map" tab after I attempt to upload it, but there no data is displayed.

I've been able to create a Web Map using a published feature service, then successfully reference that Web Map in the Web App Builder. However, I want to be able to use a Web Map that displays a Map Service, not a Feature Service. Is this currently possible in the App Builder?


texts: Why do geometries disappear after having applied ST_Union

texts:
I applied ST_Union on my set of about 2000 geometries in order to get 12 distinct areas. As a result, I obtained (probably) WKB format that I'm still not able to use in order to get some interesting results.

Why?

What's the reason behind the vanishing geometries from CARTO? And why are they only obtained as WKB after exporting them to a .csv file? Why CARTO doesn't keep them so that I can visualize them simply on a map?

I have one, big table of data: https://skogenskonung.carto.com/dataset/dd1
The table depicts the results of the election in Berlin. There are, among others, geometries, Berlin's districts, number of people who voted, amount of votes each party has received etc.

What I want to do is to divide the data according to the column awk (awk are electoral districts), so that I have 73 rows (there 73 distinct awks). What is also important is that I want to have 73 geometries that depict these awk.
So I executed the following query:

SELECT ST_Union(the_geom), SUM(right_afd) AS afd, SUM(right_cdu) AS cdu, SUM(right_wahler) AS waehler
FROM dd1
GROUP BY awk

What I obtained in the column geometry seems to be empty at first. When you hover at it, it says it is a polygon. When I export the result to the .csv file I see very, very long sequence of numbers and capital letters.
When I click on "create map" out of the result of this query, it gives me: "The column 'the_geom_webmercator' doesn't exist."


texts:
I am using python, arctoolbox and arcpy 10.0

I am running a script that is tied to an arctoolbox. The toolbox serves to enter in my parameters. I have a feature layer as an input. The feature layer has the .dbf, .prj. shp, etc files.

I am trying to create an output shapefile. The output toolbox parameter is a shapefile. It generates a .shp, .xml, .dbf, but NOT a .prj file

I tried the following code to get the .prj file from my input file to also be included in the output file.

# Toolbox Parameters
# Gets input file
_in_polyline_m_layer = arcpy.GetParameterAsText(0)
_ResultFile = arcpy.GetParameterAsText(6)

spatial_reference = arcpy.Describe(_in_polyline_m_layer).spatialReference
# Creating my output file
arcpy.CreateFeatureclass_management(out_path, out_name, 'POLYGON', spatial_reference)

I keep getting this error: Error 000623: Invalid value type for parameter template. Not sure if the problem is within my script or in the actual toolbox. Any ideas or suggestions would be greatly appreciated. THanks in advance


texts: Converting NEAR results to Meters/Kilometers?

texts:
I am having trouble figuring out how to convert the units from the results of my NEAR calculations.

I want to convert them to meters or kilometers, but cannot figure out how to do so...

Explanation: The Linear Units for all of my shapefiles and Data Frame are "Meters" so I am not sure why it is not calculating in meters? The real distance (as measured from Google Maps) in the highlighted row should be about 500 meters, but it is only returning 28?


texts:
I have a multi polygon with spatial field layer with and 3000 records and I want to use dissolve all in 1 record.
On DISSOLVE algorithm in QGIS you have a choose to dissolve all features from layer that I want with PostGIS.
After the query I want to have one record and this record have all.
I test this query :
SELECT (ST_Dump(ST_union(geom))).geom::geometry(POLYGON,2100) FROM public.parcel1

but don't work; don't create me one record with all features.
What have I done wrong?


texts: Plotting points that have relative coordinates rather than total station coordinates on map?

texts:
I have about +100 points of various descriptions from an archaeological survey. They are the backlog from years of excavations BEFORE systematically using Total Station at the site. For each artifact I have the upper and lower elevation data, in addition to the distance from either the NE, SE, SW, or NW point of the grid square. The location was recorded using two meter tapes from two points intersecting at the point of the artifact. The Excel file I have records the grid corner point and the distance from that corner to the artifact (ID1 and Radius1, ID2 and Radius2).

First, I need a method that will help me systematically upload the points. How do I arrange my Excel file, and what do I do in QGIS to get it plotted properly?

Second, I want to be able to answer questions of spatial relations based on elevations.Is there something special that I need to do for the input of the data in the .csv file?

I'm new to QGIS.


texts: Mobile GPS location and CAR GPS location showing different outcome

texts:
I want to make a CAR positioning system. I wrote a program which can show me the coordinate locations on a map.

But when I get coordinates from MOBILE GPS and from CAR GPS, they both differ.

Why do they differ?

How can I resolve this problem?


texts: Why feature.shape can't use multipoint type?

texts:
IPointCollection pointcollection = new MultipointClass();
                p.PutCoords(x.lon, x.lat);
                pointcollection.AddPoint(p);
                IGeometry geometry = pointcollection as IGeometry;
                 featureBuffer.Shape = geometry;//error here This geometry
                                                   type is not supported

If I want to add lots of point features, what else can I do?


texts: Using gdal.Warp cutlineSQL option in python?

texts:
I want to use the gdal.Warp method with python (doc). I have seen a cutlineSQL option which would be nice for my case since cutlines are stored in a PostGIS table but I can not find the syntax for this parameter.

How to tell gdal which database connection to use?

Or maybe I misunderstood the meaning of this parameter?

How to provide a cutline to Warp method then?

option not presented in the warp tutorial neither.

What I have so far :

from osgeo import gdal
from osgeo.gdalconst import GA_ReadOnly

# input dataset
dataset = gdal.OpenShared(path, GA_ReadOnly)
raster = dataset.GetRasterBand(1)

# warp options
db_conn = """PG:"host=xx.xx.xx.xx port=5432 user='xxxx' password='xxxx' dbname='xxxx'" """
warp_opts = gdal.WarpOptions(
        format="GTiff",
        cutlineDSName=db_conn,
        cutlineSQL="SELECT cutline FROM table WHERE id_1",
        cropToCutline=True,
    )

# warp
res = gdal.Warp("test.tif",
                 raster,
                 options=warp_opts,
             )

Producing the error :

ERROR 1: PQconnectdb failed.
invalid connection option ""host"

ERROR 1: Cannot open PG:"host=xx.xx.xx.xx port=5432 user='xxx' password=XXXXXXXXXX dbname='xxxx'" .

While ogrinfo with the same paramters is working.

If I try to remove some quotes in db_conn like this :

db_conn = "PG:host=xx.xx.xx.xx port=5432 user='xxxx' password='xxxx' dbname='xxxx'"

I end up with a seg fault...


texts: Dissolving polygons by specific field, but only neighbors polygons

texts:
I have a polygon layer and I want to dissolve the polygons according to a specific field. But I want sth extra. I would like to dissolve only the neighbours polygons. For example, look at the below image.
I would like the marked polygons with a red pen to be different features.

Is there any possible way? I use QGIS but any answer in ArcGIS is acceptable.


texts: Creating a Polygon by clicking on a website embedded Google Earth

texts:
I have to create a Polygon on Google Earth which is embedded in my website as it is made in the Google Earth application. I managed to create a polygon already but i can only create it with the javascript file but i need it to function like in the application.

Can anybody help me?

I searched a few hours for a solution but i couldnt figure out how to do this.


texts: Finding median value of many points within polygon using ArcMap

texts:
I am using ArcMap version 10.7.
I have 2 layers, one point and one polygon (council district boundaries). The polygon layer has several polygons in it and each point has a dollar amount associated with it. I am trying to find the median $ for each polygon. I tried a spatial join and setting the Field Map option for the $ to median but the output is $0 for all council districts.


texts: Creating one raster with paletted categories from a raster stack

texts:
Basically, I've stacked a few rasters in R, and I want to create a climate classification map. I have a stack of rasters that have temperature and precipitation information. I want to make one raster map that has distinct climate zones using this data. For example, maybe one zone has an average temperature for more than 24 degrees celsius and an average annual precipitation of less than 250mm, while another one has average temp of 6-12 celsius with more than 500mm of precipitation.
How do I create these one raster with distinct climate categories such as these?


texts:
I am using arc 10.4.1, I am having trouble adding the environment settings into my script.  I want the user to set the environment, without having to hit this button and setting it:

I have attempted:

env.workspace = arcpy.GetParameterAsText(0)

It runs fine, but exports to the folder outside the one I set.


texts: MCP Home range analysis alternative to Animove in QGIS

texts: Can some recommend to me a plugin for doing a MCP/Kernal density and grid cell analysis for home range analysis, one that is not Animove, because I have problems with setting Animove up, which is already mentioned in another question.


texts: Import csv with x y coordinates in QGIS 3 modeler

texts:
In the modeller, I can't find a way to import a csv that has lat/long values and bring this in as a spatial file?

What am I missing?


texts: Adding points every 200m along centre line of new road and rail corridors using ArcGIS for Desktop?

texts:
i have Created a point shapefile and want to add points approximately at every 200 m along the centre line of the new road and rail corridors.

after that i want to add field ID to the attribute table and give id to each point.


texts: GeoServer and GeoExplorer issues setting up per-layer security

texts:
I can't get per-layer security working...

I have the following set up:

A user USER, with no group membership and one role EXAMPLE_ROLE and a password
the role has no parent role and no properties
under data security I have:

..r set to *
workspace.mylayer.w set to EXAMPLE_ROLE

All the services security is set to . *

But, when USER logs in to geoexplorer's saved map with mylayer in there, USER can edit, but saving returns the error message "{server}mylayer is read-only.

If I set the second secirity to workspace.mylayer.w * then that user can edit.

What's going on? What am I missing?

EDIT: using version 3.1 of OpenGeoSuite, GeoServer 2.2-SNAPSHOT

EDIT2: on looking into it further, I noticed that I don't get the login button on geoexplorer. I also get this error on Chrome's console:

Failed to load resource: the server responded with a status of 404 (Not Found) http://tobler-v:8080/geoserver/rest/imports

and I wonder if this is something related to this: GeoExplorer provokes "401 Unauthorized" request and lacks login


texts: Highlighting polyline features in mapbox-gl.js

texts:
I am trying to use the following code to highlight features under the mouse pointer.

The difference between my geojson data and the geojson data used in the linked example is that the example is made up of polygons whereas my geojson is made up of polylines.  I have tried to modify the code accordingly in order that lines are highlighted however it does not work.
My geojson is accessible here:

http://iskandarblue.github.io/mapbox/data/prototype2.geojson

Any advice on what needs to be changed?

Example:
https://www.mapbox.com/mapbox-gl-js/example/hover-styles/

<!DOCTYPE html>

<meta charset=utf-8 />
<title>HTML markers from geoJSON url</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.css' rel='stylesheet'/>


texts: Dealing with Overlapping Coordinates in Statistical Analysis?

texts:
I decided to make an archaeological map about certain tombs distributed in the area of Crete and make some statistical analyses using the spatial statistical tools of GIS.

Specifically, I'll be using the nearest neighbor analysis to find out whether they are clustered and a Kolmogorov-Smirnov test to examine their relation to their elevation. I was faced with a dilemma - for several tombs the coordinates were exactly the same. Now this could have happened because they were constructed very close to each other and the GPS did actually capture the same numbers or the archaeologist who did the survey thought he should just take one point for the whole cemetery.

How can I deal with this problem?

Would it be wrong if I performed the test using more than once the same coordinates?

The maximum is three tombs having the same coordinates.


texts: Comparing data from two different time periods

texts: I am trying to compare DWI frequency over the period of 3 years. I want to create 3 maps, with each one showing where DWI's occurred during 2011, 2012, and 2013. I have the point data for this, but I am unsure on the best way to display it.


texts: Cut-and-fill, will my method output a valid result asumming absolute DEM accuracy?

texts:
I'm using QGIS and have to calculate the cut-and-fill volume given a new topography profile. Right now, I have both elevation data (old and new) in DEM with projected CRS.
I've tried using zonal statistics from this link however the result seems off by two magnitudes. Using the raster difference logic outlined in that tutorial, I tried improvising and using this step:

Clip DEM OLD and DEM NEW to a specified shape
Calculate the difference of DEM OLD - DEM NEW using raster calculator
Calculate the surface volume above zero using Raster analysis -> Raster surface volume to find the cut volume and vice versa

The result is much more logical than the first, however, I cannot empirically prove both calculations. I need to know which method is theoretically correct or are there any easier way to calculate cut-and-fill using QGIS.
Thanks!


texts: Is there a map-level event to signal the start/end of drawing?

texts:
In OpenLayers, is there an event which fires when the map starts drawing any layer, and another for when the map has finished drawing all layers?

I wish to display a "waiting" animation while any layer is still drawing.

The help file for LoadingPanel mentions something which sounds promising, but the sample doesn't work and it mentions tiles (I'd like it to work on vector layers too).

I'm looking for the equivalent of dojo.connect(map,"onUpdateEnd"... in the ArcGIS JS API:

  Fires after layers that are updating their content have completed.
  This event is often used in combination with onUpdateStart to display
  a "Map is busy" or "Loading? " message as visual feedback to the
  end-user.

(As a workaround, I could count the layers in the map, and monitor the status of each layer using layer.events.register("loadend"... until they have all finished. Are there other options?)

Thanks


texts:
I have a tiff raster dataset serving as cost raster, created a start point and destination point serving as feature source data for performing COST PATH in ArcMap 10.4.

Since the tiff raster layer contains no attribute table, I performed INT to get one. However, this new-made attribute table does not contain the value for each pixel.

I have also performed RASTER to POINT to get the value of each pixel. But I cannot join this table to INT attribute table.  I am wondering if this is the reason I failed to get a normal result of COST DISTANCE  and COST BACKLINK.

Besides, I have already tried performing PATHWAY in IDRISI. But it failed too.


texts: Retain field name alias in feature class when exporting to shapefile

texts:
I have a feature class in a geodatabase which I've joined a table to.  The table which was joined has field names >10 chars.

I will then need to export the feature class to SHP and once completed, the exported SHP will truncate any field names (and corresponding alias') >10 chars.

Does anyone know of a workaround/script that can retain/preserve field name alias' when exporting from feature class to shapefile?


texts: Can colon (":") character be used in shapefile field names?

texts:
I am trying to find out if the : character is allowed in the name of ESRI's shapefile field.

I googled, but I couldn't find an answer. Here is an interesting quote from the article from ESRI FAQ stating:

  Eliminate any characters that are not alphanumeric character or an
  underscore.

Does this mean that the : character is not allowed? Or is it allowed to use it, but it is recommended not to use it? If yes, then why?


texts: How to update symbology without loading all symbols into TOC using ArcPy?

texts:
I am using ArcMap 10.0  Service pack 5.
(government computer, no choice here). I am trying to automate a common mapping task...

I have a clipped layer (SoilsClipped - which has maybe 4 or 5 categories), and a layer with the symbology I want to use (SoilsSymbology - approximately 100 categories).

My goal is to get the clipped layer (SoilsClipped) to display in 50% transparent, Unique Values/many fields Color ramp, and a certain style of label. So I use:

arcpy.mapping.UpdateLayer()

With "False" for the symbology only parameter. (this seems to be the only way to get the 50% transparent and labels that I want)

This then resets the data source... so I reset it. But now I have ALL the symbols from the SoilsSymbology layer in the TOC, most of which aren't used in my SoilsClipped layer.

Is there a workaround for this? It looks like I would have access to other properties in 10.1 and upward that would make this method obsolete, but I can't figure out how to do this in 10.0.

Here is the code I am using right now...

cLeft,cRight = lyrSoils.dataSource.rsplit("\\",1)
cRight = str(lyrSoils.datasetName)

# set display properties
arcpy.mapping.UpdateLayer(dfPlanView,lyrSoils,lyrSoilAttributeSource,False)

#arcpy.ApplySymbologyFromLayer_management(lyrSoils.name, lyrSoilAttributeSource)

# re-get layer pointer, it gets messed up with updatelayer
lyrSoils = arcpy.mapping.ListLayers(mxdCurrent,"Soils Map")[0]

# fix data source
lyrSoils.replaceDataSource(cLeft,"SHAPEFILE_WORKSPACE", cRight)


texts: Reclassify in python doesn't reclassify things

texts:
I'm trying to reclassify the pixel values of NLCD_2011 data to a binary representation of developed vs. undeveloped land.

    import arcpy
    arcpy.CheckOutExtension("Spatial")

    nlcd = ('file path for the layer file')
    binary_landcover = ('destination file path')

    remap_value = "RemapValue([[11,0],[12,1],[21,0],[22,0],[23,0],[24,0],[31,1],[41,1],[42,1],[43,1],[51,1],[52,1],[71,1],[72,1],[73,1],[74,1],[81,1],[90,1],[95,1]])"
        # 11 Open Water
        # 12 Perennial Ice/Snow
        # 21 Developed, Open Space $
        # 22 Developed, Low Intensity $
        # 23 Developed, Medium Intensity $
        # 24 Developed, High Intensity $
        # 31 Barren Land
        # 41 Deciduous Forest *
        # 42 Evergreen Forest *
        # 43 Mixed Forest *
        # 52 Shrub/Scrub
        # 71 Grassland/Herbaceous **
        # 81 Pasture Hay **
        # 82 Cultivated Crops ***
        # 90 Woody Wetlands 000
        # 95 Emergent Herbaceous Wetlands 000
    #temp2 = Reclassify(nlcd, "VALUE", remap_value, 'NODATA')
    #temp2.save(binary_landcover)
    arcpy.gp.Reclassify_sa(nlcd, 'VALUE', remap_value, binary_landcover, "NODATA")

I've tried doing this, in python, using the 'Map Algebra' method, which ESRI documentation seems to deem preferable, and by just calling up the reclassify function. With both approaches the same thing happens, the function runs as expected, but when I load the output, it seems like the actual pixel values aren't changed. The only difference I can see is that the only remaining field is the field I targeted for remapping.

I tried doing the same thing in ArcMap, and it worked successfully.

I can't figure where I am going wrong trying to recreate my successful manual execution of the task in python.


texts: How to join edge of International Date Line in world file?

texts:
I am currently using world file (http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) for international boundary information.

Now I have difficulty with map projection that the map ends with International Date Line (IDL). Can anybody help me with method to join IDL together so that the projection of the map looks like google map where IDL is joined (like this-> http://gyazo.com/cd63a04362b844a728ad5b082a5bf532.png).

Thank you for help.


texts: web map creation features attribute table with alleged problem

texts:
I created a web map with QGIS2WEB . But when I generate the web map through the OL3 the column name is represented by integers. In the leaflet option , the column name is represented correctly, but the information for each column are represented as undefined.
Why does it happen?


texts: How to make all fields visible in layer properties?

texts:
In the layer properties and tab fields, I want to make all fields visible!

import arcpy
lyrXul = arcpy.mapping.Layer("Limits")
field_info = arcpy.Describe(lyrXul).fieldInfo
for i in range(0, field_info.count): field_info.setvisible(i, "VISIBLE")
arcpy.RefreshTOC()
arcpy.RefreshActiveView()


texts: Read file geodatabase feature classes using Python GDAL

texts:
I have a file geodatabase that contains polygons as feature classes. Here is the description of my dataset. It contains vegetation data for each polygon.
I have found this Python script online that reads the domains from the geodatabase. And this seems to work fine.
from __future__ import print_function
import json
import xml.etree.ElementTree as ET
import ogr

gdb_path = r'S_USA.EVMid_R05_CentralCoast.gdb'
ds = ogr.Open(gdb_path)
res = ds.ExecuteSQL('select * from GDB_Items')
res.CommitTransaction()

for i in range(0, res.GetFeatureCount()):
    item = json.loads(
        res.GetNextFeature().ExportToJson())['properties']['Definition']
    if item:
        xml = ET.fromstring(item)
        if xml.tag == 'GPCodedValueDomain2':
            print(xml.find('DomainName').text)
            print(xml.find('Description').text)
            print(xml.find('FieldType').text)

            for table in xml.iter('CodedValues'):
                for child in table:
                    print(child.find('Code').text, child.find('Name').text)
            print()

        if xml.tag == 'GPRangeDomain2':
            print(xml.find('DomainName').text)
            print(xml.find('Description').text)
            print(xml.find('FieldType').text)
            print(xml.find('MinValue').text)
            print(xml.find('MaxValue').text)

But I want to view each separate polygon and its associated attributes (including the boundary of the polygon itself) so that, given a coordinate, I am able to view the bounding polygon and therefore fetch the vegetation data associated with a given coordinate. Apologies if my terminology is wrong, I am new to GIS. But as I understand, I wish to view the feature classes. How can I do this using Python GDAL?


texts: Using ee.FeatureCollection.iterate makes object too large for exporting

texts:
I'm having issues with using iterate on a featurecollection.
I have reason to believe that one of my methods downstream is duplicating elements, so I want to assign sequential integers to my rows to keep track of them and to ensure that there are no duplicates being added.
However, the only changes that I'm making is this integer row. When I do this and try to export this FeatureCollection, the API returns the error that the object is too large.
I'm using the iterate function to assign the sequential IDs. To test, I mapped a function that added a random number to the ID column, and the asset had no problem being exported. So I think something is wrong with the iterate function below:
nhd = nhd.sort('AreSqKm', false);
var first = ee.List([ee.Feature(null, {"N": -1, "Remove": true})]);

//Add these IDs to each image.
var addID = function(feat, list){
  var num = ee.Number(ee.Feature(ee.List(list).get(-1)).get("N"));
  feat = ee.Feature(feat).set({"N": num.add(1)});
  return(ee.List(list).add(ee.List(feat)));
};

//Iterate through and add ID, Merge to images.
var tl = ee.FeatureCollection(ee.List(nhd.iterate(addID, first)));
nhd = tl.filterMetadata("Remove", "not_equals", true);

Export.table.toAsset({
  collection: nhd,
  description: "NHD_addID",
  assetId: "NHD_addID"
});

Any time I try this, I get the error "Error: Encoded object too large", and a google search does not help too much in finding a detailed explanation. Am I messing something up with the .iterate function?


texts: OpenStreetMap baselayer of just one country

texts: In Leaflet map I want to have like you see above an OSM baselayer with only one country the rest of the world has to be just a blank, only with international border. How can we create this? which URL of tillelayer give us this result?


texts: Can I export all print composers at the same time?

texts: I have quite few different print composers. Can I somehow export them to pdf, one pdf for each composer,  at the same time?


texts: Entering UTM Map Coordinates when georeferencing is not working

texts:
I'm trying to enter UTM map coordinates from a scanned image (grid), and I'm entering the coordinates correctly X/Y, but when I click to process the georeferencing - the image does not overlay where it's supposed to.
I've converted the UTM coordinates to LAT/LONG and entered those instead, which worked fine! I'm wondering if QGIS' georeferencing application does not accept UTM cords? What am I doing wrong?


texts: How to calculate average slope in a grid?

texts:
This is actually a two part question:

Which methods are there to calculate average slope by unit (say km²) for a given area? Are there any special requirements on the data - like additional information besides height measurements?
Which open source GIS implement methods usable to calculate average slope on a grid (e.g. TIF file)?


texts:
I have a free shaped polygon. Now I draw a smaller polygon inside with a same form i.e buffer zone with negative width. Then put a point with in my buffer zone center. Its looks like this:

OK. But now I add a buffer zone with positive width and put a point in centre. I get:

You see that one point lies on another point. Its no good I want to see both points.

Sure I can just move a point from centre away but if I do I will have a polygon with strange shape that can go beyond the boundaries.

Can you give an advice what to do?


texts: Hotkey in ArcGIS for Desktop to delete layer from Table of Contents?

texts:
I'm using ArcGIS 10.2 for Desktop and wish to remove/delete a layer from the Table of Contents.

I cannot find such hotkey. I have tried the DELETE button but that does not do it.

Also such hotkey is missing in the ArcGIS Help.


texts: Assigning points which are very close to the boundary when polygons share boundaries?

texts:
For traffic crashes, the data points are mostly mapped on roadways. Meanwhile, Census uses roadways (centerlines) as boundary for geographic areas like ZIP Code Tabulation Areas (ZCTAs).

I'm trying to calculate how many crashes occurred within each ZCTA. The problem is, crashes occurred on the same roadway segment will be allocated by GIS to different ZCTAs depend on which side of the roadway centerline (ZCTA boundary) the crashes were mapped at. Even 0.1 feet difference could lead to different result.

I thought about creating a buffer to assign crashes occurred on one roadway segment to all the ZCTAs which use that roadway segment as boundary. However, there is a concern that these crashes will be overly represented in this case. I'm looking for a way to address this problem which making statistical sense.

I couldn't find any literature on this topic. Maybe the keywords I used were not typical.

How would you address this problem or do you know any existing studies on this topic? I feel this should be a common problem.


texts: MODIS L2 (OC,SST...) netCDF4 via array to Geotiff - distortion problem with Python

texts:
I am struggling with the conversion of a subdataset of MODIS L2 .nc files.
I have i.e. a MODIS L2 OC file and want to extract one subdataset like clorophyl (chlor_a) and convert it to a Geotiff file.
Below my script Im using now, but which results in a distortion of the geotiff.
What am I doing wrong? Here a link to such a file (A2016216035000.L2_LAC_OC.nc)
Link to an example MODIS file

import numpy as np,shutil
from netCDF4 import Dataset
import numpy as np
from osgeo import gdal
from osgeo import gdal_array
from osgeo import osr

filepath = r"Z:\rasterdata\modis\test\OC_Test\raw\_4_A2016216035000.L2_LAC_OC.nc"
dataset = Dataset(filepath,"r")
gd=dataset.groups['geophysical_data']
nav=dataset.groups['navigation_data']
lons = nav.variables["longitude"][:]
lats = nav.variables["latitude"][:]

flags= gd.variables["l2_flags"][:]

lat=np.array(lats)
lon=np.array(lons)

for row in flags:
    Data=[]
    EineReihe=row
    for Element in EineReihe:
        BinNum=bin(Element)
        if BinNum[-2]=="1":
            Data.append("1")
        else:
            Data.append(np.nan)
    if RowCount==0:
        A=np.array(Data)
    else:
        A = np.vstack((A, np.array(Data)))
    RowCount+=1

xmin,ymin,xmax,ymax = [lon.min(),lat.min(),lon.max(),lat.max()]
nrows,ncols = np.shape(A)
xres = (xmax-xmin)/float(ncols)
yres = (ymax-ymin)/float(nrows)
geotransform=(xmin,xres,0,ymax,0, -yres)

output_raster = gdal.GetDriverByName('GTiff').Create(r"Z:\rasterdata\modis\test\OC_Test\_4_y.tif",ncols, nrows, 1 ,gdal.GDT_Float32)  # Open the file
output_raster.SetGeoTransform(geotransform)  # Specify its coordinates
srs = osr.SpatialReference()                 # Establish its coordinate encoding
srs.ImportFromEPSG(4326)                     # This one specifies WGS84 lat long.

output_raster.SetProjection( srs.ExportToWkt() )   # Exports the coordinate system
output_raster.GetRasterBand(1).WriteArray(A)   # Writes my array to the raster

output_raster = None

In the for loop, this code example should extract the Land mask to (land =1) Water =nan - just to have a better reference to check the result.


texts: Error 000177: Failed to create relationship class in Python

texts:
I am trying to use python to create a relationship class between a feature class and dbf.  I keep getting,

  "ERROR 000177: Relationship classes can only be created in the same
  database that contains the feature classes or tables."

The solution seems obvious; however, I am certain that the feature class and dbf are located in the same geodatabase, as I have the tool test the existence of each feature and then print their paths to the geoprocessing window.

I've tried switching to UNC paths as well as building the relationship class in model builder and integrating it into my tool as a python script.  This is also a problem which arises both as a script tool with user input as well as with the hard-coded values.

Update: I should also mention that I am able to create a relationship class with these features in ArcMap.  It just isn't working in python.


texts: Determining Layer's DATUM and PROJECTION in "Layer Properties" (QGIS)

texts:
I have two layers in a QGIS project: "Layer 1" and "Layer 2".

In their "Layer Properties" under "Coordinate Reference System" I see this:

Layer 1

Layer 2

I'm trying to understand the differences between the CRS nomenclature.

Layer 1 is obviously projected, since it says UTM zone 20, but I'm left wondering what the datum is that it's based on?

Layer 2 tells me its datum = WGS 84, but I'm left wondering what its projection is?

It appears to me the various CRSs shown in both screen shots use various combinations of datums and projections terminology.  This appears needlessly confusing.  Only the bottom one appears to clarify both its datum (NAD83) as well as its projection (UTM).

New Question /Task:

Top marks to the one who can accurately describe the meaning of every component (word, number, punctuation mark, etc) in all 4 CRSs appearing in Layer 1, particularly so that the datum and coordinate system are clearly defined.


texts: How to make a new raster out of two other rasters

texts:
I have two raster images, one is the Corine Land Cover for the year 2000 and another one which is the anthropogenic effect on land. The first image reclassified in 9 categories:

Artificial surfaces
Agricultural areas
Forests
Scrub and/or herbaceous vegetation associations
Open spaces with little or no vegetation
Inland wetlands
Maritime wetlands
Inland waters
Marine waters

And the second image has seven categories:

Closed τree or shrub vegetation, canopy cover > 70%
Open tree or shrub vegetation, canopy cover > 40-70%
Scattered tree or shrub vegetation, canopy cover <40%
Bare of any vegetation area
Αbandoned fields, grasslands and scrubland zones of deciduous oaks and fir
Βrushwood
Cultivated areas

What i want to do is to built a new raster with the information from these two rasters.
For example i want to keep the information from "waters" from corine, and combine the information for Forests from corine and from the other raster the "Closed tree or shrub vegetation".

I need you help.


texts: How to calculate the bounding box of a GML/XML file from a WFS GetFeature request?

texts:
I would like to know if it is possible to get the bounding box from a geometry returned by a WFS service. An example of WFS feature request:

http://inspire.biodiversity.ro/ENVPS/GOPublisherWFS?service=WFS&version=2.0.0&request=GetFeature&TYPENAME=ps:ProtectedSite&featureid=ROSCI0065&

I am trying to create a simple web app that helps users without a GIS build valid WMS GetMap requests to generate maps of protected sites from my country.

The services are INSPIRE-compliant, the view service is a WMS Service (published from ArcGIS), and the data service is a WFS Service (published from GOPublisher).

Ideally I would like my users to select the criteria for generating a static map of the data, pass this filter to the WFS service, compute the bounding box of the data in question, and pass this bounding box as a parameter in the WMS GetMap requests.

I have read that JQuery has some XML parsing support, but maybe someone here can recommend a library/method that is more GIS?


texts: Displaying the attribute table with one vertical "row" in an Atlas QGIS

texts:
I have an attribute table in QGIS with many columns and just one feature. I want to display it in my atlas with the attributes showing vertically, otherwise it is off the page. Is there a way to do this?

Newest QGIS 3.10.2


texts: How to calculate square footage from multiple records into one field?

texts: I want to add up the square footage for each building floor and enter the total into another field within the same feature class.  Each floor has a different size and is a separate polygon with a unique ID.  The feature class stores multiple buildings.


texts: Seeking comprehensive list of latitude and longitude values for cities around world?

texts:
I'm developing an application that calculates the distance between cities using their respective Longitude and Latitude values.

But the problem is where to get a comprehensive list of latitude and longitude values of these cities?


texts: Resolving postgis "type geometry does not exist" issue on installing tiger_geocode extension?

texts:
I have installed postgis extension in my db.  I have few columns associated with its type in few tables and now I would like to use reverse geocode functionality in my app.  Hence I tried to create postgis_tiger_geocoder extension and I get the error as

type geometry does not exist

I tried to drop the extension and create it newly and it works. But I lose all my columns with the type

postgis.geography(Polygon,4326)
postgis.geography(Point,4326)

So, how can I repair or reinstall postgis extension without losing the columns and install the postgis_tiger_extension?


texts:
Searching for basemaps with more detail in large scale than those of ESRI, I found this one mapy.cz.
Is there a way to import this map service as a basemap in ArcGIS Pro or other similar detailed maps?


texts:
I am trying to setup a web map server on a CentOS 6.2 virtual machine for development.  I have never used Linux or web mapping frameworks, but I am trying to do this work as low cost as possible.  So far, I am having some difficulty determining how to install and configure all the packages I need.

Here are the packages I want to install:

Apache Web Server
Apache Tomcat? - is this necessary?
Geoserver
PostgreSQL/PostGIS
GeoExt?
Mapfish?

Has anyone had any experience with these packages in a Linux server?  Could you provide any advice or links for setting this up?


texts: How to change leaflet marker options dynamically?

texts:
I want to change the draggable state of leaflet marker on some event. Now, we use marker.options.draggable to get the draggable state of that marker. However, I want to set/change that draggable state in some event.

marker  = L.marker([lat,lng],{draggable:true});
draggable_state = marker.options.draggable;

But, below is not working:

marker.options.draggable=false;

How can achieve this?


texts:
I've got a style in Mapbox Studio which, like all styles, has composited my layers with Mapbox layers into a single set of vector tiles. I'd actually prefer my source data to be kept separate (so I can manipulate it with Mapbox-GL-JS).

Is there a way to disable the automatic compositing?


texts: Why a rectangle area is described as a 13-point polygon in a GML file?

texts:
I have the following field called 51A:

I have the following excerpt from the GML file where it describes the 51A field:

<gml:featureMember>
    <ogr:av_export_temp.ihkulroo fid="av_export_temp.ihkulroo.183">
      <ogr:geometryProperty><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-63613.5803279425,6594849.11111532 -63338.4982627596,6596691.79998076 -61065.5082310117,6596353.15340253 -58792.3850046138,6596015.89007513 -56519.1291541683,6595680.00990826 -54245.7412499302,6595345.51281189 -51972.2218618083,6595012.39869636 -52241.6978222727,6593169.17366796 -54516.3382854795,6593502.39409221 -56790.8473374676,6593836.99795894 -59065.2244085927,6594172.98535813 -61339.468928864,6594510.35638005 -63613.5803279425,6594849.11111532</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
      <ogr:Copyright>Fishdirectory</ogr:Copyright>
      <ogr:Zone>51A</ogr:Zone>
      <ogr:County>Rogaland</ogr:County>
      <ogr:Timereport1>2018/09/11</ogr: Timereport1 >
      <ogr:Timereport2>2019/08/31</ogr:Timereport2>
    </ogr:av_export_temp.ihkulroo>
  </gml:featureMember>
  <gml:featureMember>

The coordinate system used in the GML file is EPSG:25832 ETRS89 / UTM zone 32N

How come the field 51A, that is a basic rectangle, has so many polygon points to describe it? Should not there be just 4 corners?


texts: Uploading series of OS map sheets using QGIS and merging together?

texts:
I need to upload historic OS sheets in tiff format, and 'stitch' them together, as some districts are spread over a number of sheets.

I have no idea how to do this. Can anyone help?


texts: How do you choose the classifications on choropleth maps?

texts:
I find myself more and more struggling over defining break points when displaying choropleth (aka thematic) maps to view by others. Does anyone have any suggested references that help guide, both how to choose the type of scale used and the appropriate number of break points? In particular for the number of bins I have only ever seen arguments for a limiting number (e.g. you should not use any more than 5).

To be more specific about what I am looking for, most references I have come across about the subject are similar to the document referenced by julien in this post, and I'm just looking for a more in-depth discussion about the topic.

A few specific use cases I come across frequently (for examples of my struggles);

When displaying data that has a large right skew, I'm typically
hesitant to display an exponential scale. I fear (for the audiences I
am typically displaying maps to) this would cause a greater amount of
cognitive burden reading the scale and mapping actual attribute
values to the colors. Are my fears incorrect? Also for these types of
distributions I find it difficult to justify any particular number of
bins.
When displaying many small multiple maps, how do I choose an appropriate scale that allows one to visualize relationships effectively both within and between the small multiples? My de-facto standard when the attribute scales vary to a great extent is to use quintiles within each seperate distribution. Are quintiles too many classifications and creating too great a cognitive burden to compare between the panels? I assume people understand quantile classifications are equivalent to rankings (and thus when classed that way aids in interpreting between panels), is this assumption correct?

I initially wrote a paragraph trying to describe the goals of such maps, but I suspect my goals are pretty typical so it was unneeded. The only thing to clarify again is that these are for viewing by other people (like in reports, publications) and are not really for my own exploratory data analysis (although I would suspect good advice should translate to either). Perhaps a good reference may describe the potential goals of such maps, and trade-offs associated with using different classification schemes. I would be interested in both specific and general references.


texts: Compare two columns using Graphical Modeler in QGIS

texts:
I have a layer with several columns. One of them is called 'cod' and the other is called 'cod_2'. 'cod_2' is null, except for one row. I want to know if the numerical value of 'cod_2' is present in any row of 'cod'. I'll give you an example.

Cod Cod_2
1     NULL
1     NULL
18    NULL
3     NULL
42    18
42    NULL
7     NULL

18 is present in both columns, but not in the same row. So, I can't use

if("col"="col_2",1,0)

because it will return 0.

I've tried this solution (Comparing Column Contents in QGIS) but it's not working because I'm working with Graphical Moduler, thus I can't call the layer name. I've tried to use @layer_name but it didn't worked either.


texts: How to handle postgresql/postgis geometry type errors in a function?

texts:
I have created the following function in PL/SQL to make a polygon from a set of linestrings:

CREATE OR REPLACE FUNCTION _myfunction(
    _fid    integer,
    _rid    integer
    )
RETURNS VOID AS $$
BEGIN
    BEGIN
        INSERT INTO _data (fid, rid, cost, geom) (
        SELECT
        _fid,
        _rid,
        500,
        ST_ConcaveHull(ST_Collect(geom), 0.85) As geom
        FROM table_distance as d
        WHERE _fid = fid);
    END;
  END;
$$ LANGUAGE plpgsql;

I defined the table that this function inserts data into as:

CREATE TABLE _data (fid integer, rid integer, cost double precision);
SELECT AddGeometryColumn('_data','geom',900913,'POLYGON',2);

This function works most of the time, except when the result of making a concave hull around ST_Collect(geom) is a linestring, instead of a polygon. When a linestring is returned, I get the following error message:

********** Error **********

ERROR: Geometry type (LineString) does not match column type (Polygon)
SQL state: 22023
Context: SQL statement "INSERT INTO _data (fid, rid, cost, geom) (
    SELECT
      _fid,
      _rid,
      500,
      ST_ConcaveHull(ST_Collect(geom), 0.85) As geom
    FROM table_distance as d
        WHERE _fid = fid)"
PL/pgSQL function "_ncg_isodist" line 4 at SQL statement

I would like to disregard the result if a line is returned, but I'm not sure how to do this. I started off by nesting the block in a BEGIN END; statement, hoping that the function would not crash, but this does not solve the problem.

I then wondered if there was some way of checking either the geometry type that is returned, or some other feature of ST_Collect(geom) so that I know when a polygon has been created. I noticed the ST_Dump() function, but I can't figure out how to count the number of values in ST_Dump() in this query as I get the error message that aggregate function calls cannot be nested. Any thoughts on how I can solve this?

EDIT:

@simplexio suggested using GeometryType(ST_ConcaveHull(ST_Collect(geom), 0.85)) != 'LINESTRING' in the WHERE clause. I tried this, but got a similar error to earlier:

ERROR: aggregates not allowed in WHERE clause LINE 7: AND
GeometryType(ST_ConcaveHull(ST_Collect(geom), 0.85)) != 'LINESTRING'


texts: How do I convert shapefiles and display them on top of Google Maps?

texts:
I generated a set of maps of my region. Each municipality has some associated data.
I would like to overlay that data on a google map and display them in a website.
(I don't like the flash format)

Do you know any online services for the conversion of *.shp files into a format suitable with Gmap services?


texts:
I had assumed it was an error due to lack of space but no matter where we try to save it we get the folllowing error:

Traceback (most recent call last):
File "C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python/plugins\processing\algs\qgis\Heatmap.py", line 210, in processAlgorithm
self.tr('Could not create destination layer'))
_core.QgsProcessingException: Could not create destination layer

If the layers are different CRS's (even in a CRS that worked with version 2.16) it runs and saves in the right places but we just get a giant egg shape instead of the nice heatmap we had before. I understand this is due to the meters/degrees difference but still it runs so that's better than the layers which should be in the correct CRS which just error and don't run at all. If its a space issue why do the ones with the different CRS run but the correct ones not?

Any ideas?


texts: check particular feature exists using pyqgis

texts:
I want to check that a particular features exists or not in getFeature().

Suppose in attribute table I have ID, Name, CAT, and Type columns. Now I want to check that CATEGORY column is exists or not in features.

I use this but this is not working.

for poi in layerPOI.getFeatures():
    if "CATEGORY"  in layerPOI.getFeatures():

and this as well. It producing keyError

if poi["CATEGORY"]#As category not exists it giving error here


texts: Deleting only specific attributes (columns) by name in an attribute table in QGIS with Python

texts:
I am attempting to delete select columns for the final output of the attribute table that I'm creating.I'm having trouble with deleting the attributes (columns) that I want, regardless of their index position. The major issue is that the code is hard coded based on the field index.

I have looked at many answers on this site and other sources. I could not find one that answers this specific question. If there is such an answer please link it and I can remove this question.

I'm looking for the versatility in deleting all the attributes except for the ones that I want to show in the attribute table without relying on hard coded indices. I have attempted a variety of conditional statements but could not get it to work.

CODE
# Use a list to collect the index of the fields.
fields = []

# Get the index of each field and add it to list.
for field in huff_model.fields():
    idx = huff_model.fieldNameIndex(field.name())
    fields.append(idx)

# Remove the index of the field from the list for the field that you don't
# want deleted.
fields.remove(0)
fields.remove(14)
fields.remove(15)

# Delete the fields in the attribute table through their corresponding index
# in the list.
huff_model.deleteAttributes(fields)

With the current code if you don't already know the position of fields you don't want deleted, than this code doesn't work. Furthermore, if a future layer has a similar attribute table but with even one less or one more field (this assumption is valid given the work I'd doing), hard coding would completely mess up the results as the index of the fields that shouldn't be deleted wouldn't be the same as what is currently coded. Each time the number of fields change, the code would have to be updated which seems completely unnecessary (see above).
My assumption would be to only add the field index to the list if not named field x or field y or field z. However, I cannot get it to work outside of hardcoding the index through fields.remove("insert index of field you don't want deleted") to remove the index of the field from the list of indices that will be used to delete the corresponding fields from the attribute table.
The first image below is my attribute table with the field indices indicated by the arrows which are used in field.remove(). There are 16 fields in total, and I don't want to delete the first, fifteenth and sixteenth fields (0, 14, 15 corresponding indices) from the attribute table.
Table before code is run

The second image below is the same attribute table, but with all the fields deleted except for the first, fifteenth and sixteenth fields from the first image (0, 14, 15 corresponding indices).
Table after code is run


texts:
I am looking for a good way to work on GML files and would appreciate some personal experience. At the moment I am using nXML or SGML mode for Emacs but I wouldnt mind having an IDE/Emacs mode/... that is more specialized on GML files and could possibly render changes in real time. Support for large files (>15 MB) would be a requirement.

I am running Linux (Ubuntu 13.04) so native programs would be prefered, but I don't mind if Windows programs are mentioned.


texts: Trying to add feature to vector source but getting an error in version 5.3.5

texts:
I am following openlayers documentation and from this webpage:
https://openlayers.org/en/latest/apidoc/module-ol_source_Vector-VectorSource.html#addFeature
I understand that the features option can read input as a feature object or a collection. However both ways, I am getting errors.

Here's my code:

import {Map, View} from 'ol';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import Polygon from 'ol/geom/Polygon';
import Feature from 'ol/feature';
import VectorSource from 'ol/source/Vector';
import VectorLayer from 'ol/layer/Vector';
import collection from 'ol/collection'
import {GeoJSON} from 'ol/format';

@Component({
  selector: 'app-map',
  templateUrl: './map.component.html',
  styleUrls: ['./map.component.css']
})

export class MapComponent implements OnInit{
  Map: any;
  pointData:any;
  geometry: any;
  featureObject: any;
  center:any = transform([-97.30934, 32.7687988], 'EPSG:4326', 'EPSG:3857');
  layers:Array<any> = [
    new TileLayer({
      source: new OSM()
    })
  ];
  extent:any;
  vectorSource:any;
  vectorLayer:any;
  collection:any;

constructor() {
this.pointData = [[2433903.684, 13449511.792], [2402285.854, 13472141.717],
          [2367866.204, 13491472.411], [2335288.597, 13520605.690]];
this.geometry = new Polygon(this.pointData);
this.geometry.extent_ = [2314445.434787005, 13449511.792723179, 2501576.4506160878, 13586799.08540526];
this.featureObject = new Feature({name:"myFile", geometry:this.geometry});
this.featureObject.setId("myFile")
this.collection = new collection(this.pointData)
 }
}

Now if I create VectorSource by adding featureObject I am getting this error:

this.vectorSource = new VectorSource({format:new GeoJSON(), features:this.featureObject});

I am getting this error as if vector source needs a collection as input instead:

ERROR TypeError: collection.getArray is not a function
    at new VectorSource (Vector.js:262)

If I add feature using a collection like so:

this.vectorSource = new VectorSource({format:new GeoJSON(), features:this.collection});

I get the following error as if it needs a feature input instead:

core.js:9110 ERROR TypeError: feature.getId is not a function
    at VectorSource.addToIndex_ (Vector.js:348)
    at VectorSource.addFeaturesInternal (Vector.js:388)
    at new VectorSource (Vector.js:268)

when I use:

this.vectorSource = new VectorSource({});
this.vectorSource.addFeature(this.featureObject);
console.log(this.vectorSource);

vector source does not appear to take the feature:

VectorSource {disposed_: false, pendingRemovals_: {…}, dispatching_: {…}, listeners_: {…}, revision_: 1, …}
attributionsCollapsible_: true
attributions_: null
dispatching_: {}
disposed_: false
featureChangeKeys_: {36: Array(2)}
featuresCollection_: null
featuresRtree_: RBush {rbush_: rbush, items_: {…}}
format_: undefined
listeners_: {}
loadedExtentsRtree_: RBush {rbush_: rbush, items_: {…}}
loader_: ƒ VOID()
loading: false
nullGeometryFeatures_: {}
ol_uid: "38"
overlaps_: true
pendingRemovals_: {}
projection_: null
revision_: 1
state_: "ready"
strategy_: ƒ all(extent, resolution)
undefIdIndex_: {}
url_: undefined
values_:
__proto__: Object
wrapX_: true
__proto__: Source

Bottom line is that I am unable to create a vector source.


texts: MXD to PDF lines in PLSS are distorted in adobe PDF

texts:
Using ArcGIS 10.7, what is causing my Section lines to blur or darken and thicken as you can see in this jpeg example of mine?  I have tried different transparency percentages, moved the feature around in the TOC, etc.  I created a new .mxd as this just happened after doing a map update.
This is a screenshot of a PDF.  The lines on the mxd are fine, and I have no idea how to correct this.  A PDF issue?
ADDENDUM - I opened it up in BLUEBEAM (image on left of the thick gray line is Bluebeam) The distortions are not as severe but locations of distorted lines have changed.
#BLUEBEAM #ADOBEpdf #MXD #ARCGIS10.7


texts: Extracting point for polygons from shapefile - not working

texts:
I am trying to extract the lat long points for the polygons from a shapefile. I have followed the directions from the following links:

Getting list of coordinates for points in layer using QGIS?

How to extract geo data out of a polygon shapefile into CSV KWT

Example output:

OBJECTID    AREA    PERIMETER   AGENCY  NAME    REVDATE SQMILES Shape_Leng Shape_Area
1   0   0       Zone1   11/19/2014  0   237658.615  1531052792
2   0   0       Zone2   11/19/2014  0   739330.0369 7625960825
3   201487008   72063.20313 PF  Zone3   11/19/2014  231.6181139 985159.932 5260739790
4   0   0       Zone4   11/19/2014  0   1192796.221 15149531125
5   0   0       Zone5   11/19/2014  0   2040909.712 22577444695

So does this mean there are no lat/longs to extract?


texts: Updating a QGIS Python script for multiple machines

texts:
I've created a Python script to do some automatic processing within QGIS. The script was stored on the company server and anyone who wanted to use it went to 'add script from file,' did the processing and went about their day.

Fast-forward 6 months and I've now been asked to make some updates to the script. The problem is that 'add script from file' has made local copies of the script on the users' C:/ drive. If I update the script on the server, all the users would need to reload the script. The problem is that I have no idea who actually uses this script. Obviously, I can send a company wide email and get all users to update their script; however this solution seems less than optimal.

My question is: how can I create a sort of re-direct script that the user calls from within QGIS that in turn calls the script stored on server that I can edit? I've looked into import imp but it seems to skip the input parameters given in the server script, throwing a variable undefined error. I am therefore thinking that this issue is a QGIS specific problem, rather than a generic question on script wrapping.


texts: Loading line and multipolygons into QGIS on Raspbian GNU/Linux 10 (buster)

texts:
I try to load line and multipolygon shapefile layer to QGIS in Raspbian GNU/Linux 10 (buster) and it appear like this:

Although I use the same shapefile layer in Windows 10 and it load without any problem and it appear like this:

I'm using QGIS 2.18. Can anyone know where is the problem?


texts: ArcMap says there is no Object-ID field, but there is, even after exporting data as shapefile

texts:
Starting just a day or two ago, I have been running into the same issue every time I try to Display XY coordinates from a .csv file. When I add a .csv file, Display XY Data, I get an error that there is no Object-ID field (even though there is). I've even tried exporting the data as a shapefile afterwards, and I still can't edit any data in the attribute table. I can't figure out what to do.

Any tips or ideas?


texts: Workaround for Mean Coordinates in graphical modeler

texts:
I am searching for a workaround to build mean coordinates in graphical modeler since I have noticed a bug which I have reported here: https://github.com/qgis/QGIS/issues/35385

Basically, I just need to find the centroid for groups of points which shall be grouped by a field (like name). Unfortunately the algorithm does not work as intended in graphical modeler, so I have to do it another way. (Building the centroids outside the modeler and using these as input is the worst case workaround and should be avoided if possible).

I was thinking about building a convex hull and getting their centroids, but unfortunately this algorithm does not allow to build groups.

So I thought about Minimum Bounding Gemometry algorithm. I can build grouped convex hulls using this, but it throws back an error, if there are less than 3 points within a group.

I was also trying Geometry by expression and using something like centroid(collect($geometry,group_by:="name")) but with no luck.

Do you have any other ideas how to overcome this issue? It needs to work in QGIS 3.4 graphical modeler with points as input and also if there is only 1 point within a group. It does not have to be a mathematically perfect centroid, but should be within a range of, lets say, 10m of it.


texts: Color change when zoomed out large GeoTIFF (34gb from mosaic .ECW)

texts:
I have a large GeoTIFF (34gb, exported using ArcMap Copy Raster Tool). We had many troubles exporting the original .ECW mosaic map to a GeoTIFF with original resolution but a smaller extant.. Now the zoomed out map has a yellow coloured lower part of the map

When zoomed in yellow hue disappears and only original colours are shown... But only at a scale of +/- 1:600. Is this a wrong export? Or is there a way to fix this?

Maybe I should ask the government contact for a new exported GeoTIFF. This person uses ArcMap, what would be the best way (tool?) to select an extant of a full .ecw mosaiced picture in original resolution?


texts: Using UTM vs Degrees for calculating distance?

texts: I've been told that UTM is better for calculating distances on a map, however I can't see the reason for that, and I've got a lot of data that is not in UTM, so it would be good to know that I don't really have to worry about that. Is UTM more accurate than Degrees or something like that?


texts: How can I navigate from my current position to a specific point with OpenStreetMap data under Android?

texts:
How can I navigate from my current position to a specific point, using OpenStreetMap data, running on Android?
I also want to get updated current points until reaching the final point then navigation stops.


texts: Run query between PostGIS layer and Shapefile layer with DB Manager

texts:
Is it possible to use the DB Manager in QGIS (I am using version 3.4) to run a SQL query between a project layer (e.g. shapefile) and a PostGIS layer?

For example, I have a polygon shapefile in my QGIS project in the layers panel and I want to select all point features (saved in a PostGIS database but not loaded in my layers panel) that are within the shapefile polygon.


texts: Importing coordinates as CSV file, but points are not displayed

texts:
I use QGIS and I'm importing Lat/Long coordinates as a delimited text layer. The attribute table looks fine but the points themselves are nowhere to be found ('zoom to layer' doesn't point anywhere, so the points are not displayed at all).

In the same project, I have another shapefile with coordinates which is on the same CRS as the one I try to add now (Hartebeesthoek 94, EPSG 4148), and that one does display correctly.

If I opt for a different CRS, in some cases the same problem occurs (WGS 84, EPSG 4326) and in other cases the points are displayed (WGS 84 / UTM zone 49S, ESPG 32749) but in the wrong location, of course.

What is going on?


texts: Transforming arbitrary .prj to EPSG:4326 using GDAL for use with ogr_fdw

texts:
I'm looking for the correct method using GDAL (most recent trunk on Ubuntu) or its Python API to get the correct EPSG code for a given prj file WITHOUT relying on the prj2epsg webservice or any external webservice. To clarify, the solution needs to work on PRJ files that do NOT include the EPSG code within the definiton (which is, in my experience, nearly every shapefile out there) such as this one:

PROJCS["NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2296583.333333333],PARAMETER["False_Northing",9842500.0],PARAMETER["Central_Meridian",-100.3333333333333],PARAMETER["Standard_Parallel_1",30.11666666666667],PARAMETER["Standard_Parallel_2",31.88333333333333],PARAMETER["Latitude_Of_Origin",29.66666666666667],UNIT["Foot_US",0.3048006096012192]]

I'm connecting to these files using ogr_fdw in Postgres10/Postgis2.4. If there were some way to use ogr_fdw WITHOUT knowing the specific EPSG code for a given shapefile, I would accept that as an answer as well. I don't necessary need to know the source coordinate system -I'm just looking to transform to WGS84 when working with the data in postgis.


texts: how to highlight the points within a buffer radius

texts: i have created 1km radius buffer within that buffer few school points will come.how to highlight those points and how to retrieve that school data from database am using postgresql for db connection.


texts: Bootstrapping Reclassified Layers of Two Species in QGIS for Suitable Area Overlap

texts:
I have a very surface-level knowledge and familiarity with QGIS.
I currently have 30 reclassified QGIS layers of suitable area based off of 30 MaxEnt individual runs for 2 different species. All layers are reclassified to binary, with a 1 being suitable and a 0 being unsuitable area. The binary values are based on a logistic threshold value, and every layer has its own threshold value.
I am trying to find a way to use bootstrapping to get a distribution of suitable area overlap between the two species, with these reclassified layers as input. For example, having a random selection of any of the 30 reclassified layers of species 1 being paired with any of the 30 reclassified layers of species 2, then (because of the bootstrap) this would be repeated in order to generate multiple estimates of area of overlap (an area generated for each combination of the bootstrap). I'm looking to randomly draw one MaxEnt run for one species (that has now been reclassified in QGIS) and find the area of overlap with a MaxEnt run from the other species (also now reclassified), and then do that a bunch of times: the bootstrap. I would then use all of those results from the bootstrap to generate a distribution curve.
I have not seen any way to do this in QGIS (or bootstrap at all).
Do you have any ideas or help for me?
I am using QGIS 3.16.1-Hannover on MacOS.


texts: How to calculate Default Raster cell size in ArcGIS?

texts:
From this topic i want to know why we have to divide by 250? what is 250 means? where is form?
https://desktop.arcgis.com/en/arcmap/latest/tools/environments/cell-size.htm

The default cell size when a feature dataset is used as input to a
tool is the width or height (whichever is shorter) of the extent of
the feature dataset, divided by 250.


texts: Exporting .tiff georeferenced images in layout view using Python

texts:
I have square grids of about 1000 polygons and i want to export TIFF images of  each grid using a Python script, am having this below Python which gives me only .tiff images without referenced

mxd = arcpy.mapping.MapDocument("CURRENT")

for page_number in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = page_number
    print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
    arcpy.mapping.ExportToTIFF(mxd, r"C:\Temp\map_" + str(page_number) + ".tiff")

del mxd


texts: Loading NOAA Nautical Charts .bsb format into QGIS?

texts:
Is it possible to load a nautical chart from NOAA into QGIS that has the .bsb format?
Didn't have much luck with mrSID format.

using QGIS(dev) on ubuntu 13.04


texts:
Is there a possibility to create a multiline object from polygon object contours in ArcMap?

I found that Edit toolbar allows to create polygons from other shapes, but I couldn't find anywhere an option to create linear object from polygon.


texts: How do I construct a line from points that are out of order?

texts:
I'm using ArcGIS Pro and would prefer solutions using ArcPy, ArcMap, or ArcGIS Pro,  but an open source alternative may work too.

I'm trying to construct a line from a series of points using the Points to Line tool. This works well if the points are all in some sort of order as given by the attributes table or their ObjectID; but if points are added out of order, the line is then constructed out of order as well, as seen in the image below after using Points to Line. The intended image looks like a smooth 'S' curve. (This is a simple example based off of more complex multiple points/lines.)

Sorting by latitude or longitude doesn't always work either, since the line meanders back at times.

How do I construct a line from points based off of something like nearest point?


texts: ArcCatalog metadata XML importing errors

texts:
I am trying to add metadata to some layers within ArcCatalog and I don't understand the error messages it is giving me or why there would be an error. When I try to import my metadata XML it completes the process successfully. However some of the fields and aliases are mixed up.

An example of the error messages I'm receiving:

[ERROR] - ESRITranslator - Required variable is not bound to any value: CodeList: container[_GEN0] fragment[code] clause:  ChooseNode:20754675

or

[ERROR] - ESRITranslator - Error [InvalidForOne]: fragment[EnumeratedDomain] clause:  for-one clause: em:source (v:Subject, v:String) <edomvds>

An example of what I mean when I say the field names and aliases are getting mixed up:

*The mix ups of field names and aliases are not consistent either. Sometimes the only thing wrong is the field name, sometimes the alias is the only thing wrong.

What can I do to fix this?


texts: Calculating the average / MEAN of an attribute field in a QGIS model

texts: I need to know how to calculate the average / mean of an attribute field in my point shape file. Is this possible to do with the field calculator? I just found the options min or max but not mean. The result should be written in a new attribute field for further data processing. I would like to do this within a model.


texts: Combining many polygons from multiple datasets into one raster

texts: I am a beginner in ArcGIS. I have a query regarding merging many polygons to form one big polygon, and then rasterizing it. The polygons are from varied datasets and represent different environmentally protected areas, and I want to make them into one raster.


texts: I've set the SRID 4326 for a table having geometry column, but when i insert a geometry without SRID, i get an error because no SRID specified is interpreted as -1 or 0, so how i can set a default SRID to insert geometries without specifying SRID each time.


texts:
I would like to display some countries region on a map.  I have an CSV file with coordinates for each polygons (regions) as polygon; [[x,y],[x1,Y1],[xn,yn]].

When I import it to CartoDB, the_geom column = null and I have an invalid_the_geom column with coordinates.

Any ideas?


texts: Extracting certain portion of a geotiff with node-gdal

texts:
I use node server. And I want send coordinates of an area then extract related portion of the geotiff file (dem) using node-gdal.

Is it possible to do this with node-gdal?


texts: Unexpected output when using gdal_rasterize?

texts:
I  used the following code for converting my layer into raster format but I get a tif file that is completely black or white...

from osgeo import gdal, ogr

# Define pixel_size and NoData value of new raster
pixel_size = 1
NoData_value = 100

# Filename of input OGR file
# vector_fn = '/Users/PeterVanvoorden/Desktop/GRBgis_322/Shapefile/Adp322.shp'
vector_fn = '/Users/PeterVanvoorden/Desktop/GRBgis_322/New_Shapefiles/Sbne40179.shp'

# Filename of the raster Tiff that will be created
raster_fn = '/Users/PeterVanvoorden/Desktop/test.tif'

# Open the data source and read in the extent
source_ds = ogr.Open(vector_fn)
source_layer = source_ds.GetLayer()
x_min, x_max, y_min, y_max = source_layer.GetExtent()
print x_min, x_max, y_min, y_max

# Create the destination data source
x_res = int((x_max - x_min) / pixel_size)
y_res = int((y_max - y_min) / pixel_size)
target_ds = gdal.GetDriverByName('GTiff').Create(raster_fn, x_res, y_res, 1, gdal.GDT_Byte)
target_ds.SetGeoTransform((x_min, pixel_size, 0, y_max, 0, -pixel_size))
band = target_ds.GetRasterBand(1)
band.SetNoDataValue(NoData_value)

# Rasterize
gdal.RasterizeLayer(target_ds, [1], source_layer, burn_values=[0])

STARTING QUESTION:

I am trying to rasterize vector data using the GDAL_rasterize function. (Started here: syntax error when using gdal in python console QGIS) But with all methods they told me were possible, I always get something I don't need.

Below the 3 methods I tried...

Directly in python IDLE:

>>> import os
>>> os.system('gdal_rasterize -tr 7999.8 9999.53 -te 170000.2 168000.27 177999.8 177999.8 -a Pixelkost /Users/PeterVanvoorden/Desktop/GRBgis_322/Shapefile/Adp322.shp /Users/PeterVanvoorden/Desktop/Test.tif')

Then I get the value: 32512 as result but it should output a tif file on my desktop...

When I do the same in a python file and run it through IDLE:

import os

shapefile = '/Users/PeterVanvoorden/Desktop/GRBgis_322/Shapefile/Adp322.shp'

(shapefilefilepath, shapefilename) = os.path.split(shapefile)
(shapefileshortname, extension) = os.path.splitext(shapefilename)

outrastername = shapefileshortname + '.tif'
outraster = '/Users/PeterVanvoorden/Desktop/' + outrastername

os.system('gdal_rasterize -tr 7999.8 9999.53 -te 170000.2 168000.27 177999.8 177999.8 -a Pixelkost' +  shapefile + ' ' + outraster)

In this case nothing happens at all.

Running it in terminal (OSX):

mbp-van-peter:~ PeterVanvoorden$ gdal_rasterize -tr 7999.8 9999.53 -te 170000.2 168000.27 177999.8 177999.8 -a Pixelkost /Users/PeterVanvoorden/Desktop/GRBgis_322/Shapefile/Adp322.shp /Users/PeterVanvoorden/Desktop/Test.tif

Than I get: -bash: gdal_rasterize: command not found

I assume, looking at the last method, that there is a problem with my gdal package.  I reinstalled it after having a few problems and installed GDAL 1.10 using my terminal just with a easy install like this: sudo easy_install /Users/PeterVanvoorden/Downloads/GDAL-1.10.0


texts: Using Zonal Statistics As Table for overlapping polygons in ArcPy?

texts:
I'm using ArcGIS 10.2 for Desktop and would like to calculate the population within a specific distance from bus stops.

My input layers are:

census block (polygon) with population
undissolved bus buffers that overlap each other (polygon, in 1
layer)

I calculated population density and converted my block data into raster, then used Zonal Statistics as Table tool to calculate the sum of population in each buffer. If I use this tool directly, it will ignore 2/3 of my buffers because they overlap with others. Therefore I need code to iterate this through each buffer (about 600 in total).

My situation is the same to the one in this topic Intersecting Overlapping Polygons Individually in ArcGIS

I used the code by @phloem but it returns a table with only one row (which is one of the buffers I have). Could someone look through and give me some advice? I'm new to Python.

store_buffs = r"H:\DMLA\NTAS\Map\Shapefiles\2013_A30min_weekday.shp"
density_ras = r"D:\Downloads\block_clipped_Raster1.tif"
table_list = []
with arcpy.da.SearchCursor(store_buffs, ["FacilityID"]) as cursor:
    for row in cursor:
        exp = '"FacilityID" = ' + str(row[0])
        temp_table10 = r"in_memory\temp_table10" + str(row[0])
        temp_shp10 = r'in_memory\temp_shp10'
        arcpy.Select_analysis(store_buffs, temp_shp10, exp)
        arcpy.sa.ZonalStatisticsAsTable(temp_shp10, 'FacilityID', density_ras, temp_table10, 'DATA', 'SUM')
        table_list.append(temp_table10)
del row
final_table = r"D:\Downloads\2013_A30min_weekday.dbf"
arcpy.Merge_management(table_list, final_table)

I cannot post comment on phloem's answer because I don't have enough reputation. That's why I have to create another topic.

I found an ESRI supplemental tool called Zonal Statistics As Table 2, which allows me to calculate overlapping polygons. However, this tool takes forever to run (6 hours for me). I would like to have a more efficient way to process data.


texts:
What does the error in the title mean? I'm fairly new to GIS and can't understand which negative length vectors R is talking about? Here is what I'm doing:

I have a csv of lat/long locations of certain points and a multiPolygon Shapefile of buildings in a particular city . I want to find the nearest polygon to each point. First I have converted the points and polygons to planar projections by the following code:

##BUILDINGS DATA

buildings<-readOGR("buildings.shp")
buildings<- spTransform(buildings, CRS("+proj=utm +zone=45 +a=6377299.151
                                        +b=6356098.145120132
                                        +towgs84=295,736,257,0,0,0,0 +units=m +no_defs "))

##LATITUDES/LONGITUDES DATA

locations<-read.csv("20190712033434-47083-data.csv")

locations <- SpatialPointsDataFrame(coords = locations, data = locations,
                                    proj4string =
                                      CRS("+proj=longlat +datum=WGS84"))
locations<- spTransform(locations, CRS("+proj=utm +zone=45 +a=6377299.151
                                        +b=6356098.145120132
                                        +towgs84=295,736,257,0,0,0,0 +units=m +no_defs "))

Then I find the minimum distance using the following formula:

minimum_distance<- apply(gDistance(locations, buildings,byid=TRUE),2,min)

But it gives me the error:

Error in RGEOSDistanceFunc(spgeom1, spgeom2, byid, "rgeos_distance") :
  negative length vectors are not allowed

What is going wrong?


texts: How to assign a grid of point data to corresponding grid of polygons

texts:
I'm using QGIS 2/12.3

I have a point layer with modelled data on a 1km grid, each point has a value (0-5, modelling temperatures) and lies at the centre point of a 1km grid square.

I also have a polygon layer which is of 1km squares.

I need to assign the points values to the corresponding polygons.

If I use intersect, the output layer is points, not polygons.

(I need to do this so I can intersect the km squares with another layer to find the average value for each polygon).

I realise one way might be to add a new column to the attribute table and paste data across - but I need some guidance.


texts: How can I split a polygon into two equal parts along a N-S axis?

texts:
I have a PostGIS database with a table called 'sites' that includes a field sitename and a field geometry.

If I select, e.g.

select sitename, ST_AsGeoJSON(geometry) from sites limit 1;

I get:

  Plot 7     | {"type":"Polygon","coordinates":
    [[[-111.974951718315,33.0745275800293,353],
    [-111.974935360975,33.0745276003588,353],
    [-111.974935370263,33.0745546649121,353],
    [-111.974951727608,33.0745546445826,353],[-111.974951718315,33.0745275800293,353]]]}

These are rectangles oriented very close to N-S. I would like to divide each plot in half along (or close to) its N-S axis. Is there an easy way to do this?

Solutions in PostGIS-SQL preferred. Ultimately I plan to write insert statements like

insert into sites (name, geometry)
   values ('Site 1 E', (select ??east half of geometry?? from sites where name = 'Site 1'))

The closest I've gotten is ST_Split, which requires the polygon as well as the 'blade' (line used to split), but it is not clear how I can compute the blade from the geometry.


texts: Choosing matching treshold for geometry matching

texts:
I have seen that some researches use Otsu's method in order to select a threshold for geometrical matching (One such article). They refer to an article that describes such usage but it is written in Chinese. Are there any English speaking sources on such usage of Otsu's method? If not, what other method may I use for selecting a matching threshold for matching two datasets?

Example:

I have two sets with polygons, set A and set B. I want to use a distance measure (let it be centroid distance based measure) in order to check if the two polygons have the same "position". How do I select a similarity threshold that is appropriate?


texts: (QGIS) Splitting vector polygon layer with vector line layer

texts:
In QGIS, I have a layer of polygons (land parcels) and a layer of lines (outline of planned street). Can I slice the polygons along the line, creating new polygons from the "detached" parts?

If the street were a polygon, I could intersect both layers. Unfortunately, the street is a line layer that cannot be easily transformed to a polygon, since it has open ends, there is no defined "inside" or "outside".
I have searched StackExchange and Reddit, have tried all the QGIS vector tools, the SAGA vector tools, the Digitizing Tools plugin and the Clipper plugin, but no luck. My Python knowledge is near-nonexistent. What am I missing?
Using QGIS 2.18.24 (standard in my org, no chance of update for now).


texts: QGIS Data doubled in the attribute table

texts:
I was working on two different layers which I ultimately combined together using the "union" tool.
However, I now have twice the information in the attribute table as shown in the picture.
Any insight on how I can quickly delete the repeated rows?


texts: How to calculate volume from a raster file?

texts:
I have a raster file containing the depth of water. I need to find the volume of water using that raster file. I need to find the area of each cell and multiply with the depth. How can I do it in Python using ArcGIS 10 ?

rasvol = 0
rasterArea=gp.searchCursor(reservoir_area)
rasRow=rasterArea.next()
while rasRow:
     rasCount=rasRow.getValue('Count')
     rasValue=rasRow.getValue('Value')
     rasvol=rasvol + rasCount*rasValue*cellarea
     rasRow=rasterArea.next()

This code is correct or not for calculating the volume ?


texts: Customizing ArcGIS API for JavaScript widget?

texts:
The default ESRI search dijit doesn't have all the functionality I need. Is it possible to get the default search dijit code and extend it and if so are there any guides on doing this? I couldn't find anything on Google.

I see on the ESRI developers website that it is possible to create a custom build of the arcgis javascript library but this seems like overkill, I just want to extend a single widget.


texts: How to Change Port no. of GeoServer Running as Service

texts:
I installed my geoServer as a service on port 8080. However, I need to use this port for some other service and have been trying to move it to port 7000 instead but I can't find a way to change the port number. I have tried to add in the option on startup.bat

-Djetty.port=7000

and modified the jetty.xml file to

<Set name="port"><SystemProperty name="jetty.port" default="7000"/></Set>

But nothing seems to be working.


texts: Lines and polygons intersection with tolerance in QGIS

texts:
I have a layer with polygons and a layer with polylines.
I am looking for the list of polygons crossed by the polylines.
Just here it's relatively simple: intersection function.
That said, the layout of the line is not perfect, so I would like to exclude polygon for which the line only touches the polygon contour or does not fit more than 1m into the polygon.


texts: Triggering event on multiple layers at same time in Google Maps?

texts:
Say if I have 3 layers with different table schemas (fields), I pushed all three layers into one array and loop through the array to add listeners to each layer so that everytime I click on the map, all three layers should be triggered the click event and I can proceed to get details of the event triggered such as featureId or InfoWindowHtml. Theoretically, problem should be solved, but it doesn't work. I assume that googlemaps api only fires the event that is bound to the top visible layer object.

Is there any way that I can trigger all three events at the same time manually on I click a place on map?

//Loop through each layer
            for (var i = 0; i < visibleLayersNo; i++) {

                var layer = this.options.visibleLayers[i];

                //Attach custom map click event to each layer,
                 //but the event can only be fired when the object bound to it is on top and visible.
                google.maps.event.addListener(layer, 'click', function(event){
                    //do something
                });
            }


texts:
I'm working with a raster map that looks like this:

Do you know any way to select the red/blue spots or ideally put a points on them? I've been browsing web and qgis help for a while now, but I haven't found anything useful as of yet.


texts:
https://www.youtube.com/watch?v=nzEikFUt5O8

I am using ArcGis ArcMap 10.4

I have an existing shape that I am trying to edit the vertices of. I open the editing toolbar, and can select the point, but cannot move the point.

What should I be doing?


texts: Populate list from arcgis server service in JQUERY javascript aplication instead of DOJO?

texts:
I would like to populate a list on a select combobox using jquery with data from an arcserver service.I'm wondering if this is possible and if so how i would implement it. I'm using the esri javascript api v3.13 and arcserver.
 I did it before using DOJO but now i need Jquery instead of Dojo to implement my old code with Bootsrap web mobile aplication.

What i need is to click on the select option and the code should access to an unique field in my service layer and then it should show which value options i could choose(For example a field called Visietd which unic values are yes or no)

For example how should i write dijit.byid("fiedname") in jquery instead of Dojo??
For example how should i write dojo.addOnLoad(init) in jquery instead of Dojo?? Any idea?

CODE WITH DOJO INTENDED TO BE CHANGED TO JQUERY:

The code below makes a query in my service filtering the field "Visitado" :After this that data is stored with the unique field options values and it is populated the list (in a select in the html) with that options.

Do I need to change everything, or perhaps it is ok only changing
dijit.byid (maybe with $("#Visitado")) and dojo.addOnLoad(init); ??

function init() {

      var queryTask7 = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/telefonica/brazil/MapServer/0");

    //Define query parameters
    var query7 = new esri.tasks.Query();
    query7.outFields = ["Visitado"];
    query7.returnGeometry = false;
    query7.where  = "Visitado  <> ''";
    queryTask7.execute(query7,populateList);

   }

 function populateList(results) {
    //Populate the dropdown list box with unique values
    var zone;
    var values = [];
    var testVals={};

    //Add option to display all zoning types to the dropdown list
    //values.push({name:"ALL"})

    var features = results.features;
    dojo.forEach (features, function(feature) {
      zone = feature.attributes.Visitado;
      if (!testVals[zone]) {
        testVals[zone] = true;
        values.push({name:zone});
      }
    });

    var dataItems = {
           identifier: 'name',
           label: 'name',
           items: values
    };
    var store = new dojo.data.ItemFileReadStore({data:dataItems});
    dijit.byId("Visitado").set("store", store);
  }

  dojo.addOnLoad(init);

 //OLD HTML CODE NEEDED FOR DOJO
  Visitados:
 <select id="Visitado"        dojotype="dijit.form.ComboBox"                                          autoComplete="true" forceValidOption="true" value="Seleccione" ></select>

 //NEW HTML CODE NEEDED FOR JQUERY AND BOOTSRAP
  <select id="basic" class="selectpicker show-tick form-control">
  </select>


texts: Creating polygons from binary image using QGIS

texts:
Here I got a binary image of buildings (black and white image) and I need to convert them to building polygons:

The expected outcome will be a vector file with building polygons based on the image like this: blue as polygon edge and red as polygon area

However, I tried Raster -> Conversion -> Polygonize and Extraction -> Contour. The polygon created is not what I need:

Are there anyways to achieve the expected outcome?


texts: Negative reflectance values after topographic corrections (cosine correction and modified Minnaert correction)

texts:
I am trying to manually correct the surface reflectance values of some Landsat 7 and 8 images. I'm using Minnaert modified method, which uses the cosine correction as one of its inputs (see below the formula, from Richter, 2009).

ρMM stands for "Minnaert modified correction"
ρL stands for the result of cosine correction (sun zenit angle cosine divided by the cosine of the solar illumination angle at each point)
cosβ stands for the sun zenit angle for the center of the scene
cosβT stands for the solar illumination angle at each point of the scene (plus 10, 15 or 20º depending on its value).
b exponent depends on the coverage and the band (it can be 0.333, 0.5 or 0.75).

The problem is that the cosine of the solar illumination angle can be negative, and in that case cosβ/cosβT gives a negative value whose power cannot be calculated, if it's 0.5 or 0.75.

I have looked into many articles to try find out how to deal with this problem, but I have found nothing until the moment. Could anybody point me in the right direction?


texts:
I need to update a shapefile by joining it with a csv file in PyQGIS. This process occurs only in the memory and I want to make it permanent.

The sample code is as below:

from PyQt4.QtCore import *
# Loading the layer
cities = QgsVectorLayer('C:/~/cities.shp', 'cities' , "ogr")
population =QgsVectorLayer('C:/~/population.csv', 'population' , "ogr")
QgsMapLayerRegistry.instance().addMapLayers([cities,population], True)

# Joining the cities with the population
info = QgsVectorJoinInfo()
info.joinLayerId = nufus.id()
# Join field name in the shp file
info.joinFieldName = "abc"
# Join field name in the csv file
info.targetFieldName = "abc"
# To increase the performance:
info.memoryCache = True
# Updating the cities shapefile
cities.addJoin(info)

When I remove the population table from the layers panel, the added fields are also removed and not saved in the shapefile.


texts: Is there a bug in the "Layer 3D to Feature Class" tool?

texts:
I am trying to convert an etruded polygon feature class to a 3D multipatch feature using the "Layer 3D to Feature Class" tool.  The result is a flat multipatch rather than the expected 3D feature.  I am exporting from ArcScene not ArcMap to ensure 3D layer properties are used. (ArcGIS 10.2.1)

Does anyone else have the same problem? Is this a bug? there a workaround?


texts: What's the best way to produce a density map from weighted points in QGIS?

texts:
I'd really like to repeat the functionality of the ArcGIS Kernel Density tool - how could I do that?

I would like to limit answers to easy-to-install free-and-open-source software – i.e. QGIS installs easily with GRASS on all platforms so QGIS+GRASS would be fine, but SAGA does not (unfortunately, since it has what may be the ideal tool).

I am trying to produce density maps of wildlife across protected areas in QGIS. The density map in the following example was produced in ArcGIS from point observations of wildlife, with raw counts of group size (a field in the vector file) used to weight the density of each grid cell in the Kernel Density (SpatialAnalyst) tool, with a chosen search radius and grid cell size:

In a previous question on density, it was suggested to use the GRASS v.kernel tool to mimic the ArcGIS Kernel Density tool, but v.kernel doesn't do the same job. After looking at the manual and (successfully) producing a density map, it seems that the v.kernel function only works with point density, and there is no opportunity to give a variable for each point (such as raw counts) to weight each point.

UPDATE

There seem to be various *.surf.* tools in GRASS that may help create a density surface - and these do accept a weighting column or z-value, or are performed on rasters. @underdark suggested v.surf.rst - and the 'zcolumn' would be my weighting (count) variable - but I cannot figure out how to ask the tool to create a certain grid size or use a certain radius.

Suggestions on how to use v.surf.rst or any other method?

Sample data

x,y,count
431250,8707500,0
418750,8707500,5
413750,8707500,3
411250,8707500,1
408750,8685000,0
411250,8685000,0
416250,8685000,0
416250,8682500,6
411250,8682500,3
418750,8680000,0
433750,8677500,3
421250,8677500,0
423750,8675000,1
431250,8672500,0
428750,8672500,2
426250,8672500,2
423750,8670000,0


texts: Get image names from image collection in Google Earth Engine

texts:
This seems very basic, but I cannot figure out how to extract the image names from an image collection in Google Earth Engine. I can get a count of the number of images, but not the names. Here is an example.

var ROI = ee.Geometry.Rectangle(-82.5574, 35.5958, -82.5563, 35.59515); // define area

var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
    .filterDate('2014-05-01', '2015-10-01')
    .filterBounds(ROI);

Now I want to do something like collection.ImageNames().


texts: GRASS r.statistics method=average for non-integer maps

texts:
I need use the functionality of r.statistics using the average method. I have one map with cell clumps for a base layer and another containing various non-integer cell values for a cover layer.

However, when I try I get this error

  "This module currently only works for integer (CELL) maps"

What alternative is there?


texts: Selecting Features from a Feature Class?

texts: Some ARC tools seem to only to accept feature classes ( e.g.Generate Near Table) rather than layers as data input. If you had a featureclass with more than one feature how do you select the the feature you require if you cannot used the layer "definition query?? Or have Imissed something?


texts: Python script to print the feature classes which are referencing AGS map services

texts:
I have an AGS site and need to identify which feature classes in my SQL Server DB reference the AGS map and feature services.  I am not familiar with this environment and would like to automate the process instead of digging around for what references what. Is it possible to use the ArcGIS REST API with Python to get each feature class that is being used by a map or feature service?

I am using ArcGIS Server 10.0.


texts: Customize the aliases list in Locator Style Template

texts:
I'm having problems in getting one of my aliases to work in my customized Locator:

I've adapted one of ESRI's Locator Style Templates to my needs. In doing so, I set a bunch of new aliases in the Aliases section inside grammar. Overall, it is working properly, but I'm having trouble in getting any alias with the sequence of characters .º to work, which is a common in portuguese abbreviations.

I transcribe bellow a part of my Locator Style Template defining aliases for the word "primeiro":

<grammar>
<!-- (...) -->
     <section desc="Aliases">
          <alias_list name="StreetNameAliases">
               <!-- (...) -->
               <alias_def>
                    <alt>primeiro</alt>
                    <alt>1º</alt>
                    <alt>1.º</alt>
               </alias_def>
<!-- (...) -->

With this definition, the locator successfuly matches the input string "rua 1º de maio" to the address "Rua Primeiro de Maio" (100 matching score), but it gives no matching candidates for the input string "rua 1.º de maio"!!!

I already tried to substitute the . with the &#46; HTML code and several other workarounds and nothing worked.

Any thoughts on what's happening and how to correct it? HELP, these Locator Style Templates are a complete madness...


texts: Is there a tutorial explaining the basics of WMS?

texts:
I'm building some software that needs to download satellite map images to display behind some survey charts. I understand that, to download these images, I need access to a Web Map Service. The only problem is, I can't find any tutorials explaining how to use one.

Does anyone have any links to some basic tutorials on WMS? In addition, can anyone point me in the direction of some useful WMS services? Price/subscriptions shouldn't be too big of a problem.

Edit: The program is written in C++, if that has any affect on anything. It will need relatively high detail imagery, enough to make out roads and houses. I don't have any experience with XML, which it seems most (all?) WMS use.


texts: How to create a label containing values from different layers in QGIS

texts: I have several layers which are stagged on each other. I need to create a label (or text-window / description, doesn't matter) which should contain values from different layers. Creating a regular label I can only choose attributes from this layer. Because the features have different nodes, it is not possible to just merge the layers.


texts: ArcGIS for Desktop 10.4 - aerial images not in correct postion

texts:
When I add aerial images from a recent survey (delivered in EPSG:31468, DHDN_3_Degree_Gauss_Zone_4) to a map document, these differ in position from a basemap as can be seen in the screenshot below (about 150m in ~40°). I carried out these steps:

Set up a new map document
Set data frame coordinate system to EPSG:31468
add the aerial image
add a basemap (here: openstreetmap)

Overlaying it with a parcel dataset from a different source indicates that my aerial image is positioned correctly, so what have I done wrong?

Aerial vs. osm basemap:

Overlay with parcel dataset:


texts: Automatically generate file name from text boxes in layout in QGIS

texts:
Suppose I have a layout template in QGIS, with a lot of text boxes like the title of the map, title of the project, a project code, ...

When I export a map in pdf, is it possible to have it named automatically in a name like "Projectcode + Title + Date".pdf ?

If so, how would I go about doing this?