texts:
I'm trying to create a web-based GIS wastewater utility application integrated with with some maintenance system in the same interface so that for example any problem in the wastewater utility network can be located and a work order will be created for this problem. How can I start creating such an application and what tools do I need?
thanks


texts:
I have QGIS 2.14.

I opened a .shp file (with dbf etc) and selected a few features. Created a new QGIS project and pasted features as new Vector Layer.

The attributes table was created automatically in correct schema (field names & types) however the values are NULL.

I have explored other questions on stackexchange but they seem to be focusing on schema or field definition problem, in my case the schema is exactly same but still NULL values appearing.

Any ideas ?


texts: Extract areas up to 90% of mountain height

texts:
I have a DGM of an area in which I need to

Extract the valleys
Extract the ridges
Identify the areas which go from a valley up to 90% of the ridge height (e.g. a valley has an elevation of 0m, the closest ridge has an elevation of 100m -> I would want the area up to 90m), which means I have to assign each mountain to two valleys and vice versa

For extracting the valleys I figured to use the SAGA GIS tool "ta_compound 0". This gives me a line shapefile of the valleys. For extracting the ridges I found no more "elegant" way than reversing the raster values with a raster calculator in either QGIS or SAGA (e.g. all values * -1).
The big issue is the identification of the areas. I have no idea, how I could do that. But I would like to do it in QGIS / SAGA GIS / with GDAL.


texts: Receiving error 000539 from CalculateField_management?

texts:
I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I cannot get it to run for the text field.

    fcList = arcpy.ListFeatureClasses()
    fieldName1 = "Author"
    expression1 = "John Doe"

    for fc in fcList:

            arcpy.AddField_management(fc,fieldName1, "TEXT")

            arcpy.CalculateField_management(fc, fieldName1, expression1, "PYTHON")

My code returns this error:

ExecuteError: ERROR 000539: <type 'exceptions.SyntaxError'>: unexpected EOF while parsing (<expression>, line 1)
Failed to execute (CalculateField).

How can I fix this?


texts: Distance of points to nearest polygon edge in ArcGIS 10.2

texts:
I have a point feature class that consists of a systematic grid of points across a landscape. I also have a shapefile consisting of several polygons. For each point in the feature class, I'd like to calculate the distance to the nearest polygon edge.

It seems like one of those things that shouldn't be too difficult, but I've investigated countless potential solutions/similar questions on StackExchange as well as Google and have yet to come up with a solution that fits my needs. Some solutions have suggested converting vertices to points and then estimating point to point distance, but I fear that vertices alone aren't an accurate representation of edge (especially since these polygons have a large extent and are rectangular in shape).

I am using ArcGIS 10.2 for Desktop.


texts:
I would like to understand how to use QGIS to convert a geotiff that I have to a projection that will work with my vector files and maybe web mapping application.  I believe I want it in WGS84 since that is what I am most comfortable with.

How would I either use QGIS or use the gdal command line tools to convert this file to WGS 84? The following is the result of running gdalinfo on it.

gdalinfo 1590_2602.tif
Driver: GTiff/GeoTIFF
Files: 1590_2602.tif
Size is 6000, 6000
Coordinate System is:
PROJCS["NAD_1983_StatePlane_Alaska_4_FIPS_5004_Feet",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",54],
    PARAMETER["central_meridian",-150],
    PARAMETER["scale_factor",0.9999],
    PARAMETER["false_easting",1640416.666666667],
    PARAMETER["false_northing",0],
    UNIT["US survey foot",0.3048006096012192,
        AUTHORITY["EPSG","9003"]]]
Origin = (1590000.000000000000000,2605000.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_IMAGEDESCRIPTION=OrthoVista
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_SOFTWARE=Trimble Germany GmbH
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 1590000.000, 2605000.000) (150d17' 6.73"W, 61d 7'47.61"N)
Lower Left  ( 1590000.000, 2602000.000) (150d17' 6.47"W, 61d 7'18.07"N)
Upper Right ( 1593000.000, 2605000.000) (150d16' 5.64"W, 61d 7'47.74"N)
Lower Right ( 1593000.000, 2602000.000) (150d16' 5.39"W, 61d 7'18.19"N)
Center      ( 1591500.000, 2603500.000) (150d16'36.06"W, 61d 7'32.91"N)
Band 1 Block=6000x1 Type=Byte, ColorInterp=Red
Band 2 Block=6000x1 Type=Byte, ColorInterp=Green
Band 3 Block=6000x1 Type=Byte, ColorInterp=Blue


texts:
Not actually a route planner, but it amounts to the same thing.

I want to know the distance a vessel at sea must travel between two points. Obviously this isn't just a straight line thing, if there is land on that straight line.

I would prefer a solution with Google Maps, but anything will do really, just so long as it tells me how far the vessel must travel to get from point A to point B (it doesn't need to tell me how to get there, that would be a bonus).

@Geoist +1 "You want something that takes into account most efficient routes given currents, tides, etc?". Yes, please, if that is possible. If it costs extra, then I would prefer to start with a free solution and add that later.


texts: Has anyone discovered any compatibility issues between ArcGIS 10 clients editing older ArcSDE geodatabases (e.g 9.3.x)?

texts:
I’ve read the ESRI documentation here:  http://goo.gl/UUSM (link to ESRI) and http://goo.gl/TsmV  (link to ESRI) , so I know the documentation states that you can.  And I’ve actually edited data (a very small amount) in a 9.3 ArcSDE with no problems.

For those who are actually producing & maintaining on their versioned 9.3 geodatabases with ArcGIS 10 clients, have you experienced any issues?   Or has it been a relatively smooth experience (i.e works as advertised)?


texts: Reset/Restart my id pk field on a table in PostgreSQL

texts:
How do I reset/restart my id primary key field on a table in PostgreSQL? I don't want to delete all the data in my table, only reset/restart my id pk counting.
This is the code I'm trying to use but it is not working:
ALTER SEQUENCE "CoronelFabriciano"."MV_PPI2010_LOTES_id_seq" RESTART

CoronelFabriciano is my schema, MV_PPI2010_LOTES is my table, id is the field I want to restart.


texts: Query for Creating a buffer around a particular point

texts:
I am working on a project for ambulance management using GIS. using Qgis,Postgresql,Postgis
I am finding it difficult querying using St_dwithin as well as St_buffer.
My aim is to find any hospitals available to a victim within a particular radius.I have the information of the victims locations in form of geometry.plz kindly help.


texts: Converting polygon to line with neighbor info using QGIS?

texts:
Is it possible to create lines from polygons with information about neighbors in QGIS?

I would like to do this for land plots. There is a tool in ArcMap that works like a charm, but I do not see anything like that in QGIS. For clarification, I mean to generate plot boundaries with information on which plots the given boundary applies to.


texts: QGIS 2.4: plugin changes map tool canvas click behavior from 2.0

texts:
I had created a plugin for QGIS 2.0 to add new features more easily. It involves changing extents and updating snapping options along with triggering the default actionAddFeature(). However, I've decided to update to QGIS 2.4 and now notice that it has changed in behavior, but I cannot figure out why.

I'd created a mapTool to emit a point:

def __init__(self, iface):
...
    self.canvas = self.iface.mapCanvas()
    self.clickTool = QgsMapToolEmitPoint(self.canvas)
...

I connected the map tool to a function:

def initGui(self):
    self.clickTool.canvasClicked.connect(self.zoomTo)

The zoomTo tool zooms into a certain defined rectangle extent and triggers other functions depending on if statements

def zoomTo(self):
    ...
    box = pntBuff.boundingBox()
    self.canvas.setExtent(box)
    self.canvas.refresh()
    if self.iface.activeLayer() == layer1:
        self.addElement1()
    if self.iface.activeLayer() == layer2:
        self.addElement2()

My problem lies here: Using my plugin with QGIS 2.0, the first canvas click zoomed to my desired extent (done by zoomTo()) and required a second canvas click to actually add the feature (triggered by addElement1()). Using the plugin in QGIS 2.4, the first canvas click zooms AND adds the feature at the same time without requiring a second mouse click (this means I can't easily control where exactly I'm placing my elements).

addElement1() and addElement2() both start editing, set active layers, and trigger actionAddFeature for respective layers.

def addElement1(self):
    if not layer1.isEditable():
        self.layer1.startEditing()
    self.iface.setActiveLayer(self.layer1)
    self.iface.actionAddFeature().trigger()

My run method zooms out to my layer's extent and sets my map tool:

def run(self):
    #zoomOut() defined to set to layer's extent--different from zoomTo
    self.zoomOut()
    self.canvas.setMapTool(self.clickTool)

UPDATE: I'm still trying to target this issue and have created a second map tool to trigger the add feature action (on top of the original click tool). The first click zooms to the area and the second click should simply trigger the feature add action tool (requiring a third click to actually add the feature and open feature form). However, the second click triggers the action AND adds the feature right away (with only one click). While the difficulties of not being zoomed in previously stated is no longer an issue, it is still problematic as 1) the cursor does not change to "add feature" target symbol and 2) the snapping option cross does not show up.

When testing qgis.utils.iface.addFeatureAction().trigger() in the python console, the add feature button is simply toggled. It must be some combination of my emit point map tool with the add feature action. I wonder how I can access the add feature tool in a more detailed way, keeping it from firing in this unexpected way.

def __init__(self, iface):
...
    self.canvas = self.iface.mapCanvas()
    self.clickTool = QgsMapToolEmitPoint(self.canvas)
    self.addFeatureTool = QgsMapToolEmitPoint(self.canvas)
...

def initGui(self):
    self.clickTool.canvasClicked.connect(self.zoomTo)
    self.addFeatureTool.canvasClicked.connect(self.addMyFeature)

def zoomTo(self):
    ...
    box = pntBuff.boundingBox()
    self.canvas.setExtent(box)
    self.canvas.refresh()
    if self.iface.activeLayer() == layer1:
        self.setMyMapTool()
    ...

def setMyMapTool(self):
    self.canvas.setMapTool(self.addVanneTool)

def addMyFeature(self):
    self.iface.actionAddFeature().trigger()

At this point, I feel like i've tried so many things without success. Just wondering if anyone can tell whether this is some sort of bug, or an error on my part.


texts:
I am new to CartoDB. I have a free user account with 5 maps. I cannot see CartoDB.js URL just in a publish map. I have got just 'Get the link' and 'Embed it' publish map possibility and not the third one 'CartoDB.js'.

How can I get the vizjson URL also by other maps?


texts: ArcGIS 401 error during initialization of javascript map

texts:
I have a dumbed-down application to only reference a geometry service, and a feature service.

When the map is being initialized, it sends out a GET request of:
http://my.server.com/ArcGISTEST/rest/info?f=json but when using Chrome debug tools / fiddler I see it is returning HTTP 401 error

when I open this url in its own window/tab it produces the following output:

{"currentVersion":10.02,"soapUrl":"a url is in here","secureSoapUrl":"a url is in here","authInfo":{"isTokenBasedSecurity":false}}

It appears this is an object to determine the status/capability of the arcgis server to assist the javascript api.

Why am I getting this error?  How do I resolve it?  Could this be a symptom of my bigger problem (unable to edit features via javascript api).


texts: Converting Longitude and Latitude Coordinates to Square Miles?

texts:
I have a set of Long and Lat co-ordinates making up a five point polygon which I have converted in excel using the following formula:

=((X1*Y2)-(X2*Y1)+(X2*Y3)-(X3*Y2)+(X3*Y4)-(X4*Y3)+(X4*Y5)-(X5*Y4)+(X5*Y1)-(X1*Y5))*0.5

*Replacing X,Y with cell references of course.

This gives me a negative number but how do I convert this number to square miles or kilometres?


texts: FME Oracle SDE Invalid column definition

texts:
I am using FME on daily basis working with sde feature classes.
Sometime I am receiving data with more then hundred columns and when working I receive the following error.

The error number from Arc Objects is: '-2147216067'. The error message
from Arc Objects is: {Invalid column definition [ORA-04043: ..

I am wondering if there is a way in FME to detect which column is giving this issue.
I do not have access to SQL Developer in my workplace so cannot check there. All I can do to fix this issue is to divide the columns into half and create a temporary feature class and then do the same till I get the culprit column.


texts: Joining tables with merge rules in ArcGIS

texts:
I have two tables in ArcGIS that contain a mutual unique identifier, which the join will be based upon. However, table2 has multiple records of the unique identifier. There is another field in table2 which represents a "tally" of some value. I want to create the join between table1 and table2 so that the largest (max) value in the "tally" field is joined in the operation. How can I do this inside of ArcMap (preferably), or excel/python if not.

Table1

ObjectID | UID
       0 |  72
       1 |  89
       2 |  99

Table2

ObjectID | UID | Tally
       0 |  72 |     0
       1 |  72 |     1
       2 |  72 |     2
       3 |  72 |     3
       4 |  89 |     0
       5 |  89 |     1
       6 |  89 |     2
       7 |  99 |     0
       8 |  99 |     1
       9 |  99 |     2
      10 |  99 |     3
      11 |  99 |     4

TableJoin

ObjectID | UID | Tally
       0 |  72 |     3
       1 |  89 |     2
       2 |  99 |     4


texts: How to enable and change Symbol levels programmatically?

texts:
I have a vectorlayer which contains some features and I'm having problems representing them because they are being overlapped with an incorrect order. They have a field that numerate each feature so it could be easy to do.

I don't know if there's a better way to solve the problem but I wish to change the Symbol Levels and I couldn't find any function related with that in the QgsSymbol Class.

In the following image you can see where's the parameter that I want to change with code.

Any idea?


texts: Prevent ArcMap from adding field_X and field_Y fields to CSV?

texts:
I have a csv file that contains a field with an ID in a certain format that ArcMap seems to recognize as a coordinate (e.g. "11X355").  When I add it to a map in ArcMap 10.6, it automatically adds two new fields, appending _X and _Y to the original field name and displaying coordinates (-121.488717,0.000496).

How do I stop this from happening?  I believe this may be related to another issue with displaying XY data (using other fields), otherwise I could just ignore the new fields.


texts: Defining datum for Lambert Azimuthal Equal Area and converting to geographic coordinates

texts:
I posted this question to a specialised mailing list for spatial data analysis using R here but didn't recieve a response.

I am working with shapefiles and rasters in R, and I am unsure if I am specifying my projection information correctly (which I need to make sure I am as I want to reproject from one coordinate system to another).

I have a shapefile (from the Hydro1K data). The projection information in the readme is described as:

Projection used:  Lambert Azimuthal Equal Area
    Units = meters
    Pixel Size = 1000 meters
    Radius of Sphere of Influence = 6,370,997 meters
    Longitude of Origin = 20 00 00E
    Latitude of Origin = 5 00 00N
    False Easting = 0.0
    False Northing = 0.0

Looking at information in the readme and the associated .prj file I set the projection information using proj arguments like so:

proj <- CRS("+proj=laea +lon_0=20 +lat_0=5 +ellps=sphere") #the ellps 'sphere' has a radius of 6370997.0m
projection( myshpfile ) <- proj # In R the projection function allows you to set projection info for a file

However, I was wondering, do I also need to specify a datum for this projection? In the .prj file it says:

DATUM["D_Sphere_ARC_INFO",SPHEROID["Sphere_ARC_INFO",6370997.0,0.0]]

But I am not sure what datum this refers to? Does anyone know? Or can tell me where to find out?

I also have some data which is in geographic coordinates. The .prj file of this data states:

GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

Which I think is standard geographic WGS84 projection? Am I correct in thinking that the proj arguments for this projection should be:

projgeo <- CRS("+proj=latlong +datum=WGS84 +ellps=WGS84")
projection(mygeoshpfile) <- projgeo`

Then to convert mygeoshpfile to the same projection as myshpfile, in R I can use spTransform like this:

mygeoshpfile2 <- spTransform(mygeoshpfile, proj)

I want to make sure I am accurately converting from one projection to the other. Do I need to specify further proj parameters?

Thanks


texts: Remove background when using Rasterize in QGIS

texts:
I used Rasterize (vector to raster). The result is shown below.

There is a bright yellow background around the map after I used Rasterize. I want to know how I can remove this. The value 0 can be given a whit colour, but I dont want to do that.
So what can I do?


texts:
I'm trying to dissolve an hydrologic system because I have to many small portions for what I want to do but I can't figure how to make dissolve work ... the shapefile I'm using is a merge of different shapefiles (some I edited manually)

Here is how I set it up :

but when I execute it I get this message :

Do you know how I can fix this or if there is another way to reduce the number of entities in my attribute table? I have tried multipart to single part but it didn't reduce the number of items in my attribute table.
Even having just one big entity could work ...


texts: How to ireate over text of legends on QGIS and change that with fields from a Shape

texts:
I'm using 2.8.3 version of QGIS, I need change the text of legend, this is because I want to concatenate two or more fields from a Shapefile to compose this text.
Can I iterate over text of legends on QGIS and change that with fields from a Shapefile?
If yes, what classe in QGIS python I need to use?


texts:
Struggling with getting a WMTS layer working using OL2. I have it working with OL3 but unfortunately I'm working with legacy code and it needs to work on OL2.

Using OL3 (working)

var xml = '...';  // The get capabilities result
var result = parser.read(xml);
var options = ol.source.WMTS.optionsFromCapabilities(result, {
    layer: 'XXX',
    matrixSet: 'default028mm'
});

var wmts = new ol.layer.Tile({
    source: new ol.source.WMTS(options),
    extent: ol.proj.transformExtent([-3.867188, 55.850650, -2.548828, 56.170023], 'EPSG:4326', 'EPSG:3857')
});

map = new ol.Map({
    layers: [
        new ol.layer.Tile({
            source: new ol.source.OSM(),
            opacity: 1
        }),
        wmts
    ],
    target: 'map',
    view: new ol.View({
        center: [62428.0, 7530366.0],
        zoom: 5
    })
});

Using OL2 (not working)

var xml = '...'; // The get capabilities result

var format = new OpenLayers.Format.WMTSCapabilities();

var capabilities = format.read(xml);
var layer = format.createLayer(capabilities, {
    maxExtent: new OpenLayers.Bounds(-3.867188, 55.850650, -2.548828, 56.170023).transform('EPSG:4326', 'EPSG:3857'),
    layer: "XXX",
    isBaseLayer: false
});
map.addLayer(layer);

var osm = new OpenLayers.Layer.OSM();
map.addLayer(osm);

map.setCenter(new OpenLayers.LonLat(62428.0, 7530366.0), 7);

With OL2 the tile image requests are incorrect with minus values i.e. /0/-284/441.jpg

As far as I can see I am dealing with this in the same way for both OL2 & OL3.

Does anyone know the main differences between how this default behaviour is handled in the two different versions?


texts: Import PostgreSQL into MS Access OBDC Error While Exectuing the Query #7

texts:
Trying to import a table from PostgreSQL to MS Access (2007) however, I keep getting the error

  OBDC Call Failed - Error While Executing the Query #7

STEPS TAKEN

In OBDC Data Source Admin (32-bit), under System DSN I added a new data source, the data source was my PostgreSQl localhost server.
In MS Access I added OBDC Database and selected 'Import the source data into new table in current database'
In Select Data Source panel that appeared I selected the DSN I created earlier. It showed the list of tables on PostgreSQL. When I selected on the table I was after, it showed the error mentioned earlier.

The basic idea is trying to link spatial attribute table stored on PostgreSQL to MS Access. Would like to know if possible and if so, how to go about it? If not possible due to MS Access limitations then other recommendations?

Note: The database table that I'm trying to import into Access was from the attribute table for a shapefile created on QGIS which is now stored on PostgreSQL. The table has no geometry associated with it (I exported the attributes as an csv - this was the csv I uploaded to PostgreSQL)


texts:
I'm trying to implement a regression using R, but the various models I have tried so far do not predict well at all.
The dataset I'm working with consists of roughly 10,000 observations which correspond to 10,000 real estate transactions that all happened between 2015 and 2020. Also, all these transactions (i.e appartment sales) are located nearby (5km radius). The relevant variables I have are the following:

price per square meter (which is the variable I'm trying to predict)
date of transaction (dd/mm/yyyy)
Surface of the apartment
latitude
longitude
number of mains rooms

It might not be a lot to work with, but I'm still hoping to find a better model than the ones that I have implemented. I'm aware there is a model called STAR (spatio-temporal autoregressive model) that might work, however I don't know how to implement it. Indeed, I found a lot of documentation about multiple spatial models and ways to implement them in R, but they do not account for the temporal aspect of data. The STAR model supposedly works for the data I'm dealing with, but I couldn't find much about it besides research papers (many of them you can't get full access to without paying for them. However, here's a paper where it's actually explained (see page 3):
https://hal-essec.archives-ouvertes.fr/hal-00554695/document
There might be other ways as well, but here is what I have done so far:
To deal with the spatial aspect of the data (after the Moran test on OLS residuals confirmed spatial autocorrelation), I created a weight matrix W whose coefficients $w_i,j are such that:
w_i,j = exp(-d(i,j))     if d(i,j)<0.5 else 0, d(i,j) being the distance in km between observation i and j based on haversine formula.
The Lagrange Multiplier test then oriented me towards a SEM (spatial error model), so that's what I implemented, using the variables listed above, with the date either as a qualitative variable (using for instance the 12 semesters as modalities) or as a quantitative variable by scaling the dates (i.e converting them as numeric so number of days, and then setting the first date to 0 and last to 1)
Anyway for both regressions the MAPE (Mean Absolute Prediction Error) I obtain is around 15% (doing a 80%-20% split in train/test datasets) , so way to high.
I might not have ideal predictors or high quality data, so I might never get very good MAPE in the end. However I am convinced my weight matrix and/or the model itself could be improved, so that it captures better both the spatial and temporal autocorrelations.
Does anyone know ways or R packages/codes that would help me achieve that?


texts: I want to label some lines. The labels has spaces like "label 1". I want to suppress all spaces so that the result is like "label2" without changing the attribute table. Is that possible?


texts: I am having trouble with a machine running Arc GIS 9.3. When one tries to save an mxd, ArcMap stops responding and just hangs. I have even tried with an blank new mxd but the moment one clicks save it hangs without even opening the dialogue box that allows you to navigate to the location to save. Please help


texts: CartoDB / ArcGIS online map to show roadworks in a city

texts: I want to create a map that shows roadworks based on start and end time in the City of Aarhus (second largest city in Denmark) using CartoDB (or ArcGIS online) similar to http://roadworks.org/ - I haven't been able to find any examples that shows this using CartoDB. I'm looking for a simple solution.


texts: how to open shp file which created by using python-ogr in qgis?

texts:
I have done following steps, so how I open that created shp file in Qgis

driver=ogr.GetDriverByName('ESRI Shapefile')
out=driver.CreateDataSource('pts.shp')
outL=out.CreateLayer('lake',geom_type=ogr.wkbPolygon)
farea=ogr.FieldDefn('ara',ogr.OFTString)
farea.SetWidth(16)
outL.CreateField(farea)
sr=osr.SpatialReference()
sr.ImportFromEPSG(4326)
featDef=outL.GetLayerDefn()
ring=ogr.Geometry(ogr.wkbLinearRing)

# gave points correctly
poly=ogr.Geometry(ogr.wkbPolygon)
poly.AddGeometry(ring)

... likewise I follow the all steps, Now I want to open the created file in QGis. However, I could not find the path of the file. where I can find it?


texts: IF THEN statements in ArcGIS Field Calculator

texts:
I'm not sure if this would be best handled in vbscript or python, and unfortunately I'm less than novice at both so I'll take any help I can get from the exchange.

I'm trying to take my streets layer and remove the "type" field for a certain set of street names. Any street named "Avenue A", "Avenue B", Avenue C" and so forth would need the "TYPE" field emptied out. But all other streets and street types would remind.

A little explanation as to the why may help you understand my plight a little better: We have an emergency response software at my municipality that uses both the prefix, subname, and type to display the streets data, as well as, track calls and statistics for each street. All streets display properly except for the "Avenue A" type streets which show up "Avenue A AVE". Any other AVE type street displays properly, for example: Baltic AVE, Crawford AVE, etc. But the "Avenue (letter)" streets will not with the "TYPE" field populated. Hope this makes sense.

So what I am needing is a field calculator script that will search for any [SUBNAME] "AVENUE #" street and blank out the [TYPE] field for it. I tried a little SQL with my inadequate knowledge of VBscript to generate the below (no it didnt work):

IF [SUBNAME]="AVENUE *" THEN REPLACE([TYPE],"AVE","")


texts:
I have a feature collection that is used as input for a model. In order to validate the model, I would like to mask a random percentage of pixels from each image, i.e. splitting the feature collection into a training and validation collection.

I tried to solve this by adding a random band (ee.Image.random()) to each image and then creating a mask with the .gte() and .lt() routines. I intended to map that function over the collection later on. However, the random band has a different resolution and projection than the image.

I also tried to re-project the random image to the projection of the target image. That did not work either.

Is there any easy implementable solution to mask random pixels in Google Earth Engine?

This is an example of what I am trying to do. Only the last three blocks are relevant. The pictures illustrate the respective outputs.

    [![// Function to cloud mask from the pixel_qa band of Landsat 8 SR data.
function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = 1 << 3;
  var cloudsBitMask = 1 << 5;

  // Get the pixel QA band.
  var qa = image.select('pixel_qa');

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
      .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

  // Return the masked image, scaled to TOA reflectance, without the QA bands.
  return image.updateMask(mask).divide(10000)
      .select("B\[0-9\]*")
      .copyProperties(image, \["system:time_start"\]);
}

// Map the function over one year of data.
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
    .filterDate('2016-01-01', '2016-12-31')
    .map(maskL8sr);

var composite = collection.median();

// without reprojection
var sol1 = composite.addBands(ee.Image.random());
sol1 = sol1.updateMask(sol1.select('random').gt(0.2));

// with reprojection
var rand = ee.Image.random();
rand = rand.select('random').gt(0.2);
rand = rand.reproject({crs: composite.projection(), scale: 30});
var sol2 = composite.updateMask(rand);][1]][1]

// Display the results.
Map.addLayer(sol1, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3});
Map.addLayer(sol2, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3});


texts: Intersecting data in ArcGIS ModelBuilder?

texts:
I have 432 suburbs polygons and an open space dataset comprising polygons
I need to extract for each individual suburb the open space polygons inside and those which straddle the suburb boundary (Not perform a clip).
I have the advance licence of ArcMap


texts:
I have a KML file called tracts.kml and a CSV called B01001A_007E_tract.csv in one directory.

I opened a command line in the folder and ran this:

ogr2ogr -sql "select tracts.*, B01001A_007E_tract.* from tracts left join 'B01001A_007E_tract.csv'.B01001A_007E_tract on tracts.Id2 = B01001A_007E_tract.StateCountyTractID" dst_tracts.kml tracts.kml

I got this message and error:

Warning: The target file has a 'kml' extension, which is normally used by the LIBKML, KML drivers,but the requested output driver is ESRI Shapefile. Is it really what you want ?

ERROR 1: SELECT from table tracts failed, no such table/featureclass.

What am I doing wrong?


texts: I have a script that creates MXDs and layouts dynamically, i need to to add to each data frame in the layout report using arcmap report wizard rather then export to pdf, is it possible ?


texts: How can I produce a point shapefile (or simply point coordinates) that represent a systematic rectangular grid? At least three input variables would be required: distance between points, distance between rows of points and orientation (azimuth of rows). The purpose is creation of sample locations for natural resource surveys. I guess a fourth variable would be required as well: either a starting location or some definition of the area to be encompassed by the grid. Typically an area of interest can be defined by a polygon.


texts: Configuring ArcGIS Enterprise Deployment using reverse proxy

texts:
I'm attempting to install an ArcGIS Enterprise base deployment using a reverse proxy configuration. The company I'm contracting for had most of the installation complete already, but our client apps were unable to reach the REST services through the Web Adaptor and I believe the Web Adaptor configuration is the point of failure, so I uninstalled it. However, I'm having trouble reinstalling it.

ArcGIS Server and Portal for ArcGIS are running on a server behind the firewall. Two Web Adaptors are running on a DMZ server which is also the reverse proxy. One points to ArcGIS Server and the other to Portal.

Is this the correct place for each component?

Do the Web Adaptors need to have a second instance of Portal or ArcGIS Server running on the same machine before they can be configured to point to the instances behind the firewall with the services I need?


texts: Adding additional parameters to image classification in ArcGIS for Desktop?

texts:
I have an RGB ortho rectified Image and I have another grid data with Elevation values.

However, an image with only three bands does not give a good classification of landcover, so it is important to add additional information e.g. pattern or elevation data from another dataset.

I only have access to ArcGIS software so I wish to know how I can do this in ArcGIS for Desktop?


texts:
Is there a GeoPDF viewer for Linux / Fedora?

Or ... is there some simple cartopy / mpl / gdal code that will display GeoPDF?

FYI, here's a browser for US Topo GeoPDF files: https://viewer.nationalmap.gov/basic/


texts: Fusion table, map and displaying images?

texts: I´ve set up a Google Maps displaying points from af fusion table. Is it possible to display the images related to the points, like when mouseover? (html hover?)


texts: COUNT vs. SUM field of zonal statistics as table output table

texts:
I want the count of the number of raster pixels within that polygon.  I ran the Zonal Statistics as Table tool using one polygon as the feature zone data and only getting the SUM. I thought it would be the sum but i had done some rough calculations another way and got the number in the COUNT field.

Can someone explain what the difference between Count and Sum are?


texts: Get all streets within a certain radius with osm2po

texts:
I'm trying to get all street segments out of osm2po graph, given a geo point and a certain radius. Right now I just do a breadth first search out of the street that's closest to my point, but is there a better way?

class AreaIterator implements Iterator<DirectedStreet> {
    private Set<Integer> visited = new HashSet<>();
    private List<Integer> queue = new LinkedList<>();
    private final Graph graph;
    private final GeoPoint center;
    private final float radius;
    private final boolean twoSided;

    public AreaIterator(Graph graph, GeoPoint center, float radius) {
        this.graph = graph;
        this.center = center;
        this.radius = radius;
        List<Integer> edges = getEdgesForPoint((float) center.lat(), (float) center.lon(), graph);
        queue.addAll(edges);
    }

    private int step() {
        int edgeIdx = 0;
        if (!queue.isEmpty()) {
            edgeIdx = queue.remove(0);
            DirectedStreet street = getDirectedStreetFromEdgeIdx(graph, edgeIdx);
            if (!visited.contains(edgeIdx)) {
                visited.add(edgeIdx);

                if (street.getGeom().distance(center.getGeom()) <= radius)  {
                    int sourceId = graph.getEdgeSourceIds()[edgeIdx];
                    int targetId = graph.getEdgeTargetIds()[edgeIdx];
                    int [] next = graph.findOutgoingEdges(targetId);
                    int [] in1 = graph.findIncomingEdges(targetId);
                    int [] in2 = graph.findIncomingEdges(sourceId);

                    queueAll(next);
                    queueAll(in1);
                    queueAll(in2);
                }
            }
        }

        return edgeIdx;
    }

    private void queueAll(int[] in) {
        for (int edgeIdx : in) {
            queue.add(edgeIdx);
        }
    }

    @Override
    public boolean hasNext() {
        return !queue.isEmpty();
    }

    @Override
    public DirectedStreet next() {
        return getDirectedStreetFromEdgeIdx(graph, step());
    }
}


texts: How to add a custom north arrow to ArcMap?

texts: I created a custom north arrow in Inkscape, now I cannot seem to add it to ArGIS 10.1.  I would ideally like for it to be displayed in the north arrow selector window (See attached image).  How can I add my custom north arrow to ArcMap 10.1?


texts: Why is GRASS not thinning a terraflow raster properly?

texts:
I want to convert a raster map encoding directional flows (the output of r.terraflow) to a vector map. I'm using r.thin to process the output. It terminates successfully with 0 pixels removed during the last iteration. Yet when I try to vectorise the result with r.to.vect and feature=line, I get the following error message:

Extracting lines...
ERROR: Raster map is not thinned properly.
   Please run r.thin.

I have tried rerunning r.thin on the already thinned output, with the same result. I did not find anything in the documentation of either r.thin or r.to.vect to suggest what might be the problem here or how to fix it.


texts: Creating Home ranges (MCP) of marine mammals excluding solid land

texts:
I use ArcGIS 9.3 and the Hawth's tools for Home range analyses.
I try to create MCP of marine mammals which all works fine. However, the MCP include some land as well. How can I create a MCP so that it only considers the water area?

Thanks!


texts: Converting entire map to UTM 18 if only interested in part that is in UTM 18?

texts: I am using some polygons and rasters whose initial extents cover all of Canada or all of North America. I am interested in a small area in Ontario that is in UTM zone 18. I would like to use the UTM 18 projection for this project. If I convert all of my layers into WGS84 UTM 18 using ArcGIS, obviously the parts of the layers outside of the UTM 18 zone will be horribly distorted. I will be cropping the layers after to only my zone of interest once they are all in the same projection. But will the part of the map that is actually in UTM zone 18 be distorted as a result of the reprojection of the entire span of Canada, or will this part be fine?


texts: Trouble using gdal utilities in python (no output files created)

texts:
I am trying to use gdal utilities like gdal_polygonize in python to polygonize my raster image but I'm having trouble understanding the commands. What I mean is in some places the command is of the given form say:

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

I found it here

And the command is also called in python with os.system().

I read and tried to implement commands from Gdal_polygonize: How to filter pixels above a given value (elevation)?

gdal_polygonize.py result.tif result.shp

and python gdal_polygonize error

os.system('gdal_polygonize.py ' + filename + ' -f "ESRI Shapefile" ' + shapefile)

but no shapefile is created although there was no error while running the code.

I am stuck and having great trouble learning to use gdal with python as I don't understand the need or difference between the two types of commands. Please address my question.

What is the proper syntax for using (lets say) gdal_calc.py when called with os.system() and also when used as gdal_calc() ?

P.s I use python 2.7 on win 8.1 platform.

EDIT: With gdal.polygonize() I get the output shapefile, but when I try to view it in qgis, I get nothing but white screen. And in the case where I try to call utilities with os.system(), I don't get an output file only. Please tell me what is going wrong.


texts: Multipolygon From Multilinestring PostGIS

texts:
I have been looking for a answer for days. I don't even know if its possible.

Tried:

ST_AsGeoJson(ST_MakePolygon(ST_transform(geom,4326)))

ERROR:  Shell is not a line

ST_Polygonize(ST_LineMerge(ST_transform(geom,4326)))

This returns one big polygon with all the multilinestrings, but I want separated polygons.

Is it possible? if yes, how can I do this?

TABLE rede.redetotal_geo
(
  circuit_id character varying(9),
  n_arvores bigint,
  km double precision,
  index double precision,
  geom geometry(MultiLineString,3857)
)

(Multilinestring -> Polygon)

These are my multilinestrings, I want to transform each color to a polygon.


texts: Creating isochrones in QGIS using QNEAT3

texts:
I am trying to make transport accessibility map in QGIS, using QNEAT3 plugin to build isochrones. I need to make a map, that shows 30 minutes area of accessibility with 5 minutes interval zones.
I am using Iso-Area as Polygons (from Layer) option and Fastest Path (time optimization) in Path type to calculate.

I can't understand what units should i use in Size of Iso-Area and Contour Interval. I was trying to enter hours (0,5 for 30 mins and 0,083 for 5 mins) as in advanced parameters default speed is in km/h. But with this small values plugin doesn't work.

band_in = ds_in.GetRasterBand(1)
AttributeError: 'NoneType' object has no attribute 'GetRasterBand'

As far as I understand it is because
QNEAT can't make a single cell to create a raster file.

The question is: what values/units should I use if I want to get time (not distance) accessibility?


texts:
I recently installed QGIS 3.10 and have been unable to load a NetCDF file created by GMT.  GMT *.grd and *.nc files are not listed the "Add Raster Layer" file type dropdown.  The error I get when attempting to load the file is "Invalid Layer: GDAL cannot open GDAL dataset [filename.nc] not recognized as a supported file format.

I've tried both the data source manager and simply dragging the file into the layers pane. They all have the same issue.

Clearly I am missing something, a plugin or an library.  To see an example of what I'm looking for see this YouTube video (https://www.youtube.com/watch?v=8JgE7vbv5JE).


texts: How to split text attribute by characters in QGIS?

texts:
Is it possible to make a new column, for example named "Test" and store the first part of the column "Name" split by -?

See below how it should look like:


texts: I'm working in QGIS. I've created a new .shp file with intentions to make a line that I would buffer. I had toggle editing on and clicked add feature and started to draw and then buffered. The buffer did not work so I erased the new .shp file to try again but the the previous line is still there and doesn't belong to any layer. How can I erase this feature?


texts: NetworkX or Shapely to get the simplified graph between 2 Graphs?

texts:
I'm having trouble whether which approach to take in simplifying a graph from another graph. It's not a basic graph difference but the other way around.

I want to further simplify a graph of a street network Graph (G) by only getting the nodes and edges where a geojson linestring passes by. I want my final output to be of course a graph.

Is it a correct approach for geojson linestring to:

1.) Turn geojson (linestring) into Shapely geometry object,

2.) Project it to a GeoDataFrame

3.) >>> ???

or is it possible and should I turn a graph into a shapely object? Not all geojson linestring passes exactly on the street network, so I was thinking that I should be able to compute that a linestring is near the original Graph (G) and take Graph(G)'s nodes and edges of the filtered (where the linestring passes by) rill be retained.


texts:
When double clicked on tools of arctoolbox, no dialog box is opening, for the "buffer" or "intersect", or for any of the tools in the ArcToolBox.

I faced the same problem in both ArcGIS version 10.5 and 10.6.

How can I solve this?


texts: Obtaining population estimates by ZCTA from American Fact Finder

texts:
I would like to obtain the most recent population estimates (and age and gender information if possible) at the ZIP Code Tabulation Area (ZCTA) level.

I think this data exists on the American Fact Finder, but I cannot seem to figure out how to get it. Does anyone have any pointers as to how to extract this data?


texts: How to reproject a noaa bsb nautical chart?

texts:
I have some nautical charts in .BSB format. GDAL can read bsb and I successfully imported them to qgis. But I can't figure out what is the coordinate system they use.
Does anyone has some experience with .bsb ?


texts: How to create a realistic distribution of cities?

texts:
I'm not sure if this is the right community to ask this, so let me know if it's not.

I'm wondering if there's been some empirical research as to how villages and cities are distributed around other cities.

If one looks at a map, usually there's some clustering around big cities visible. I'm wondering if the distance from that central, big city to villages or  cities around is follows some kind of probability distribution.

Indeed interesting, and probably one cannot find a distribution that fits cities all around the world, but that doesn't matter so much.

I'm looking to find some kind of pattern in city distribution, here's why:

I want to create realistic data set of point in the plane that represent places (e.g.: cities, villages, ...). Uniformly generating these won't be a good idea, since this is not realistic in my opinion.


texts:
Is it possible to get polygon breadth in Shapely, similar to how it provides polygon length?
http://toblerity.org/shapely/shapely.geometry.html

I am also ok with a solution that uses fiona or any non-arcgis open source python solution.


texts:
I'm a software developer and have no real experience working with geographic information. So please, bear with me.
I am developing a 3D tool with a 3D-area based on photos (photogrammetry). It is georeferenced to be able to extract WGS84 coordinates.
I can also create a different number of assets (lines, comments etc.) in this scene, that also get WGS84 coordinates based on their position in the scene.
Now I am working with World Wind tiles describing the same area. I want to project the World Wind tiles to a planar area, and have it georeferenced (so that the images like houses, lakes, streets etc. on the tiles have their correct geographic position). World Wind tiles are usually described in Palte Carree projection, but I get it with WGS84 (lat, long).
I have tried to calculate the tile delta, convert it to sweref99TM (to get it in meter) and then transform the assets to the World Wind tiles view, but I get what I experience as a constant offset (see images)

Notice the line offset to the building on the image to right.
So, what I want is to project World Wind tiles so that they are aligned to a planar (x,y) scope, where each unit is a meter in the real world. I want to know a reference point (for example the geo reference [0,0]) and then just add x and y to locate the correct geo point.
For example:

Local =    Sweref99TM
[0,0]  =    [135000, 6280000]
[10,20] =   [135010, 6280020]
[-10,120] = [134990, 6280120]

Here is an overview of the current different views.

I'm sorry if I'm not clear enough or asking maybe a stupid question, but I'm stumped, and can't get this to work as expected.


texts: I did a union of 2 layers, which technically represent the same thing but one is the updated version. This means that there is a common field in both, lets call it A. After I did the union, I opened the attribute table and there are two separate fields both with the same name. I can't seem to tell which is which, could someone provide some feedback on how I can identify which is which? I am using ArcMap 10.5


texts: Import to PostGIS from QGIS (database sync)

texts:
I'm trying to write a simple Python script to load data stored in MSSQL to PostGIS. Idea is to load processing in QGIS and then run "importintopostgis" geoalgorithm :  "Import into Postgis" from python, since layers in MSSQL don't change:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import processing

processing.runalg("qgis:importintopostgis"....
processing.runalg("qgis:importintopostgis"...

For some of the layers it actually works ok, till i stumble to one of the layers that returns:

  Error importing to PostGIS Feature write errors: Creation error for
  features from #0 to #0. Provider errors was: PostGIS error while
  adding features: ERROR: Geometry type (MultiLineString) does not match
  column type (LineString) Only 88794 of 88994 features written.

I'm assuming that plugin assumes that geometry is Linestring when reading few lines, creates table with linestring geo feature and then stumbles on multilinestring.

Can't find a way to correct that any idea ?

The other possibility I found was to use OGR import from python with:

processing.runalg("gdalogr:importvectorintopostgisdatabaseavailableconnections",1,"dbname=

This one crashes with message:

  'NoneType' object has no attribute 'groups' See log for more details

I can't find error log in "History and log" window.

I think now I'm stuck. Any Idea how to solve this problem ? ETL tool, some other script etc.


texts: How can I change the elevation of a lake on a DEM so I show the lake bottom contours?

texts:
I'm studying the drainage of a lake and I have a DEM of the lake and the surrounding area.  I already identified the shorelines of ancient lake levels at higher elevations, but I would like to keep draining the lake digitally to predict future drainage patterns.  The DEM shows the even lake surface, although I have a bathymetry map which shows the depth of the lake bottom.

What can I do to lower the DEM surface to include the bathymetric information?  Is there a way to overlay the bathymetry map and create polygons for the various depth contours, then use those polygons to assign new elevations to the areas within them on the DEM?

I have access to both qgis and ArcGis.


texts: How to find the closest polygons to a point

texts:
I am trying to the find the four closest building polygons to a junction point layer. I understand how to obtain this for a single point but am unsure of how to specify the four closest polygons for every point in my layer.

CODE:

DROP TABLE IF EXISTS corner_buildings;

CREATE TABLE corner_buildings AS
  SELECT buildings.geom AS buildgeom,
        nodes.geom AS nodegeom
  FROM buildings, nodes
  WHERE nodes.objectid = 1
   AND ST_DWithin(buildings.geom, nodes.geom, 200)
  ORDER BY st_distance(buildings.geom, nodes.geom)
  LIMIT 4;


texts: String slicing in ArcMap dynamic text element

texts:
Is it possible to slice a string in ArcMap's HTML-like dynamic text elements?

I've got a string field "Code" with contents like 'A.3.5', I need to extract the number in the middle ('3' in this case). Preferably, counting both from the string's start and backwards from string's end (because some codes were loaded without the first or the last '.' between the middle number and the adjacent char).

The dynamic text element's statement is <dyn type="page" property="attribute" field="Code" domainlookup="true"/>. It's for a set of Data Driven Pages.

Python, VBScript or JScript solutions are welcome. I just don't know if they can be used within these text elements.

I'm asking specifically if this is possible, and how to do it if so. As a workaround, I've populated a new field in the SHP's dbf and used it in the text element.

Nevertheless, I'm being specific here because if it's possible to manipulate strings in these text elements I will need to do it many more times in the near future.

As good a workaround as the new field approach is, it's far from optimal. First, because I'm working with already field-dense shapefiles (many of them have around 200 fields, and more to be added over time). The example I provided is the simplest I could come up with, but there's a lot of to-be-extracted data crammed inside many other long string fields.

Furthermore, these shapefiles are destined for non GIS-savvy people who ideally ought to understand exactly what each field is. In time they should be populating / editing these fields by themselves, even create new fields. Which I'll have to teach them.

Adding unnecessary fields just as workarounds won't help in these cases. And eventualy it might lead to hitting a SHP's 255 fields limit.


texts: rasterio: ImportError: No module named tools.mask

texts:
I was trying to rasterize a geojson using rasterio mask function but there is an issue with importing the function

ImportErrorTraceback (most recent call last)
<ipython-input-1-37fb1af87d72> in <module>()
      1 import json
      2 import rasterio
----> 3 from rasterio.tools.mask import mask

ImportError: No module named tools.mask

rasterio version:  '1.0a9'


texts: Add to geoprocessing environments when creating ArcGIS .net Add-in?

texts:
I would like to add a new environment to the Geoprocessor Environments from an ArcMap.net Add in. I try adding the env to the GPEnvironmentManager with the following code but when ArcMap opens and I look at the environments, its not there.

            IGPEnvironment secTolEnv = new GPEnvironmentClass();
            secTolEnv.Category = "MyCategory";
            secTolEnv.Name = "_sectiontolerance";
            secTolEnv.DisplayName = "Section Tolerance";
            secTolEnv.DataType = new GPLinearUnitTypeClass();
            secTolEnv.Value = new GPLinearUnitClass
            {
                Value = 360,
                Units = esriUnits.esriFeet
            } as IGPValue;

            IGPEnvironmentManager GPEnvManager = new GPEnvironmentManagerClass();
            GPEnvManager.PersistAll = true;
            GPEnvManager.AddEnvironment(secTolEnv);

I am calling this while initializing the add in extension. Its getting called when ArcMap opens and I can step through it fine.

Is this possible?

I was thinking maybe I need to get the GPEnvironmentManager from ArcMap itself but I have not figured out how to do this yet.


texts:
I am new to geoalchemy/gis domain. I am looking to establish a local map server using postgis, flask and geoalchemy2. I have imported osm data into postgis and able to see it using qgis software. How can I serve mvt tiles using flask+geoalchemy2.

I did reflection of the existing postgis db and the tables(eg osm_roads) is available to me in python.
I have created ST_AsMVT aed ST_AsMVTGeom as as suggested by subclassing GenericQuery of geoalchemy2 https://geoalchemy-2.readthedocs.io/en/latest/spatial_functions.html#geoalchemy2.functions.GenericFunction
How can I recreate the query like shown in http://www.pythonexample.com/snippet/python/flask_mvtpy_giohappy_python from pure geoalchemy2 ie not resorting to raw SQL? In other words how can I replace the psycopg2 calls with geoalchemy2 calls in the _create function of the snippet?


texts: Using IF statement to create 2 different output files in Python Script tool of ArcPy

texts:
I have a model which needs to only produce 1 final report but is dependent on whether a variable is provided.So there are 2 different flows following on from that selection

Something like this, a policy number can be provided or not, if it is 1 report is generated (output2) if its not(output)

A python script has been saved as a geoprocessing tasks with the 2 outputs to feed into different chains of the model.

My script within the processing tool is:

import arcpy

input_data = arcpy.GetParameterAsText(0)
policynumber = arcpy.GetParameterAsText(1)

if policynumber == '':
    output = arcpy.SelectLayerByAttribute_management(input_data, 'NEW_SELECTION')

else:
    output2 = arcpy.SelectLayerByAttribute_management(input_data, 'NEW_SELECTION', "PolicyNumber = '{}'".format(policynumber))

arcpy.SetParameterAsText(2, output)
arcpy.SetParameterAsText(3, output2)

I am getting the error that 'output' is not defined.

Is this because I've built the second output into the IF statement?

How can I fix it?

Is there a better/easier way to generate a different report dependent on whether a selection has occurred?


texts: Using inline variable substitution in ModelBuilder for iterating through Excel sheets?

texts:
I need to join .xlsx tables to a states.shp files based on StateName, and then export the joined features into a geodatabase. I have several excel files ("XX2011, XX2012, XX2013, etc.), and need the output feature classes to reflect the names of the input tables.

I'm using ModelBuilder to iterate the process, but keeping getting errors. I don't think I am using the inline variable substitution correctly, but the ArcGISPro documentation isn't helping.

I've gotten different errors depending on how I've configured it. No matter what I seem to get:

  ERROR 000354: The name contains invalid characters

  ERROR 000354: The name contains invalid characters

  Failed to execute (Calculate Value).


texts: How to add barriers and flag to geometric network through code

texts:
I'm developing an ArcMap add-in that will run a trace against a water main that the user has selected using the selection tool.  The geometric network is already defined and I can run the trace by manually placing the edge barriers at each end of the main, putting an edge flag somewhere on the water main between the edge barriers and then tracing downstream (using indeterminate flow).  This returns all the curbstop valves that are connected to the water main.

I'd like to automate this so that the user doesn't need to place barriers or flag(s) but just needs to select the water main and hit a button to preform the trace.  I guess my pseudocode would be something like:

User selects a water main
User clicks my Add-In button
Programmatically place Edge Barrier at both ends of selected water main segment
Programmatically place Flag somewhere between barriers to indicate where to start trace from
Run the trace

Is what I want to do even possible?  How can I add flags and barriers to a selected segment of a geometric network using ArcObjects?


texts: Is there a ModestMaps or other flex library for finding the distance between 2 lat/lon coordinates?

texts: I'm using ModestMaps in my Adobe Flex application.  Is there a flex library method to calculate the distance between two of my lat/lon coordinates, or am I stuck coding the Haversine by hand?  I've looked through the API but couldn't find any distance-calculating functions.


texts: Where does ArcMap store ArcGIS Online credentials?

texts:
ArcMap maintains the stored credentials to ArcGIS Online despite closing the program (and killing the Connection in the taskbar).

How does ArcMap store these credentials?


texts: What are Control Points and Monuments used for in GIS?

texts:
I've done some preliminary research, looking up definitions for these terms, but I would like an explanation of what the application of a Control Point or Monument is for the average GIS?

I am still new to the field of GIS.


texts: How to delete horizontal lines from a vector grid?

texts: I have a 250ms vector grid which covers an area of 88 Sq.kms. For surveying purpose, we would like to retain the vertical lines alone. Is it possible to delete all the horizontal lines from the grid ?


texts: How to Query Layer using ArcGIS REST Services for Records with Date Closed Field less than 24 hours ago?

texts:
I am current trying to do layer definitions on a map and so I am trying to filter some records via a time factor so i was writing in the Where field DATE_CLOSED_ON > (CURRENT_TIME - 24) and DATE_CLOSED_ON is not NULL

I believe that in order to query a date field there is a must to include the field is not null. As for the time factor I am trying to query records that are closed less than 24 hours ago but the query keep returning me all records with a non null DATE_CLOSED_ON field.


texts:
This is related to my question ArcPy replaceDataSource, but can anyone explain to me why the following code fails to add a valid layer from a .lyr file, and I get the same problems as in that question (broken data source):

import time
import arcpy

fullpath = r'\\mxdPath'
mxd = arcpy.mapping.MapDocument(fullpath)
for df in arcpy.mapping.ListDataFrames(mxd):
    if df.name == 'Overview' or df.name == 'Keyplan':
        temp = r'C:\TMP\xxx.lyr'
        lyrNew = arcpy.mapping.Layer(temp)
        arcpy.mapping.AddLayer(data_frame,lyrNew,"TOP")

time.sleep(15)
mxd.save()
del mxd

I added in the delay because I wondered whether the layer wasn't fully added before the MXD was saved, but this doesn't seem to work consistently.

My geodatabases do seem to take a long time to open, but it's crazy not to be able to undertake such a simple scripting operation. I guess the same problem is affecting both operations, but any ideas why?


texts: Inserting non-geotagged terrestrial photos in ArcGIS using coordinates/file path in table

texts:
using ArcMap, I want to create data driven pages of road signs along a highway with terrestrial photos that are NOT geo-tagged (Two photos per road sign). The image names/Network folder paths/coordinates are stored in the feature attribute table of signs.

My wish is that the data driven sheets will show these photos, which are automatically inserted near the POINT feature (road signs) they belong to (in data view or layout). The images are on a network folder. So, basically, I wondering how I can implement a script/tool to look inside the table, look at the feature, then the network link, pull the image and insert it next to the feature in layout view or data view. Since there are two photos, they need to be "staggered" (not overlap with one another) so they don't fall on top of each other.

Is there a way to do this in ArcMap (or other method)?

There are 907 signs with approximately 1700 photos.

I'm using ArcGIS Advanced 10.2 with Spatial/3D Analyst extensions.


texts: Where does 'system:time_start' come from?

texts:
From EE resources [1,2] I see references to system:time_start like:

// This field contains UNIX time in milliseconds.
var timeField = 'system:time_start';

I guess that's used to register the start point of a time series (right?). But my question is how would I find it, where is the system:time_start documented?

I tried to search the Docs tab on EE online code editor (left side) but nothing returned.

[1]https://developers.google.com/earth-engine/image_info
[2]https://docs.google.com/document/d/1mNIRB90jwLuASO1JYas1kuOXCLbOoy1Z4NlV1qIXM10/edit


texts: ArcGIS Server 10.3.1 WMS Property "online-resource" not synchronised in Manager

texts:
I have a reverse-proxy set up to access my ArcGIS for Server 10.3.1 from the internet. After creating the wms service in ArcGIS Server Manager I can edit the wms service properties e.g Name, Title, Description, Keywords, Online-Resource etc

The Property "Online Resource" is always automatically filled out with the server address, but due to the reverse proxy this property needs to be changed so that the service works properly on the web. For example a wms service in ArcGIS Online will not be displayed until I modify the "Online Resource" property to include the external domain and not the internal server name.

ArcGIS Server Manager does not however save this property after it is modified - thus forcing me to use an external GetCapabilities which is very irritating and time consuming.

Is this a bug? Is it the same for everyone? or is there a logic there which I can´t see?


texts: SUM Area irregular polygons per grid cell

texts:
I have a shapefile of irregular polygons and a GRID (both as raster and polygon grid). How can I count the AREA SUM of irregular polygons per grid cell?

Can use ArcGIS, QGIS or R.

(Application: Nation rasterized into GRID. Question: How much area of what type of protected area in each raster cell?)


texts: Googlesheets CSV auto-update polylines to ArcGIS Online Maps?

texts:
I have been able to establish a ArcGIS Online map that auto-updates from a CSV spreadsheet within Google Sheets. The data that is auto-updating is point data with associated tabular data that will change over time, the spatial data will likely remain the same.

The issue lies in establishing polyline data in a CSV Google sheets file. I associated tabular data with points to test out the process, which has been shown to work. Now I need to have each row in the CSV to have the spatial information to form a polyline, as opposed to the lat and lon, which is required to draw a point in ArcGIS Online.

Is there some sort of ArcGIS Desktop tool that can take all the vertexes within a polyline, and establish those as functional lat and lon within a row of a CSV or shapefile field for drawing that polyline within ArcGIS Online. I have seen various coding solutions on the web, which I am not sure would actually address the goal I am trying to achieve.


texts: Calculate the needed space for a raster pyramid with QGIS

texts: How can I calculate (or where can I find information to calculate) the required disk space for a raster map of 36GB which should be in a pyramid of 10 levels ?


texts: Load a table with NO geometry_column using PyQGIS

texts: I had to backup a PostGIS model in a geopackage and I wonder how to load a non-spatial table, aka a table with NO geometry_column.


texts: Transforming lat and long to Mercator x and y

texts:
I've been trying to plot a set of lat and long coordinates to a Mercator map using the following set of equations:

x = long - long0
y = ln(tan(pi/4 + lat/2))

These equations are from a page on Wolfram.

I'm using a Mercator map from Wikipedia, it's from 82 N to 82 S. Based on this I've got the current set of equations to fully map the lat/long to the image:

height = image height in pixels
width = image width in pixels

x = long * PI/180
x = x * width/(2 * PI) + width/2

latRange = 2 * 82 * PI/180
y = ln(tan(PI/4 + lat/2))
y = -(y*height/latRange - height/2)

However when I make the image I get points on my map that are higher than expected (I try to plot the tropic of cancer and I hit the north coast of Algeria).

So, can someone please tell me where I'm going wrong?


texts: QGIS-Export Raster Values to a .csv file

texts:
I use a Raster, based on .png and .pgw file. (plans from a town)

The plans include information about where buildings are allowed to be built and maximum building height, ground elevation etc.

Now i need this information in a .csv file:
Coordinates of building, max building height, elevation....

I already tried gdal2xyz, but it only results in a huge 1 GB file i cant open.
I dont need all "sublayer", just a few.

Do I need a special plugin to handle this?


texts: Find the side of a polygon pointed by an azimuth

texts:
I have a dataset of points (longitude, latitude) and I used QGIS get a Voronoi diagram of these points. Each point has an azimuth and a wedge width that I also managed to visualize in QGIS.

As you can see, each point is in a polygon made by Voronoi. I wanted to know if there is a way to find which side of the polygon intersects the two lines formed by the wedge width. For example, in the following picture it would be the two sides in blue.


texts: Converting KML file to layer on existing map in ArcGIS Desktop?

texts:
I have a map in arcGIS, and i want some kml data to be shown over that map. But if i convert kml to layer, the data is not visible on that map. Both the layers can be seen separately by "zoom to layer" option but not simultaneously.

Even if the map itself is converted from KML file, the other data when i convert goes to somewhere else and does not show over that map (Though that was over the map in Google earth)


texts: (How) Can I define my own placement settings for labels?

texts:
Is it possible to define my own Placement settings for my labels?

The predefined ones are not bad, but I would need a few more of my own design. How can I accomplish that?


texts: Uninstalling old QGIS versions to save disk space?

texts:
I would like to clean up disk space used by old versions of QGIS.

Can I use the Windows Uninstaller without damaging the current installation or should I only delete the directory in the Programs folder?

The screen shot of my installed versions is shown in the picture.


texts: QGIS Slope analysis thinks elevation unit is degrees making all slopes 90 degrees or 0 degrees

texts:
When i run my slope analysis the output has only two values: 0 and close to 90 degrees. The only way I have found to solve this is using a z factor of 1/111,120 which is the conversion of degrees to meters. This makes me think that the program is using meters for linear units and degrees as vertical units. I have tried to reproject my DEM to UTM and some other CRS's to try and change this with no luck.

Can anybody tell me how to change my vertical units to meters in my DEM or if my diagnosis is wrong tell me what my problem is?


texts: Extracting polygons from layer crossed by lines layer

texts:
I'm looking for a way to only select entities crossed by a lines layer from a polygons layer. I've unsuccessfully tried the Intersect function with lines layer overlay. I'm mentioning that I have used the same CRS for both layers.
Here what I want to do in the pictures:
Polygons layer crossed by a lines layer:

The highlighted area I want to extract:


texts:
Possible Duplicate:
  Advice on geocoding IP addresses

I am wondering if there are any applications that will batch convert ipaddress to geographic coordinates? Some background on the project. My friend wants to know where fans of hockey teams live throughout the US/Canada/World. He made a simple online survey and apparently it captures each person's ipaddress. All we want to do is translate the ipaddress into a semi-accurate geo-location and tie that data point to a team.

The part I'm not familiar with is converting the ipaddress to coordinates. We don't need that much accuracy, within 2-3 miles is plenty accurate for this for-fun project. I have found a few applications that will convert ipaddress to coordinates, but they're all manually intensive. So far the survey has 2000+ replies, so that's a lot of manual data entry. Any ideas? Thanks a lot!


texts: QGIS 2.12.3-Lyon is unable open georefernced raster .png .tab files and says .tab is not a valid or recognized data source

texts:
I`m trying to Add Vector Layer-> Open Mapinfo File

It's ok with map because it opened perfectly in Mapinfo application.
What is the problem and how to fix it?
I need georeferenced raster in qgis.


texts:
I'm wondering how long it normally takes to "load resulting layers" after performing a batch process for overviews on QGIS.

I have a large raster dataset that will ultimately be merged and need to build the pyramids beforehand. The batch process ran successfully within like 5 seconds but it's  been a few hours.

........

Processing algorithm 36/36…
Algorithm Build overviews (pyramids) starting…
Input parameters:
{'CLEAN': True,
'FORMAT': 0,
'INPUT': 'Ov_iD0A_L01_R000005A2_C0000025D',
'LEVELS': '2 4 8 16',
'RESAMPLING': 0}

GDAL command:
gdaladdo E:/Imagery/Coastal_GA/Raster_Catalog/Coastal_GA.Overviews/Coastal_Imagery.Overviews/Ov_iD0A_L01_R000005A2_C0000025D.tif -r nearest -clean 2 4 8 16
GDAL command output:
Algorithm Build overviews (pyramids) correctly executed…
Execution completed in 0.11 seconds
Results:
{'OUTPUT': 'E:/Imagery/Coastal_GA/Raster_Catalog/Coastal_GA.Overviews/Coastal_Imagery.Overviews/Ov_iD0A_L01_R000005A2_C0000025D.tif'}

Loading resulting layers
Batch execution completed in 5.61 seconds


texts: Use Editor tools to add polygon from within ModelBuilder in ArcMap?

texts:
Is it possible to activate the Editor tools from within ModelBuilder?

I have used ModelBuilder to create a new empty polygon layer, and I would like to trigger the editor tools to prompt the user to manually draw a polygon and add values to the attribute table, all from within ModelBuilder.

I've only been using ArcMap for a few hours (I usually use open source tools).


texts: Error while compiling gdal 1.9.2 in Ubuntu16.04

texts:
I am trying to compile and build gdal 1.9.2 in Ubuntu 16.04.3. I am doing the below steps

sudo wget http://download.osgeo.org/gdal/gdal192.zip
unzip gdal192.zip -d gdal
cd gdal
cd gdal-1.9.2/
sudo ./configure
make

When i run make, i am getting the below error

In file included from /usr/include/string.h:630:0,
             from /home/kcube/gdal/gdal-1.9.2/port/cpl_port.h:132,
             from /home/kcube/gdal/gdal-1.9.2/port/cpl_conv.h:34,
             from json_object.c:12:
json_object.c:29:9: error: expected identifier or '(' before '__extension__'
char* strndup(const char* str, size_t n);
     ^
GNUmakefile:23: recipe for target '../../o/json_object.lo' failed
make[4]: *** [../../o/json_object.lo] Error 1
make[4]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts/geojson/jsonc'
../../../GDALmake.opt:539: recipe for target 'jsonc-target' failed
make[3]: *** [jsonc-target] Error 2
make[3]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts/geojson'
../../GDALmake.opt:539: recipe for target 'geojson-target' failed
make[2]: *** [geojson-target] Error 2
make[2]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr/ogrsf_frmts'
GNUmakefile:51: recipe for target 'sublibs' failed
make[1]: *** [sublibs] Error 2
make[1]: Leaving directory '/home/kcube/gdal/gdal-1.9.2/ogr'
GNUmakefile:56: recipe for target 'ogr-target' failed
make: *** [ogr-target] Error 2

Any idea how to solve this error?


texts: Where can I find the WKT standard or reference?

texts: I had a little confusion about the representation of a geometry as well-known-text (WKT). I was searching for the WKT Specs to search for the exact representation, but I did not find the Standard. Is there a standards document or reference for WKT? where can I find it?


texts: Programmatically adding .shp file to .mxd file

texts:
I have spent hours attempting to find the solution to the following problem online, but all answers I have found are quite old, and none work. Here is the situation:
I have a variety of .shp files. I have a blank mxd file. I want to add the .shp files into the .mxd file.

Various stackoverflow and stackexchange answers would have me believe that the answer to my problem lies in either:
arcpy.MakeFeatureLayer_management(,)
or
arcpy.mapping.Layer()

Unfortunately, I get a similar error no matter what approach I take.

The exact code from my most recent attempt (I'm really not sure how this could possibly be simpler):

import arcpy
arcpy.env.workspace = "C:/test"
arcpy.Exists("shapefile.shp") #returns True
arcpy.mapping.Layer("shapefile.shp")

It is at this point that I receive the following error:
Traceback (most recent call last):
  ...
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects\mixins.py", line 289 in init
  super(LayerMixin, self).init(lyrfile)
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects_base.py", line 47, in init
   for arg in args
ValueError: Object: CreateObject Layer invalid data source

Edit: exact code from my attempt using the other function

import arcpy
arcpy.env.workspace = "C:/test"
arcpy.Exists("shapefile.shp") #returns True
arcpy.MakeFeatureLayer_management("shapefile.shp","myshapelayer")

In this case, I receive the following error:
Traceback (most recent call last):
  ...
  arcgisscripting.ExecuteError: ERROR 000229: Cannot open shapefile.shp
Failed to execute .

Can anyone advise me as to how to proceed? I have found almost five different solutions suggesting that this is the procedure which I should follow, but it definitely isn't working for me. I am using Python 2.7.

Additional Notes:
-I have manually loaded the shapefile in ArcMap, it loads and displays correctly.


texts: Understanding DrawFeature and other events in the same time in OpenLayers

texts:
Scenario 1:

Let's say I have something like this:

`app_obj.MapObj.map.events.register("click", app_obj.MapObj.map, self.pointToVideoSearch);`

and another Click Control

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
        defaultHandlerOptions: {
            "single" : true,
            "double" : false,
            "pixelTolerance" : 0,
            "stopSingle" : true,
            "stopDouble" : false
        },
        initialize: function(options){
            this.handlerOptions = OpenLayers.Util.extend(
                {}, this.defaultHandlerOptions
                );
            OpenLayers.Control.prototype.initialize.apply(this, arguments);
            this.handler = new OpenLayers.Handler.Click(
                this, {
                    "click" : this.onClick,
                    "dblclick": this.onDblclick
                }, this.handlerOptions
            );
        },

        onClick: clickFunction,
        onDblclick: dblClickFunction
    });

When I click on the map, first and second control (it's activated) are fired up. Why the "clickStop" is not working and stoping other click events to be fired?

Scenario 2:

if I had event like in Scenario 1:

app_obj.MapObj.map.events.register("click", app_obj.MapObj.map, self.pointToVideoSearch);

and a DrawFeature control to draw let's say Polygon, then the first event is silenced (when I am drawing polygon), never fires up until you are not finished with drawing polygon

My question is, what is stoping first event to fire up? I need to find out that tehnic

Thanks


texts: Filling or splitting polygons proportionally based on variables using QGIS?

texts:
I want to divide each country into three separately coloured areas, like this:

The proportions of the three coloured areas must based on three columns of attribute data in the country shapefile's attribute table (representing percentages of a country's total energy production).

The two ways I can think of doing this are:

Using a fill method to colour each country with three different solid colours proportionally based on the attribute data, or
To split each country's polygon into three polygons proportional to the attribute data (and then they can easily be given separate colours).

For the first method, the only solution I have found is Ed Rollason's technique using gradients, but I want to achieve the same thing using solid colours, not gradients.

For the second method, there is the Split Polygon plugin but that doesn't allow one to use attribute variables.

Does anyone know a method to achieve this?


texts:
I have a set of points and want to find out the nearest distance to a water body (poly lines) taking into account the terrain and get a surface distance calculation. I understand that the way is to use the interpolate shape tool to convert the 2d polylines into 3d polylines and then run the near 3d tool. The z values are coming from a DEM raster tile. Running it, the tool creates an empty feature class.
Additionally I tried to use to drape the poly line feature class that contains the water body data over the DEM raster file using the base heights function from surface in the properties settings. But the setting are not being stored and the polylines maintain their 2d shape.

I'm using ArcGIS 10.2.2


texts:
I am trying to get a NDVI image from an RGB + NIR image captured by a modified Cannon S110 camera bought from Event38 along with a 3DR Iris+ drone link

The image captured with the camera looks like this

I have previously experimented with python and rasterio and successfully calculated an NDVI image from 2 images (one RGB and one NIR).

Researching around the internet I have found this to be achievable from one image. However I haven't found any image manipulation library to be helpful.

Can someone with more experience in this offer any guidance? Any programming language is welcome.


texts: Geoserver, how to show only grouplayer in WMS

texts:
I have created serveral layers, they are combined in a group layer.
When I connect to my WMS it display all layers in the workspace. I want the group layer to be the only layer possible to add, it that possible?


texts: I am relatively new to both the python and R programming languages, having a small amount of exposure to both.  Which language has the edge when working with spatial data and when would you use R over python and vice versa?


texts: How Is 4d Cartography Best Applied to Add Value to the Viewer?

texts:
I’m about to write my bachelor thesis in Geography with my main focus being GIS. I’m still in the process of finding a good topic. My supervisor and I narrowed it down to 4D cartography and if and how gaming engines like Unity can be used to create interactive 4D maps, the third dimension not necessarily having to be space and the fourth being time of course.
The main focus of my project is the technical feasibility of gaming engines for 4D maps, but I need to show it on an actual experiment.
So I’ve read a ton of articles throughout the last two weeks about 4D, which seems to be still a relatively new subject in the GIS world. There seem to be not even a hand full of articles about actual implementations of experiments with 4D maps (e.g. Bernd Resch et al. 2013: Towards 4D Cartography Four dimensional Dynamic Maps for Understanding Spatio temporal Correlations in Lightning Events).
Now I’m trying to come up with my own idea for an experiment but can’t really come up with something that is really convincing to me.

Visualize changes in population distribution over time through some
sort of “topographic” map, where “mountains” are high population
density. Lack of sufficient data makes it difficult.
Visualize changes in residential rents in cities. Again, lack of sufficient
data makes it difficult.
Visualize sea level rise or flooding (there is already lots of software to simulate this)
Heat development in the city during summer (this one I can actually see a usefulness, because the architecture can have a big influence on heat development and microclimate and would have to be visualized in 3D)
Traffic accidents in a 3D map over time.

I feel like I just need some more inspiration of what useful stuff can be done with 4D. I figured there might be some experts here who are active in 4D cartography, maybe you can think of some other examples, where 4D can be usefully applied so that it produces added value to the viewer of the map?


texts: How to connect to hidden folder from QGIS 3.8 using Mac?

texts: I recently updated my QGIS to the 3.8.0 and found that my previous links to hidden folders were no longer connecting. I'm working on MacOS Sierra (Version 10.12.6). I am just trying to connect to external hard drives which are located in the /Volumes/ folder, but are hidden. The QGIS documentation states that I need to add hidden browser paths to connect to hidden folders by going to the Preferences Options->Data Sources, but I can not seem to be able to type anything into the panel. Any suggestions?


texts: Overlaying polygon filled with solid colour with diagonal lines in QGIS

texts: I'm making a vegetation survey map using the UK phase 1 survey colour codes.  The code for marshy grassland, for example, is orange overlain with purple diagonal lines.  For the moment I've created separate polygon shapefiles in QGIS for the solid orange and then drawn by hand an additional polygon over the top of it to provide the purple diagonal overlay.  Is it possible to have a solid fill and diagonal lines (or other pattern) simultaneously in the same shapefile?


texts: OpenLayers 6 TileWMS over server-side proxy script

texts:
Let's say I've simple PHP proxy script:

$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;

How do I have to change TileWMS that the full URL with get vars will be parsed to my proxy?

  new TileLayer({
    source: new TileWMS({
    // not working I would look for a way to pass the ready URL with get vars here
    url: 'http://localhost:8000/proxy.php?url=https://some.server/geoserver/xyz/wms',
    params: {'LAYERS': 'basic:tigers', 'TILED': false},
    serverType: 'geoserver'
    })
  })

It looks in former versions of OL OpenLayers.ProxyHost existed . The reason is to hide some basic auth header.


texts: Grabbing mouse click (coordinates) in JavaScript

texts:
I am just getting to grips with using ArcGIS Server 9.3.1.  I am developing in .NET with a very basic Web app in C# - it has the standard ESRI web ADF ASP controls in the web page (Default.aspx) including a map and toolbar with some out of the box nav buttons.  I have also made some custom tools on the toolbar.

I am interested in working with the Web ADF Javascript libraries not the ArcGIS JavaScript API - a subtle but important difference I believe.

How would I go about doing the following (bearing in mind I want to be firing the JavaScript via the ClientAction property - custom)?

I need some javascript to work out where on the Map control the user has clicked and get a hold of the xy coordinates.
Send these coordinates to a web service (I already have a web service set up to accept coordinates and send XML back).
Parse the XML from the web service and put in a table.


texts: Syntax to add attributes in a line in the Expression String Builder

texts:
I have several columns with certain values, here's an example:

  | Apple | Banana| Orange | Pear       | Expected result
  | 1     | 1     | 1      | 1          | red
  | 1     | 2     | 2      | 1          | green
  | 2     | 1     | 1      | 1          | red
  | 2     | 2     | 2      | 1          | green

I would like to add ALL columns ONLY when the values are 2. I'm using this as a style filter so there will be colour ranges (i.e. Apple + Banana + Orange + Pearis less than 4 then red; equal or greater than 4 then green).

Can this be done?

The following is, I think, close to what I want but it gives red for all results instead of the expected results as shown above:

case when "Apple" IN ('2') + "Banana" IN ('2') + "Orange" IN ('2') + "Pear" IN ('2')
>=4 then 'green'
else 'red'
end


texts: Understanding location storage and query algorithms?

texts:
One of the most important aspects of a GIS-equipped database is that it provides the user with the capability to quickly query for all points within some arbitrary geographic area that match some additional criteria.  (E.g. "Find me the nearest 3 restaurants to this point on a map.")

Can anyone point me to a theoretical discussion of the algorithms involved?  I want to learn how they work.

Ultimately, I want to apply the same capability to generalized sets of numerical data - a large cloud of points in an arbitrary, n-dimensional, non-euclidean space.  For instance, a person's face can be characterized as a vector of numbers: [distance between eyes, distance from eye to mouth, width of face, length of face, etc.].  I want to film sidewalk traffic, estimate the features of each persons face, and then be able to make queries to the data later such as "given this person's face, find me the 100 most similar faces."

Is there currently any existing software that provides the ability to search over these generalized spaces?


texts: Splitting a string and extracting the numbers

texts:
I'm using QGIS and i have an attribute field that contains several compacted info such as "aaa1-bbb2-ccc3" and i want to extract those three different numbers into new fields .. so far i have managed to do a half decent job in using RIGHT and LEFT functions and using the "-" as a reference but those need more steps into cleaning the data and I'm still left with the middle portion un handled

what is the cleanest way to have the columns filled with those numbers.

The data isn't always the same but i can easily clean set it with a simple REPLACE, the issue is when i have to extract the numbers themselves

for example i have one column that has data similar to this "aaa1-bbb2-ccc3" and the desired output would be three different columns, the first having "1", second "2" and the third "3"


texts: Generate Radio Channel Number Keeping 2km Buffer

texts:
I have point data and each point has a serial number (as shown in the screenshot)
Each of my points is like a wireless access point and cannot be on the same radio channel as another wireless access point within 2km.
I have 8 radio channels I can use, they are Channel 0, 9, 18, 27, 36, 45, 54, 63
Is there a way I can use QGIS to automatically generate a channel plan for me by QGIS working out channel numbers that are not going to be within 2km of each other.


texts: Modifying existing edit tool to make new tool using ArcObjects?

texts:
I want to create versions of the edit tools that will add a parallel, offset segment each time I add a segment regularly. Is it possible to put a wrapper around the existing tools? Or otherwise add to their functionality?

e.g. Using the sketch tool I click twice on the screen. Code that I write would add a perpendicular segment on the front of a specified length and a parallel segment. I add another segment and it adds another parallel segment. I add a curve and it adds a parallel curve.

Do I have to make the tools from scratch or can I use the existing ones to add the segments and just tack on code to add the extra segments? Recreating the sketch tool wouldn't be so bad but the other tools are more complicated.


texts:
I have a very big dataset in a gbd. I would like to export it to an excel file. I use the following code:

startingP = r"C:\Directory\ArcGIS\By_Coding.gdb\MyInput"
endingP = r"C:\Directory\ArcGIS\By_Coding.gdb\Output.xls"
arcpy.TableToExcel_conversion (startingP,endingP)

But what I get is:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type

I have already seen in another question that it was suggested to combine arcpy.TabletoExcel_conversion with other tools like ListDatasetand with MakeTableView_managementbut it sounds weird to me that there is no faster way to do it, because I always thought the arcpy functions perfectly replicated the corresponding Arcgis toolbox tools, and if I use Arctoolbox > Conversion Tools > Excel > Excel to Table using the input file "MyInput" as "Input Table", it works. Is therefore any mistake in the way I call my variables in the code?


texts: Renaming extension ".out" to ."txt" in ArcGIS ModelBuilder?

texts:
I am trying to rename a XXXX.out file into a XXXX.txt file for it to be read into the rest of my very large model that does other things.  This ".out" really is a simple ".csv" file and once I have the extension on it renamed I do many great things to it.  I have hundreds of them and they will be continued to be made in ".out" files.

So far the only way I've come up with doing this is Parse Path, but I can't figure out how to combine the end results into something that can get fed into the rest of my model.

I am pretty new to model building and python.

I've attached the screen shot of this very small portion of the model I have so far.

From tikinter import Tk
From tkFileDialog import askopenfilename
Import os, sys, tempfile, shutil

Tk().withdraw()

filename = askopenfilename(filetypes = ((“My Name”, “.out”), (“All files”, “*.*”),))
print (filename) #checking my work

TempFolder = tempfile.mkdtemp()
Print TempFolder #check my work

Shut.copy2(filename, TempFolder)

For filesinfolder in os.listdir(TempFolder):
Infilename = os.path.join(TempFolder, filesinfolder)
If not os.path.isfile(infilename): continue
Oldbase = os.path.splitext(filesinfolder)
Newname = infilename.replace (‘.out’, ‘.txt’)
Output = os.rename(infilename, newname)

Print (newname)  #checking my work and this give the whole path including the newly renamed text file.


texts: Using Vegetation Condition Index Function in Google Earth Engine JavaScript API

texts:
I created a code in Google Earth Engine to calculate monthly VCI. The official equation for VCI is the following:
VCI = 100*(NDVI - NDVImin)/(NDVImax - NDVImin)

My problem is that I don't know how to relate the placeholders (NDVI, NDVImin, NDVImax)  to the right images and data from my image collection.
Because I have an Image Collection with 126 monthly NDVI Images
And I have two Image Collections (one for max and one for min NDVI values) with 6 images. From April to September one Image per month.
Now I have to calculate with the 6 images of the two extreme Image Collections to the monthly Image Collection.
It is difficult to explain but attached you can find my code. The problem should be in the almost last lines.
The GEE Code can be found here: https://code.earthengine.google.com/?scriptPath=users%2Fjohanneswilk%2Ftest%3ATest_13%20MODIS%20VCI%202

//preprocessing steps...

// ---------------------------------------------------------------------------------------------
///// MODIS Monthly NDVI Anomaly Calculation I /////

// Monatliche NDVI Kompisition erstellen von April bis September für jedes Jahr
// Create NDVI composite for every month
var monthlyNDVI =  ee.ImageCollection.fromImages(
  years.map(function (y) {
    return months.map(function(m) {
      var monthly = ndviCollection
        .filter(ee.Filter.calendarRange(y, y, "year"))
        .filter(ee.Filter.calendarRange(m, m, "month"))
        .mean();
      return monthly
        .set("year", y)
        .set("month", m)
        .set("system:time_start", ee.Date.fromYMD(y, m, 1));}); })
  .flatten());
print (monthlyNDVI, 'monthly NDVI')

// Für jeden Monat werden die NDVI Maximal Werte ausgerechnet --> somit bekommen wir eine
// MAX Value Composition
// Calculate mean values for each month over all years
var MonthlyMAX =  ee.ImageCollection.fromImages(months
  .map(function (m) {
    var maxNDVI = monthlyNDVI
      .filter(ee.Filter.eq("month", m))
      .select("NDVI")
      .reduce(ee.Reducer.percentile({percentiles: [90]}))
      .rename("max_NDVI");
  return maxNDVI
    .set("month", m);})
  .flatten());
print (MonthlyMAX, 'MonthlyMAX');
Map.addLayer (MonthlyMAX.first().select('max_NDVI').clip(roi),  {min:0, max:1,  'palette': ['red','yellow', 'green']}, 'MonthlyMAX')

// Für jeden Monat werden die NDVI Minimal Werte ausgerechnet --> somit bekommen wir eine
// MIN Value Compisition
var MonthlyMIN =  ee.ImageCollection.fromImages(months
  .map(function (m) {
    var minNDVI = monthlyNDVI
      .filter(ee.Filter.eq("month", m))
      .select("NDVI")
      .reduce(ee.Reducer.percentile({percentiles: [10]}))
      .rename("min_NDVI");
  return minNDVI
    .set("month", m);})
  .flatten());
print (MonthlyMIN, 'MonthlyMIN');
Map.addLayer (MonthlyMIN.first().select('min_NDVI').clip(roi), {min:0, max:1,  'palette': ['red','yellow', 'green']}, 'MonthlyMIN')

//Create a list to calulate the Index for each image related to each month
var vci_list = [];

for(var j = startyear; j <=endyear; j++){
  for(var i = startmonth; i <=endmonth; i++) {

  var current_vci = 100 * (monthlyNDVI[j][i] - MonthlyMIN[i]) / (MonthlyMAX[i] - MonthlyMIN[i]);
 // var current_vci = 100 * ('NDVI'[j][i] - 'min_NDVI'[i]) / ('max_NDVI'[i] - 'min_NDVI'[i]);
    vci_list.push(current_vci);
  }
}

print(vci_list);


texts: Completely removing no data values from raster using ArcPy?

texts:
I have a layer called addLayer0 which is largely filled with nodata values.

    for l in list_dfs:
       l.panToExtent(addLayer0.getExtent())

where list_dfs is a list of all dataframes in the document.

I want all dataframes to show the extent of the layer called addLayer0.

However as the Layer is largely made up of nodata values, the layer extent is much larger than the relevant area which has values >0, so it zooms to the extent shown in the image instead of the colored area.

How can I zoom to the extent of the colored area only?
EDIT:
The extent needs to be determined automatically as the script runs over many different files with different extents.


texts: How to import pseudo sections into QGIS and view in 3D epg raster

texts:
I have pseudo sections in raster (.bmp) format and I want to import these into QGIS and view with 3D viewer. I am using QGIS 3.
I can import them but I can't rotate them - I am required to use a projected system. The .epg file looks like it has projected coordinates but it imports into WGS system. What am I doing wrong?


texts:
How can I move the points to the main façade using Postgis?

I have used the following query

SELECT ST_ClosestPoint(ln.geom, pt.geom)
FROM "testes"."line1" AS ln
   WHERE ((pt.geom <-> ln.geom) < 0.00019 )
ORDER BY pt.geom <-> ln.geom
LIMIT 1);

But the points are moved to the nearest line.

How can I put the roads as a reference, so the dots move to the edge based on the orientation of the main road?


texts:
I have a local directory with a Raster Tile, downloaded with SAS Planet (I know about the license issues, its just a personal test).

In Global Mapper I can load it directly from the directory using:
file:///D:....\z%z\%y\%x.jpg

My question is, can I do the same in QGIS using local files?


texts: Create buffer along shoreline near sample site

texts: I want to look at the land use on the shoreline of a river relative to a specifc point on the river. I have created a point on the shoreline using the Near tool. Following this I am having trouble. I want to create a buffer that goes down the shoreline 100m in either direction and inshore 20m. I am hoping to do this for many points so a batch solution would be great.


texts: Use Google Earth for land cover classification accuracy evaluation?

texts:
I am doing land cover classification with an hyperspectral image of Santa Barbara, CA. The spatial resolution is 6.4 meters but I couldn't find any high spatial resolution land truth data for validation. Someone recommends me that I can generate random points in the classification map and see if those points are correctly classified by using Google Earth. However, I don't know how to do that.

Should I download image from Google Earth and put it into ArcGIS? Or should I put the randomly generated points and their classified types into Google Earth?


texts: Finding shortest distance from point(s) to number of polygons at varying angles using shapely?

texts:
My aim is to calculate the distance a point is from land in Python, trying to replicate the functionality of fetchR.

Given an origin and distance, I create shapely LineStrings which radiate out from this origin with 1 degree difference in angles. I then create a geopandas GeoSeries from this and run this GeoSeries of LineStrings against a GeoSeries of land_polygons first running intersects to establish if there is an intersection and then intersection to grab all of them and find the closest one.

I am really only interested in the closest intersection for that angle ( in terms of calculating fetch distances ) is there a way of constructing an intersects_first() query?

I wish to carry out this calculation for thousands of points and would be interested in ways to make the query take advantage of multiple cores

My rough implementation using Shapefile polygons and no shortening, it takes a couple of minutes in the function which uses geopandas.intersects to compute all 360 degrees on a i7 laptop.