texts: Preconditions not working on second iteration of ModelBuilder?

texts:
I'm working on a project where I have to iterate through geodatabases and handle some debug errors if they exist. For this I've created a ModelBuilder model, in ArcGIS 10.7.

Essentially, what the model does is iterate to the different databases (LoggGeoDB in the model) and using calculate value to determine if the file exists, using this as a precondition for selection. The calculation works fine, but the precondition fails on the second iteration.

First iteration:
None of the data sets exist, and all the Select processes successfully do not run: "The process did not execute because the precondition is false." As intended.

Second iteration:
Calculate Value and Calculate Value (3) finds their corresponding data sets and returns true, and the data is selected correctly. Calculate Value (2) still returns false, as intended, but Select Data (4) still runs, even though the precondition is false.

Any ideas for how to work around this - would prefer to keep it as a model if possible. I've tried to make the Calculate Value (2) always return false, bypassing the code, but the problem persists.

I also just tried making all the calculate value tools always return false, but Select Data (4) still attempts to run (the other two aborted as intended).


texts:
I want to create a LINESTRING from a MULTILINESTRING. However in the following case ST_MultiLineString is returned:

Select ST_GeometryType(ST_LineMerge(ST_AsText('
MULTILINESTRING(
(-70.52570888 -33.48112668,-70.52552472 -33.48116414),
(-70.52552472 -33.48116414,-70.52453208 -33.48121471,-70.52552472 -33.48116414)
)')));

Why is this the case? The linestrings are not self intersecting and are connected. How can I resolve this?


texts: How to use Clip_analysis (in_features, clip_features, out_feature_class, {cluster_tolerance})

texts:
I draw Polygon any, how to clip it and save to shapefile.

.png


texts: Intersecting shapefile/GeoDataFrame using Geopandas, shapely etc?

texts:
I'm currently transferring from ESRI to open source GIS by recreating basic ArcGIS tasks in Python, mainly using Geopandas since I have some experience with Pandas.

Now I'm trying to intersect a Building_Footprint shapefile with a one-mile buffer of a point.

The input data:

Building footprint:

Center point around which the buffer is made:

center=pd.DataFrame({
               'Lat':[40.603155],
               'Lon':[-75.478003]})

center_g = [Point(xy) for xy in zip(center.Lon, center.Lat)]
cg = gpd.GeoDataFrame(center, geometry=center_g)
cg.crs = {'init' :'epsg:4326'}
cg = cg.to_crs(bldg.crs)

And then I made a one-mile buffer around the center:

cg.buffer(5280) #The map unit is ft hence the number 5280

Now this is where I'm stuck. I'm trying to intersect the buffer with the bldg GeoDataFrame. So I tried this:

bldg1 = bldg.unary_union

to convert bldg to a single feature so it may be faster. But it takes forever since there are more than 160K records in bldg.

I've spend quite a lot of time on this task while it could be easily done in ArcGIS. I'm wondering what's the best way to go at it.


texts: Evaluating tree model height before and after fire in QGIS?

texts: I have downloaded ASTER images of one area in Aosta Valley. In 2008 fire occured. I have images from 2006 to 2016. How can I estimate the vegetation, precisely tree height before and after the fire?


texts: Using a selection tool will select everything

texts: When I use the Selected Features tool and try to drag a box around a few small items it grabs everything.  If i use the edit tool it will correctly select only features that are inside/intersect the bounding box.  I'm using arc 10.2.2 on SDE.


texts: Selecting alternate files (every second) as inputs to ArcGIS ModelBuilder?

texts:
I have multiple ‘pairs of images’ that need to be mosaicked but I cannot find how to automate selection of the 'paired' file names as inputs into a model. Each has a file name such as LS7_ETM_NBAR_2011-01-22T23-47-13.tif (top)  LS7_ETM_NBAR_2011-01-22T23-47-37.tif (bottom). a top image and a bottom image taken 24 secs apart!

At the moment, I have to physically select every second or alternate file to input into the model. But I have to process 1000s of images.

Ideally I would like to use an iterator but I don’t think I can because of the double model input.

I have been scouring the forums, Perhaps there is a bulk rename utility method that would be able to ‘match’ the first 35 characters? But surely someone has had this problem before with having to match cloud masks to reflectance grids?

Any ideas?


texts: Can't import arcpy in IDLE, pyscripter, or even ArcGIS10.1's Python window

texts:
After using arcpy and python for months with ArcGIS 10.1 without any problems I'm encountering something I can't work around or even find help with online.  Something as simple as "import arcpy" is failing for no reason I can think of:

>>> import arcpy
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 24, in <module>
    from arcpy.toolbox import *
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\toolbox.py", line 342, in <module>
    from management import Graph, GraphTemplate
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 153
SyntaxError: Non-ASCII character '\xe2' in file C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\management.py on line 154, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I've looked around and I've seen other people with similar symptomes but nothing with the same last message, the Non-ASCII character '\xe2' in file C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\management.py on line 154, but no encoding declared; part seems different.

I haven't done anything like installing new python extensions or versions or any other type of software.  The only thing remotely related was that I had an FME process working in the background while I was testing my code.  I didn't modify any pre-existing ArcGIS python scripts.

I have tried using IDLE installed by ArcGIS 10.1, pyscripter, and the Python window that can be opened inside of ArcGIS.  I tried rebooting on the off chance it was some fluke.  The only thing I can think of to try next is a fresh instal, and if that doesn't work maybe going as extreme as wiping the PC's OS and starting over from scratch.

Any help would be greatly appreciated.


texts: How to keep extent map only show limited number of layers in ArcGIS Pro?

texts:
I have a map series of counties in my state that also has an extent indicator map frame, which is a state county map highlighting the currently selected county.
I'd like to include some layers for the main map, but not include it in the extent indicator. If I remove or turn off any layer in either frame, it's automatically removed or turned off in the other frame as well. Is there a way to display just selected layers in the extent frame?


texts: Tilestache AttributeError: Layer instance has no attribute 'palette256' error when adding Metatiles

texts:
I have Tilestache working great over apache/mod_python. All of my mapnik.xml driven layers work well until I add a 'Metatiles' directive in the layer and then i get the following error:

AttributeError: Layer instance has no attribute 'palette256'

Here's the tilestache.cfg:

"bldglabels": {
      "provider": {
        "name": "mapnik",
        "mapfile": "/etc/mapxml/bldglabels.xml"
      },
      "metatile":
      {
        "rows": 4,
        "columns": 4,
        "buffer": 64
      }
    },

Any idea what I'm doing wrong? Thanks!


texts:
I followed the steps suggested by @kazuhito and it is set to the GRASS folder.
However when I close, I get error message.
GRASS Folder is set

Error message when attempting to Close - have to Cancel instead

Original Question
This is branched off from Unable To Clean Incorrect Geometries with Grass
I installed `QGIS Standalone Installer Version 2.18 (64 bit) from QGIS Download Website.
Then I went to GRASS GIS Download page to install GRASS GIS 7.2.1 (current stable)
No matter what I try, every time I run v.clean I get same error:

This algorithm cannot be run :-( GRASS folder is not configured.
Please configure it before running GRASS algorithms.

How to fix this?


texts: how to create an outline polygon (footprint) from raster data with postgis?

texts:
how can I create a polygon, containing the actual outlines (aka footprint) of a raster file with postgis?

I just need the outlines of the data containing parts of the raster.

ST_PixelAsPolygon creates a complex polygons - but I just need the footprint.

There is a similar question here Creating shapefile showing footprints of Rasters?, but the answers do not cover postgis.

D3


texts: Field calculator not working with ArcSDE?

texts:
I am working directly with ArcSDE and I want to add a field in the attribute table. I am able to add the field but it does not allow me to use the field calculator.

Any thoughts?


texts: OSM_id missing from ways table created by Osm2pgrouting

texts:
GIS newbie here so excuse my ignorance if this has a simple answer.

I have been playing about with pgRouting and using Osm2pgrouting to load OSM files from Geofabrik.

However I just noticed that the OSM_id isn't being created by Osm2pgrouting.

I'm trying to exclude some roads in pgRouting that are tagged "motors=no" in OSM but can't because I can't match them without the osm_id field?


texts: tables printed on separate layout page using data driven pages in ArcGIS?

texts:
I have 150 layout views made by the data driven page function in ArcMap. I also created dynamic tables with the production mapping extension. In some cases the tables are too big for my layout view, so I want to use data driven pages to print the dynamic tables on the other side of the paper. Is it possible to create this?

I found this article: http://desktop.arcgis.com/en/arcmap/10.3/map/page-layouts/building-map-books-with-arcgis.htm but this is more usefull for external documents, not the dynamic attribute table from ArcMap itself.


texts:
I am able to select the features from the attribute table but my data is so small that I am unable to identify where the selected features are. The features selected are from a raster attribute table with the values OBJECTID, VALUE, AREA, and PERIMETER at the top.

I am trying to find out which provinces within China's Great Green Wall received the most forest gain/loss. I already have the figures for net gain/loss within the Great Green Wall boundary, just need to identify where it occurred within that boundary (thus my problem with selecting the features).


texts: Making grid lines opaque so just lat/long coords on map border using QGISGDALPERF?

texts:
Can any one help me with adding graticules to my map? I have managed to add a lat/long grid over my map, however I want the grid lines to be opaque with just the lat/long coords on the map border - is this possible?

I am using QGIS 1.8


texts: Calculate raster statistics per polygon in a polygon feature class

texts:
I have a raster layer representing land cover which has three categories of pixels: natural, semi-transformed and transformed.

I have a polygon feature class where each polygon delineates a catchment area.

I would like to calculate the proportion of each of the land cover types in each polygon. For example: I would like to know what percentage of each polygon is natural, semi transformed and transformed. I would like this information to be contained in the attribute table of the polygon feature class.

I am using ArcView License, ArcMap 10.0. I have the 3D Analyst Extension but not Spatial Analyst.


texts: I am working for an organization that uses Google Drive File Stream for GIS data storage (ArcGIS Desktop). As a result, the root folder for all of the GIS files begins with "G:\Shared drives", which has a space in it. We are unable to change this name to eliminate the space. I know that GIS does not like spaces in file name pathways when doing analysis. Is there any solution to this? Every GIS data file we have will start with this. How much of a problem will this cause?


texts: How customise an attribute type in Entreprise Architec (EA)

texts:
I would like to customise the type of an attribute by referring to an enumerate table. However, when working in the logical model of EA, I can not insert the attribute type in the corresponding field. Is there a shortcut to do this in EA?
I join a screenshot to better explain my demand.


texts:
I'm wondering if there is a way to use ECW images in MapInfo without having to 'register' the image as I bring it in?

I mean, ECW images are already rectified (well the ones I use for GIS are anyway) with coordinate system information embedded into the header of the image.  Other GIS applications such as ArcGIS, Quantum GIS, gvSIG etc will load an ECW image generally without any problems... and without trying to rectify, that which is already rectified!

Of course, my valid fear is that by choosing the 'register' option when I open the ECW in MapInfo, I'll alter (possibly for the worse) the geo-rectification already applied to the image.  I don't want to do that.

I have a potential client who's already acquired MapInfo and needs to help setting up.

Any thoughts &/or help appreciated.

(Summit GIS and Mapping).

EDIT (27/10/2011): Using MapInfo Professional 11.0


texts: Compatibilty issue of pyexiv2 and ctypes module in QGIS 3.10

texts:
I'm trying to install a python module called pyexiv2 onto QGIS 3.10, I've noticed this module doesn't work. Although the module's installation seems to process well python -m install pyexiv2
and I get confirm the installation was done.  Requirement already satisfied: pyexiv2 in c:\progra~1\qgis3~1.10\apps\python37\lib\site-packages (1.3.0) , we are not able to import pyexiv2 in PyQGIS without getting an error :

  OSError: [WinError 127] The specified procedure could not be found

I've tried  OSGeo4W network installation, QGIS 3.10 standalone but nothing works, exept with QGIS 3.4 : this issue only appears from QGIS 3.10

As suggested I've tried the p3exiv2 module but the PYPI package is not designed for iOS & Linux only, that is why it seems not possible to install it. Except... by using another p3exiv2 module adapted for windows but this one requires some Windows packages like GIT & VCPKG (MS Visual Studio)... and I was not able to install it.

I've then contacted pyexiv2's author and he found where the issue was from. We are waiting for a new version of pyexiv2 next month that may (or may not) solve the issue.

Bug Recurrence Steps

Install pyexiv2 using the Python interpreter that comes with QGIS3.10 : "C:\Program Files\QGIS 3.10\apps\Python37\python.exe" -m pip install pyexiv2
I can execute the following command successfully, in the Python interpreter that comes with QGIS3.10 ::

 C:\Users\Leo>"C:\Program Files\QGIS 3.10\apps\Python37\python.exe"
 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> import ctypes
 >>> dll_dir = r'C:\Program Files\QGIS 3.10\apps\Python37\Lib\site-packages\pyexiv2\lib'        # This is where pyexiv2 is installed
 >>> ctypes.CDLL(os.path.join(dll_dir, "exiv2.dll"))
 <CDLL 'C:\Program Files\QGIS 3.10\apps\Python37\Lib\site-packages\pyexiv2\lib\exiv2.dll', handle 7ffe9ad90000 at 0x23702c3b9e8>
 >>> ctypes.CDLL(os.path.join(dll_dir, "api.dll"))
 <CDLL 'C:\Program Files\QGIS 3.10\apps\Python37\Lib\site-packages\pyexiv2\lib\api.dll', handle 7ffee1920000 at 0x23702c55908>

But I failed to execute the same code in the GUI of QGIS3.10 :

 Python Console
 Use iface to access QGIS API interface or Type help(iface) for more info
 Security warning: typing commands from an untrusted source can lead to data loss and/or leak
 import os
 import ctypes
 dll_dir = r'C:\Program Files\QGIS 3.10\apps\Python37\Lib\site-packages\pyexiv2\lib'
 ctypes.CDLL(os.path.join(dll_dir, "exiv2.dll"))
 <CDLL 'C:\Program Files\QGIS 3.10\apps\Python37\Lib\site-packages\pyexiv2\lib\exiv2.dll', handle 7ffea62d0000 at 0x26cd89b0860>
 ctypes.CDLL(os.path.join(dll_dir, "api.dll"))
 Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\code.py", line 90, in runcode
   exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\ctypes\__init__.py", line 356, in __init__
   self._handle = _dlopen(self._name, mode)
 OSError: [WinError 127] The specified procedure could not be found.

Conclusion :

The reason may be that the DLL used by QGIS3.10 conflicts with ctypes.
The author is going release a new version of pyexiv2 that could solve the issue but nothing sure.
I don't know how we can report this issue to QGIS team and if we should?

About using py3exiv2 instead of pyexiv2 : that could be another solution but I failed (but I'm newbie !).


texts:
I am running a python script from within ArcMap 10.5 and have always noticed that when I need to rerun the script in the same session, I get either an error or python goes to the next line showing just a ">>>". This happens more often on successful runs, but if the script fails because of syntax or data source issue, I can rerun it and it'll be fine. I often have to close out of my MXD and reopen it in order to run the script. It seems when it runs successfully, that there is something left open or the cache needs to be cleared in order for it to run again.

The errors that I get are random and are simply solved by closing the MXD and reopening.

Is there a way that I can clear the cache or force Arc to stop all background processes (if any are running) in Python?

import arcpy
from State_Dictionary import st_list_tup

# DEFINE VARIABLES
mxd  = arcpy.mapping.MapDocument("CURRENT")
df   = arcpy.mapping.ListDataFrames(mxd)[0]
lyr5 = arcpy.mapping.Layer("Counties")

lyr2  = arcpy.mapping.Layer("Otolaryngologists to Primary Care Physicians")
lyr3  = arcpy.mapping.Layer("Otolaryngologists")

for County in arcpy.mapping.ListLayers(mxd):
    if County.name == "Counties":
        lyr5 = County

for layer in arcpy.mapping.ListLayers(mxd):
    if layer.name == "Otolaryngologists to Primary Care Physicians":
        lyr2 = layer
    if layer.name == "Otolaryngologists":
        lyr3 = layer

st_abbr       = "STATE_ABBR = '{}'"
Automate      = "Auto_State = '{}'"
count_lyr     = "STATE_NAME = '{}'"

for layer in arcpy.mapping.ListLayers(mxd)[0:13]:

lyr2.visible  = False
lyr3.visible  = False

for state, fname in st_list_tup:

    layer.visible = True
    layer.definitionQuery = Automate.format(state)

    # CREATE SELECTION LAYER AND WHERE CLAUSE
    arcpy.SelectLayerByAttribute_management(County,"NEW_SELECTION", count_lyr.format(fname))

    # ZOOM TO STATE SELECTION THEN CLEAR SELECTION
    df.zoomToSelectedFeatures()

    # CLEAR SELCTION
    arcpy.SelectLayerByAttribute_management(County, "CLEAR_SELECTION")

    # DEFINITION QUERIES
    lyr5.definitionQuery = count_lyr.format(fname)

    print lyr2.definitionQuery, lyr3.definitionQuery, lyr4.definitionQuery

    # UPDATE MAP ELEMENTS
    for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
        if elm.name == "Title":
            elm.text = "{}".format(layer)

    for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
        if elm.name == "Subtitle":
            elm.text = "{}".format(fname)

    # EXPORT MAP SELECTION TO PNG IMAGE
    arcpy.mapping.ExportToPDF(mxd, r"C:\Data Projects\AMA (43.1GB)\Map Automation\Practice Maps\{}\{} {}.pdf".format(fname, fname, layer))

    # CLEAR DEFINITION QUERIES AND UPDATE MAP VIEW
    arcpy.RefreshActiveView()

# DELETE LOCAL VARIABLES
del mxd, df, lyr3, lyr2, lyr4, lyr5

print "Success!"


texts: Are ArcView and Basic license levels of ArcMap the same?

texts:
I need the near(dist) command, but I think I need to have a more advanced version than what I have.

I have:

ArcMap 10.0 (Build 4000)

ArcGIS desktop 10 service pack 4 (Build 4000)

license type: ArcView

Is that a basic programme? if so, how does one upgrade?


texts: Creating a Bounding box on pgr_Dijkstra to make it faster

texts:
I have a problem with the Dijkstra algorithm in regards to the query speed.
My current php script for the query is looking like this:
$sql = "SELECT * FROM pgr_dijkstra(
            'SELECT id, source, target, ST_Length(geom_way::GEOGRAPHY) AS cost, ST_LENGTH(geom_way::GEOGRAPHY) AS reverse_cost
            FROM ".TABLE."',
            ".$startEdge['source'].",
            ".$endEdge['target'].",
            directed := true);";

    $query = pg_query($con, $sql);

This takes like 10 seconds for just one query. The OSM data on the database is this one: http://download.geofabrik.de/europe/germany/baden-wuerttemberg.html
The table has ~700000 records.
At this speed, it is not really usable for me, because I have to make x queries at a time and can not wait for x*10 seconds for getting the results.
The forum has some advice on how the speed can be increased, like these ones:
Speeding Up pgr_dijkstra using bounding box in PostGis2.0
Why is any pgr_* routing function taking forever based on OSM data in an pgrouting enabled DB
But I am new to the whole spatial/geographical stuff and have problems adopting the advices given.
I do not want to copy blind and also can not do it because most questions are asked on older versions of pgRouter and not on pgRouter 3.0.
I tried to edit my query in regards to the first gis link and it is now looking like this:
$sql = "SELECT * FROM pgr_dijkstra(
            'SELECT id, source, target, ST_Length(geom_way::GEOGRAPHY) AS cost, ST_LENGTH(geom_way::GEOGRAPHY) AS reverse_cost
            FROM ".TABLE."
            WHERE geom_way && ST_Expand((SELECT ST_Collect(geom_way) FROM ".TABLE." WHERE id IN (".$startEdge['source'].", ".$endEdge['target'].")), 0.01)',
            ".$startEdge['source'].",
            ".$endEdge['target'].",
            directed := true);";

In the post, it uses on the FROM in the WHERE statement this: ways_vertices_pgr
What is this? Should this be generated somewhere from the ways table? Because with my query it does not give me anything back.
I also have tried this one, but it did not change anything: https://gis.stackexchange.com/a/194328/167149
Hopefully, someone can help me with this.
If you need more information do not hesitate to ask!
Kind regards
Lars


texts:
Does anyone know how i can move my ModelBuilder label box around so my host rock age is the correct order (youngest to oldest?)
See picture below.
I.e Quaternary at the top, then Tertiary.  I cannot seem to change the order.


texts: cannot split a line using QgsGeometry.splitGeometry in QGIS

texts:
I create a new qgis file and run the following code.

# create a line
line = QgsFeature()
line.setGeometry(QgsGeometry.fromPolyline([QgsPoint(50,50), QgsPoint(10,10)]))

# create a layer
layer =  QgsVectorLayer('LineString', 'my line' , 'memory')
dp = layer.dataProvider()
dp.addFeatures([line])
layer.updateExtents()
QgsMapLayerRegistry.instance().addMapLayers([layer])

# get the line feature
layer = QgsMapLayerRegistry.instance().mapLayersByName('my line')[0]
fs = layer.getFeatures()
f = fs.next()

print 'before split', f.geometry().length()

# split the line
points = [QgsPoint(50, 10), QgsPoint(10, 50)]
result, new_geoms, test_points = f.geometry().splitGeometry(points, True)

print 'after split', f.geometry().length()

f.setGeometry(new_geoms[0])

# necessary?
layer.updateFeature(f)
layer.updateExtents()

The code creates a line and splits it.  The length of the line before and after split are 56.5685424949 and 28.2842712475.  However, the endpoints of the line are still (50,50) and (10,10).  It was not splitted.


texts: Generating sampling points - making a series of points in the horizontal centre of a long polygon, equidistant spacing on vertical axis

texts:
I have a polygon showing the extent of a beach. I would like to create a series of sampling points along that beach, that are equally spaced north to south (say at increments of 100m to the northing value), and lie in the approximate center of the beach polygon at that northing value.

How might I go about this in QGIS or python? I can find a solution that would achieve this specifically.
Thanks for any advice.


texts: Does Python IDLE install automatically when QGIS is installed?

texts:
I have read in different gis.stackexchange posts that the python IDLE is located in Python27>Lib>idlelib, and if I had ArcGIS, it would be Python27>ArcGIS10.x>Lib>idlelib

But in my case, I can't find this directory for QGIS.

I have installed QGIS on my computer, but python IDLE is not shown in the start menu. Does this mean that it doesn't exist? I can't find the idlelib.

How can I download the python IDLE for python 2.7 ?


texts: ArcGIS Feature layer data update using API in PHP

texts:
I'm facing an issue with update data on the ArcGIS feature layer using API in PHP. Data is updating on the feature layer as expected, But data on the map is not representing. Every time when I'm pushing data to the Feature layer, Map is showing blank. But it's data section showing correct data.

Below is my code sample:-

<?php

$feature = [
    'geometry' => [
        'longitude' => $longitude,
        'latitude' => $latitude
    ],
    'attributes' => [
        'id'                                => (int) $item->id,
        'project_name'                      => (string) $item->project_name,
        'queue_position'                    => (string) $item->queue_position,
        'request_receive_date'              => $item->request_receive_date,
        'queue_date'                        => $item->queue_date,
        'application_status'                => (string) $item->application_status,
        'study_process'                     => (string) $item->study_process,
        'type_1'                            => (string) $item->type_1,
        'type_2'                            => (string) $item->type_2,
        'fuel_1'                            => (string) $item->fuel_1,
        'fuel_2'                            => (string) $item->fuel_2,
        'mw_1'                              => (string) $item->mw_1,
        'mw_2'                              => (string) $item->mw_2,
        'mw_total'                          => (string) $item->mw_total,
        'deliverability_status'             => (string) $item->deliverability_status,
        'county'                            => (string) $item->county,
        'state'                             => (string) $item->state,
        'utility'                           => (string) $item->utility,
        'substation_or_transmission_line'   => (string) $item->substation_or_transmission_line,
        'proposed_online_date'              => $item->proposed_online_date,
        'current_online_date'               => $item->current_online_date,
        'supplemental_review'               => (string) $item->supplemental_review,
        'phase_1_cluster_study'             => (string) $item->phase_1_cluster_study,
        'phase_2_cluster_study'             => (string) $item->phase_2_cluster_study,
        'optional_study'                    => (string) $item->optional_study,
        'agreement_status'                  => (string) $item->agreement_status,
        'latitude'                          => $latitude,
        'longitude'                         => $longitude
    ]
];

$formParams = [
    'token'                 => 'aUIIAqYYo3gx-5rgBGxLGBFOn_KOm9bbNe..',
    'features'              => json_encode([$feature]),
    'f'                     => 'json',
];

$url = "https://services9.arcgis.com/Azs8YqOMYfa7g8wo/arcgis/rest/services/test_layer/FeatureServer/0/addFeatures";

// I'm using guzzle.
$client = new Client();
$response = $client->post($url, ['form_params' => $formParams]);
$result = json_decode($response->getBody());

I'm getting success response:-

{
    "code": 200,
    "message": "Success",
    "data": {
        "addResults": [
            {
                "objectId": 32,
                "uniqueId": 32,
                "globalId": null,
                "success": true
            },
            ...
        ]
    }
}

And data is also updated in the Feature layer data section. But that updated data points are not reflecting on the map. It seems geometry is not correct.


texts: What versions of dBase do shapefiles support?

texts:
I have been looking around like crazy, not finding any specification which versions of dBase shapefiles support (ESRI shapefiles).

I found that GeoTools uses dBase III only, and Wikipedia says dBase IV only.

I'm writing a reader, how should I decide which formats to use, and are they any different?


texts: How to improve cartography by processing map exports with GIMP?

texts:
I am about to make a map with a heavy emphasis on cartography. I would really like to spice it up by processing the image in GIMP and I was wondering if anyone had any tips for bringing the cartographic pain to some ArcMap exports.

My current plan is to export certain layers and elements individually and process them, but I will be clicking in the blind so I am looking for suggestions.

What are some techniques for processing these exports with GIMP to produce a map?


texts: Features filter based on geographical conditions in QGIS

texts:
I use QGIS 3.10 on a MacOS 10.13 environment. I've got a point shapefile layer and a polygon shapefile layer. I want to set a filter to show (and work with) only those points that are within a certain polygon. I've tried the expression
intersects($geometry, geometry(get_feature('layer', 'attribute', 'value')))

that would work in the query builder, but not so in the filter builder. How can it be done?


texts: I have a large number of shapefiles (>500) representing species' ranges for North America. I am wondering how I could open them all automatically, without having to open them one at a time in ArcGIS? The shapefiles are nested in a folder for each species, and then in a folder for groups of species by family.


texts:
I am trying to find road information of COLAC region.My query is not working.

area[name="COLAC];
way(area)[highway=living_street]->.streets;
(
  way(around.streets:150);
  node(around.streets:150);
);
(._;>;);
out meta


texts: The hacks law relates the longest stream length with the catchment area of the basin. How can one construct a hack's distribution for a basin and upto what scale the sub basins have to be taken as each stream will have it's own catchment area, using GIS?


texts:
I have a table of sites that has a field Priority with values 'P1', 'P2', 'P3'. I want to apply rule based labeling such that when a site has Priority = P1
 it should be labelled with 'P1', when it has Priority =P2 it should be labelled with 'P2', etc.

I have tried the below formula in the filter under Rule Properties window:
 "Priority" = P1 but when I click test I get an error saying Column P1 not found.


texts:
I have an issue to enable alpha channel in arcgis image service.

Image service published from a mosaic dataset in sde DB. The image files are geotiff images with 2 bands. First band supposed to be grey value and second - alpha channel. I use extract band function (with parameter "1 1 1 2") in function chain of image service and it returns 4 bands as i want. But the alpha band still not activated - returned image is just first three band raster with no alpha.

In client i tried to set raster format to "png32" but it not help.

As alternative I published Map Service of this mosaic dataset and manually activate alpha channel in symbology tab. But I want an image service with alpha channel not a map service.

Any suggestions?

*ArcGIS 10.3


texts: Is there a tool in ArcToolbox that can compare types of shapefiles?

texts:
I have a some point shapefiles that represent categories of folklore story, witch, mermaid etc. I also have some point shapefiles of landmarks like portal dolmens, ancient woods etc. Is there a tool in ArcToolbox to compare one group to another that would give me some result that says, 'The witch stories line up with the location of old churches more than ancient woods etc.

I've looked through the Spatial Statistics Tools and Spatial Analyst Tools but I can't find one that I think can do the job. Does anybody know if it is possible to do something like this in ArcMap?


texts: Editing Road Style/Color from ArcGIS Maps and Data Group

texts:
I have ArcMap 10.2 on a Windows 10 pc.

I uploaded this open source layer into my desktop map, but I can't edit the look of the streets or color from the table of contents. Is there a way to do this, maybe not from the Table of Contents?

Here's the link to the layer:http://www.arcgis.com/home/item.html?id=fad13f5c12d946448dc8eb532664903f


texts: Georeferencing Raster+Shapefile using different Raster of same region?

texts:
In ArcGIS, I inherited a database of points in a raster image of Mars, each point indicates a crater occurrence. These are around 60,000 points, all of them in a shapefile. Both the raster and shapefile have the right scale, but are not referenced.

I created a georeferenced Mosaic of the same area with updated data, and I'm trying to consolidate both. When I try to export the points it tells me the file does not have a frame of reference (of course).

How should I tackle this problem in ArcGIS for Desktop?


texts: How to get WKT or GEOJson by country or city name with Overpass API?

texts:
I'm trying to understand Overpass API, I'm experimenting with it, but cannot get what I expect. Overpass API doesn't return me neither polygon shapes, nor WKT, nor GEOJson, nor even a highlight of the area I'm querying for.

My goal is to get either WKT or GEOJson of current OSM relations (exactly polygons (a set of lng/lat points)) for countries and cities. For example, I want to get a polygon for France. I make these queries in http://overpass-turbo.eu/:

relation
    ["name"="France"]
    ["coverage"="polygon"]
    ["type"="boundary:administrative"];
out body;

The response I get, no any polygon lat/lng data:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2013-11-08T11:43:01Z"/>

</osm>

The second version of my request, I provide only a name:

relation
    ["name"="France"];
out body;

Now I get dilated information about the country, but no polygons either:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2013-11-08T11:37:02Z"/>

  <relation id="11980">
    <member type="node" ref="17807753" role="admin_centre"/>
    <member type="relation" ref="1362232" role="outer"/>
    <member type="relation" ref="1263863" role="outer"/>
    <member type="relation" ref="1263868" role="outer"/>
    <member type="relation" ref="1628087" role="outer"/>
    <tag k="ISO3166-1" v="FR"/>
    <tag k="TMC:cid_58:tabcd_1:Class" v="Area"/>
    <tag k="TMC:cid_58:tabcd_1:LCLversion" v="8.00"/>
    <tag k="TMC:cid_58:tabcd_1:LocationCode" v="2"/>
    <tag k="admin_level" v="2"/>
    <tag k="currency" v="EUR"/>
    <tag k="flag" v="http://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg"/>
    <tag k="land_area" v="administrative"/>

...... and so on ......

How to get a set of lng/lat (WKT or GEOJson) of the territory (countries and cities only) by their name?


texts: Increasing speed of Python scripts using arcpy

texts:
Update 4/11/2014

It looks like the script was getting hung up on the Delete Features tool, so I switched to Truncate Table, as suggested in the answer below. I also removed the unused variables from the append tool.

Update 4/10/2014

I ran this script on my co-worker's computer (his machine has more memory AND contains ArcGIS 10.0/Python26) and it ran quickly. Hooray! Once my tech support finds the ArcGIS 10.0 CD, I will install and test to see if that improves the speed on my machine. To be clear, we are running the same script, our network drive and database connection are mapped identically, and the print statements are the same. I'll post an update here once that happens.

End updates

I need to increase the speed of some Python scripts that perform updates on an Oracle database. I had these Python scripts running well for a year+, via scheduled tasks and batch files to initiate the scripts. Last week I moved from an XP to a Windows 7 machine and ArcGIS 10.0 --> 10.1. Since then the scripts have become terribly slow.  If I run this script using a small feature class (containing ~20 features) it runs in 30 seconds. If I use a medium feature class (~80,000 records) it runs in 15 minutes. The feature class I really need to be able to transfer quickly contains about 1,000,000 records - the script only goes as far as the print statement to check if the files exist (if statement in code below). This process would take only 35 minutes to complete on my XP/ArcGIS 10.0 machine.

Below is the simplified code I have been testing with. Does anyone have suggestions on what I can do to increase the speed? Thanks, Patty

import arcpy, os, sys
from arcpy import env
arcpy.env.overwriteOutput = True
from datetime import datetime
import smtplib
import string
import urllib

#Define variables
inWorkspace = "O:/LANDING_PAD/BOE/example.gdb"
lpFeatures = inWorkspace + os.sep + "fc1"
outWorkspace =  "Database Connections\\THIS.sde"
arcpy.env.workspace = outWorkspace
workspace = ""
copyFC = outWorkspace + os.sep + "SDE.fc1_1" #The feature class the script will update via delete and append
schema_type = "NO_TEST"
fieldMappings = ""
subtype = ""
t = datetime.now()
print "This script began at: " + str(t)

if arcpy.Exists(lpFeatures) is True and arcpy.Exists(copyFC) is True:
    print "Both files exist. Beginning delete..."
    arcpy.DeleteFeatures_management(copyFC) #(copyFC)

    print "ALL DONE DELETING!"

    arcpy.Append_management(lpFeatures, copyFC, schema_type, fieldMappings, subtype) #Append data from landing pad to db
    print "ALL DONE APPENDING!"
    record_count = arcpy.GetCount_management(lpFeatures)
    print record_count
    r = datetime.now()
    print "This script ended at: " + str(r)


texts:
I was stuck for 2 or 3 days. I have read many lectures from RS/GIS Laboratory of Utah State University. Also I read «Python Geospatial Development» book and many docs from gdal.org.

So, my problem is:

I have GeoTiff files (*.tif) with WGS84 coordinate system, (for example 35 N 532402 4892945) and need to cut this image (tif file) by specified coordinates (minX=27.37 maxX=27.42 minY=44.15 maxY=44.20) without gdalwarp utility.

So anyone have some ideas or advice?

p.s. my code for this moment:

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

from osgeo import gdal
from osgeo.gdalconst import *

filename = raw_input("Enter file name: ")

# Get the Imagine driver and register it
driver = gdal.GetDriverByName('GTiff')
driver.Register()

dataset = gdal.Open(filename, GA_ReadOnly)
if dataset is None:
    print 'Could not open ' + filename
    sys.exit(1)

cols = dataset.RasterXSize
rows = dataset.RasterYSize
bands = dataset.RasterCount

transform = dataset.GetGeoTransform()
xOrigin = transform[0]
yOrigin = transform[3]
pixelWidth = transform[1]
pixelHeight = transform[5]

for i in range(3):
    x = xValues[i]
    y = yValues[i]

    xOffset = int((x - xOrigin) / pixelWidth)
    yOffset = int((y - yOrigin) / pixelHeight)

    s = str(x) + ' ' + str(y) + ' ' + str(xOffset) + ' ' + str(yOffset) + ' '

    for j in range(bands):
        band = dataset.GetRasterBand(j+1) # 1-based index
        data = band.ReadAsArray(xOffset, yOffset, 1, 1)
        value = data[0,0]
        s = s + str(value) + ' '
print s


texts:
In ArcMap it is possible to drag a polygon with the identify tool and thereby get information on multiple features without clicking on them with high precission.

So far I have not been able to find the same functionality in QGIS (checked all versons from 2.12 to 2.18.4).

Do you know a way to identify by dragging a polygon in QGIS?


texts: PyProj/Proj4 convert geographic to projected coordinates for Geostationary Data

texts:
I am trying to convert geographic coordinates (in degrees east/north lon
lat) to projected coordinates in meters for geostationary full disc data
(GVAR Goes East data from CLASS).  To do this, I tried using PyProj/ Proj4
and am running into errors due to the off earth pixels in the corners of the image.

This is the proj4 string given:

projection_coords = Proj("+proj=geos +h=35774290 +a= 6378137 +b= 6378137
+lon_0=-75 +units=meters +no_defs")

ll_x, ll_y = projection_coords_geos( LL_y_deg, LL_x_deg, inverse = False, errcheck=True)
'x=%9.3f y=%11.3f' % (ll_x,ll_y)

ur_x,ur_y = projection_coords_geos( UR_y_deg, UR_x_deg, inverse = False, errcheck=True)
'x=%9.3f y=%11.3f' % (ur_x,ur_y)

And the input 'LL_y_deg', 'LL_X_deg' etc are the values of the corner point extents lower left y pixel, lower left x pixel, upper right y and upper right x.

For full disc geos data I am receiving incorrect (1e30) values for the
extents and was wondering if anyone has ever run into the same error or
have a suggestion to correct this.

Here is an image to describe the problem further:

We did try drawing a limiting box inside the earth extents to get all valid
data points within, and this works but cuts out data in the edges of the
earth (the data in between the blue dotted box and the earth).  The geographic coordinate values in the red shaded off earth areas are very large (2.14 E9) and these are the values that throw the error.

Also, for remapping GOES data, should the 'sweep axis' always be included in the
Proj string and set to 'y'?

Any suggestions or comments would be greatly appreciated!


texts: Unable to use explore "Identify" tool with ArcGIS Server vector data in ArcGIS Pro

texts:
How do I use the explore tool in ArcGIS Pro to list details of a vector data point the way ArcMap did with the identify tool?
The vector data is on an ArcGIS Server. ArcGIS Pro doesn't seem to be recognizing it as a selectable "layer" even though it is part of my contents catalogue.


texts:
It seems that processing.getObject() is no longer available in QGIS.

from PyQt5.QtCore import *
from qgis.core import *
#...
layer = processing.getObject(layer)

# -> ...module 'processing' has no attribute 'getObject'

Is there a new way to use get.Object?


texts: Where can I get polygons for the Municipalities of Puerto Rico?

texts:
I'd like to find GeoJSON files to draw the polygons of municipalities of Puerto Rico.

It might be nice get the Nokia Map (or any reasonable publicly available map) of the same regions and overlay the results.


texts: Appending data to existing NetCDF file using ArcGIS Desktop?

texts:
There is a Raster to NetCDF tool for converting raster to NetCDF using ArcGIS.

How do I append raster data as dimension to NetCDF using ArcGIS Desktop?


texts: Why is GDALWARP making straight lines in hi-res ortho imagery look sawtooth? How to Fix?

texts:
I downloaded six hi-res (6") imagery tiles from USGS. Used gdal_translate to add State Plane Coordinates (SPC) projection to the tif. Used gdal_merge to combine the six GTiffs into a single GTiff. No problems, image looks good. See subset image before.tif.
Note that pavement lane marker lines are good. Even shadows from concrete barriers are clean. Used gdalwarp to convert from SPC to UTM. In After.tif image, pavement lane marker lines have sawtooth pattern.
Sawtooth pattern more obvious when printed full page. Tried various gdal_warp options without any success to get rid of the sawtooth pattern. Has anyone had this issue and know how to refine the final image? Sample code provided.
`gdal_merge.py -o merge.tif -of GTiff -ot byte -co COMPRESS=NONE -co TILED=NO -v t1.tif t2.tif t3.tif t4.tif t5.tif t6.tif
gdalwarp -overwrite -co COMPRESS=NONE -co TILED=NO -t_srs EPSG:26918 merge.tif merge_UTM.tif`


texts: Should I use gdal_retile.py or gdal2tiles.py?

texts:
I have many GeoTif files that I want to display in google earth with Geoserver. I am wondering if I want to use gdal_retile.py or gdal2tiles.py to create the image pyramids for them to be usable in Geoserver.

I am also wondering if I need to use gdal_warp on these images or are they ok since they are already in WGS 84?

Here is my output of gdalinfo:

Here is the gdalinfo output:

C:\Program Files (x86)\FWTools2.4.7>gdalinfo "c:\Users\dh\Desktop\output.tif"
Driver: GTiff/GeoTIFF
Files: c:\Users\dh\Desktop\output.tif
       c:\Users\dh\Desktop\output.tfw
Size is 4000, 1920
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
    AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
GeoTransform =
  -85.7491388451308, -4.524787279609347e-008, 2.666305185835285e-007
  30.00095207244157, -3.078813571247076e-007, -3.918543136581411e-008
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( -85.7491388,  30.0009521) ( 85d44'56.90"W, 30d 0'3.43"N)
Lower Left  ( -85.7486269,  30.0008768) ( 85d44'55.06"W, 30d 0'3.16"N)
Upper Right ( -85.7493198,  29.9997205) ( 85d44'57.55"W, 29d59'58.99"N)
Lower Right ( -85.7488079,  29.9996453) ( 85d44'55.71"W, 29d59'58.72"N)
Center      ( -85.7489734,  30.0002987) ( 85d44'56.30"W, 30d 0'1.08"N)
Band 1 Block=4000x2 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)


texts: Interpretation of local incidence angle map obtained from ENVI

texts:
I obtained a Local Incidence Angle (LIA) map from ENVI while geocoding an ALOS satellite SLC image. It is said in the documentation of ENVI that the LIA map (in .tiff format) contains the angle at each pixel in degrees. When I read this .tiff in python, the values are in the range 0-255 and there are 3 bands.

How can I interpret this LIA map and obtain incidence angles in degree at each pixel location?


texts:
When executing the r.watershed command, you do not finish the procedure, staying in Section 2: A * Search, the module has not been finalized or killed. Someone can help give me a solution or an explanation why this error is due. In the attached image I show the properties of the raster with which the execution is worked.

I used qgis-3.6 and the parameter values used are 4x10^9 and enable disk swap memory option.


texts: Passing a Python List to GeocodeAddresses

texts:
Currently I have a list of locations, like the following:

locations = ["Atlanta, GA", "Rochester, NY", "Paris, France"]

I would like to geocode these locations using arcpy.geocoding.GeocodeAddresses.

This function takes in a table as the first parameter.  Is there a way for me to use the Python list I have instead of making an extraneous file? Or is the only way to write the list I have into a file?


texts: Have I created a valid Spatialite database?

texts:
I didn't manage to find the better way to populate the exisiting Spatialite database with new computed data than just creating new columns and filling them in the Python script.

You can see that the script is very straightforward:

#!/usr/bin/env python3

import json
import sqlite3
import shutil
import pprint

dbase = "./states.sqlite"
input_data = "./Real_GDP.trends"

#Add to the attribute table 'states' numerous columns with a FLOAT numbers
alterate_db = """\
    ALTER TABLE states\
    ADD COLUMN '{0}' REAL DEFAULT 0.0;\
    """
#Fill the cells in new columns with a new data
update_db = """\
    UPDATE states SET '{0}'={1} WHERE state_name='{2}';
    """

#Function used for adding the new columns in a loop
def add_columns(data):
    industries = []
    for state, d in data.items():
        for code, _ in d.items():
            if code not in industries:
                industries.append(code)
    pprint.pprint(industries)
    con = sqlite3.connect(dbase)
    cur = con.cursor()
    #Every new column will match the industry code
    for i in industries:
        try:
            cur.execute(alterate_db.format(i))
            con.commit()
        except Exception as e:
            print("Exception: {0}".format(e))
        else:
            pass
    cur.close()
    con.close()

#Function used for filling the DB with a new data
def update_table(data):
    con = sqlite3.connect(dbase)
    cur = con.cursor()
    counter = 0
    for state, d in data.items():
        for code, values in d.items():
            if (values["p_value"] >= float(0.05)):
                trend = values["slope"]
            else:
                trend = 0.0
            try:
                cur.execute(update_db.format(code, trend, state))
                con.commit()
            except Exception as e:
                print("Exception: {0}".format(e))
            else:
                counter += 1
                if (counter % 100 == 0):
                    print(counter)
    cur.close()
    con.close()

def main():
    #Getting the working copy of database
    shutil.copy2(dbase + ".backup", dbase)
    #Loading the raw data that should be placed into the database
    with open(input_data, "r") as f:
        data = json.load(f)
    add_columns(data)
    update_table(data)

if __name__ == "__main__":
    main()

The file that I finally get seem to be a valid Spatialite database. It can be viewed and accessed with a various tools (sqliteman, spatialite-gui, qgis and qbrowser). It's attribute table seems to be OK too. The only problem is that the data from new columns cannot be rendered (in QGis 2.2).

This map was rendered from data extracted from the one of the old columns:

But I can see nothing but empty layout when I try to render map from any of newly added columns:

Since the QGis 2.2 is working fine, I guess that my problem was caused by the wrong methods of Spatialite DB editing (from my Python script). I would be glad if someone could point at the mistakes in the code above.

P.S. It is unlikely, but still possible that someone can check the files that I work with:

Real_GDP.trends - JSON file, the source of new data;
states.sqlite.backup - the initial Spatialite DB (fully operational);
states.sqlite - the resulting Spatialite DB populated with new data (partly inoperative: new columns are cannot be drawn);


texts: Is it possible to set data source of ArcMap MXD via replica MXD on remote server?

texts: I have two ArcGIS Server instances, one is development and the other is production.  I've copied the MXDs and .msds from my ArcGISServer folder on server one to server two for back up.  Instead of manually going into my mxds on server two and setting the data source then publishing, is there a method to complete this task with ArcPy?


texts: How to read minimum and maximum pixel values of an image in earth engine?

texts:
I want to read the minimum and maximum rainfall value for my study region. While using the reducer function I can read the mean value, however, for min and max value it is showing null. I wish to extract the min and max value to control the color bar/ palette limit. How to read the min and max values.
Below is my script,
Map.addLayer(Tawi, visParams, nameLayer, shown, opacity); /Tawi is the name of shapefile
Map.centerObject(Tawi);

var ChirpsDataset = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY');
var Chirps = ChirpsDataset.filterDate('2018-07-14', '2019-07-30').sum().clip(Tawi);

print(Chirps, 'Precipitation');
var precip = Chirps.select('precipitation');

var meanValue = Chirps.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: Tawi.geometry(),
  crs: 'EPSG:4326',
  crsTransform: [1,0,0,0,1,0],
  maxPixels: 1e9
});
print('Mean precipitation:', meanValue)

var maxValue = Chirps.reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: Tawi.geometry(),
  crs: 'EPSG:4326',
  crsTransform: [1,0,0,0,1,0],
  maxPixels: 1e9
});
print('Max precipitation:', maxValue)

Here is the link to script.


texts: OSM street nodes across postal code boundaries

texts:
Querying a street on OSM may result in multiple matches for the same street if it spans a postal code boundary (i.e. parts of the street have different postal codes).
How can all nodes for the street be retrieved?
Is there an option to get the street geometry as GeoJSON or similar to use as map overlay to highlight the street?


texts: Creating attribute field with restricted values on ArcMap?

texts:
I am looking to create a field in my attribute table for polyline features and I want the values for the field to be restricted to specified options (that is, a field with just YES/NO value).
Any ideas on how I can do that on arcgis 10.2?


texts: SVG symbol colors differences in QGIS 2.12?

texts:
I don't understand why SVG symbols, which are colors changeable in the symbol default installation like this airplane:

whereas there symbols like the transport bus station, and lighting symbol (that i have been created in inkscape 0.91) that don't have any option to change the fill colors and the outline?

I have red Changing colours in SVG symbol using QGIS? and didn't got suitable answer.


texts: Creating line between point layer and line layer

texts:
My goal is to create a line layer that is derived from the distance between a point layer and a line layer. An example could be using a line layer representing a road and a point layer representing a home or telephone pole.
I would like to create a vector line that extends from the road line layer to the point layer. Is there a Plugin for this?


texts:
I have a layer with about 250 points and I need to group them into groups of 30 points. How could I perform this operation in QGIS?

I researched on plugins and clustering techniques and the most common ones (k-means, hierarchical, etc.) do not present limitations to the size of the cluster, only to the radius of the cluster. I need to create cluster that upon reaching a certain size, 30, in this case, add no more points.
I did not find any plugins or metrics that explained how to do this.

To facilitate the understanding of my need, I would like to clarify that I work in a company that intends to send buses to look for its employees. However, you want to group your 250 employees into groups of 30, which is the ability of the buses in specific places, for the buses to go to the meeting place and get them all at once. For this, we want to group the employees in a group of 30 people according to the spatial location of their residence.


texts: How can I add data to a shp file attribute table from arcobjects?

texts:
I have a code that selects row data from a listview table in VB.net. I have declared that data as a variable and I can see it if I ask it to dispay a message box (see code below).

Now I would like to take that data and place it into either an existing or new shapefile using ArcObjects but I am unclear on the process.

Any hints or ideas would be helpful.

Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged

    'met en mémoire l'item selectionné
    Dim i As Integer

    If ListView1.SelectedItems.Count = 0 Then
        Exit Sub
    End If
    'Met en mémoire les sous items de l'item séléctionné
    Dim x As String = ""
    Dim y As String = ""
    Dim z As String = ""

    'séléction de l'index de l'item
    i = Val(ListView1.SelectedIndices.Item(0).ToString)
    ' spécifie de prendre toute la rangée sélctionné
    ListView1.FullRowSelect = True
    ' Set the view to show details.
    ListView1.View = View.Details

    'Fait en sorte d'extraire les sous items 1, 2, et 3 (les 3 rangée "message, GeoLat, GeoLong"
    x = (ListView1.Items(i).SubItems(1).Text)
    y = (ListView1.Items(i).SubItems(2).Text)
    z = (ListView1.Items(i).SubItems(3).Text)

    'Concatenation des trois sous items en une ligne.
    Dim a As String = ""
    a = i & " " & x & " " & y & " " & z

    MsgBox(Err.Number & "  " & Err.Description)
    'Pour verifier si la routine fonctionne...
    MessageBox.Show(a)

End Sub


texts: Joining several raster files using QGIS?

texts:
I'm new to QGIS.

How can I combine multiple raster layers into one layer?

The raster images are of different areas with very little overlap.

The goal is to bring numerous town plats into one project.


texts: How do I limit label placement based on the distance to neighboring features' labels in QGIS?

texts:
I'm attempting to label population centers in a map of a state which has a vast disparity between the population density in the west versus the east:

I'd like to reduce the clutter in the western part of the state. I see a lot of options in the Layer Styling pane for controlling label placement, but nothing that seems to limit label placement based on proximity to another feature (an orange city-limits polygon) on the same layer.


texts: QGIS crashes when geodatabase file opened

texts: I recently updated my version of QGIS to 2.6 Brighton and am no longer able to open geodatabase files, everytime I try the program quits. Is there a way to fix this or is this a bug with the new version?


texts: QGIS (2.18.x) crashes after changing symbology / style of vector files

texts:
All of a sudden, I face the issue of QGIS (2.18.15, and 2.14.21 as well) crashing when:
- activating layers in the map view from previously saved files.
- changing the styles / symbology of vector files, eg. categorizing after certain attributes by finally pressing 'OK'

I tried to reinstall qgis (sudo apt-get purge --autoremove qgis; sudo apt-get autoremove qgis). Furthermore, I tried to start it without loading plugins. Without success.

I currently run QGIS 2.18.15 on Debian 9.

I would like to fix this issue (and learn how it occured).

Addendum: Raster clipper doesn't work with masks from vector files.


texts: Query different PostGIS tables in the same QGIS expression

texts:
I connected QGIS to my local PostGIS database, which contain several tables. It looks like this:

I dragged and dropped one of the tables to the Layers area and started visualizing one of the columns from it. With the folowing expression:

Except now I want to normalize variable "v0743" by dividing it by "v1520", a variable which from another of the PostGIS tables (namely table "v1001_2000_hf").

Is it possible to achieve this in a single expression? If so, how?


texts:
I have been trying to create a hillshade using DEM data, however, regardless of the scale and z values I use the output is all black.

I accessed the DEM data from a government source and clipped it to the area I need (shown below).

Then I open the DEM (Terrain models) dialog and select this raster layer, choose an output file and fill in values for scale and z.  Based on this other thread I used the equations to calculate for my area:

s=111320*cos(latitude*pi/180)
z=1/(111320*cos(latitude*pi/180))

This results in a scale of 111310 and a z of 8.98.
To be clear, I've tried these numbers, I've tried just inputting the scale value and leaving z at 1, I've tried a whole host of values from threads I've come across, however, no matter the values, my result is always all black (shown below).

What am I doing incorrectly?

I am using QGIS 2.8.1 and the link to the data source I am using is: http://ftp2.cits.rncan.gc.ca/pub/geott/ess_pubs/210/210231/of_3678.zip


texts: PostGis: Add new geometry column & insert into it newly created polygon - violates check constraint enforce_srid

texts:
I added a new column by:

SELECT AddGeometryColumn('table_name', 'column_name', 4326, 'POLYGON', 2, false);

Which means 2D polygon in WGS84.

Then I inserted a new polygon into specific row by:

UPDATE table_name
SET column_name = ST_MakePolygon(ST_GeomFromText('LINESTRING(lon1 lat1, lon2 lat2 ... lon1 lat1)'))
WHERE gid=26;

The result is "violates check constraint enforce_srid" error. What am I doing wrong?


texts: Workaround for no point clustering in ArcGIS Javascript API 4.7

texts:
I'm working with the ArcGIS Javascript API v4.7 and I've run into a roadblock. I have several points on my map with the same coordinates. Therefore they show up exactly on top of one another with no way to access any of them but the one on top. Unfortunately, it looks like the v4.7 api does not yet have the clustering capabilities that the 3.x api had (See this matrix)

I'm wondering if anyone has any suggestions on other ways to deal with this issue, other than clustering. I'm seeing information on other ArcGIS tools, like the Desktop version, that use displacement methods on points. Most of these built in solutions (like arcpy or dispense markers) are not available in the javascript 4.x api.


texts: Is there a way to auto login to GeoServer using the REST API? I need to use REST API to login to GeoServer and open logged in page of GeoServer using REST API.


texts: Most of a shapefile is not exporting to ArcGIS Online or Google Maps

texts:
I am having an issue where the vast majority of the shapefile and point data is not exporting from ArcMap. Its just in one particular area where the polylines show, the rest do not show and this is happening on both ArcGIS Online and on Google Maps, after using a KML conversion.

I tried recreating the shapefile, and when I do all the records export with all of the data. The polylines are not M-aware. When I share the map to ArcGIS Online, during the map analysis phase I get warnings that four of the shape and point files do not have a feature template. Could that be whats happening?


texts: Adding field to multiple shapefiles including their designated filepaths as values using PyQGIS?

texts:
I am trying to create a script that navigates a directory and adds a field to a shapefile called "filepath" and then paste the file path in the rows of that parcticular shapefile. This is the code that I am working on below

enter code here
for root,d_names,f_names in os.walk(dest):
    for f in f_names:

        if f.endswith('.shp'):
            src = os.path.join(root,f)
            layer = QgsVectorLayer(path + f, f, "ogr")
            processing.run('qgis:fieldcalculator', {layer, 'Filepath' , 2 , 150 ,0 , True, src, src})

This is the current error that I get:

  TypeError: QgsProcessingAlgorithm.parameterAsBool(): argument 1 has
  unexpected type 'set'

I'm using QGIS 3.4


texts: Any way to use WGS84 latlng to dynamically get state plane EPSG code? Either javascript or PHP

texts:
I am developing an online project that needs to be able to accept a WGS84 lat lng anywhere in the lower 48 states and produce the corresponding state plane coordinates.

Once I know the state plane EPSG code then I can use http://spatialreference.org to get the parameters for that state plane zone and then use proj4js to convert the latlng to state plane.

But I am missing a piece.

Is there a way with javascript or PHP to find out the correct state plane EPSG code for a WGS84 latlng?

Is there some kind of REST API I can call that will return the EPSG code?


texts:
I want to use QGIS with c++ api like ArcGis runtime sdk. I tried to use Qgs3DMapScene class like

QgsAbstract3DEngine *m_window3DEngine;
Qgs3DMapSettings *m_mapSettings = new Qgs3DMapSettings;
m_window3DEngine = new QgsWindow3DEngine;
Qgs3DMapScene *m_3Dscene = new Qgs3DMapScene(*m_mapSettings, m_window3DEngine);

Qgs3DMapScene takes parameter as const Qgs3DMapScene( const Qgs3DMapSettings &map, QgsAbstract3DEngine *engine );

But since QgsAbstract3DEngine is an abstract class i can not create it. So documentation says to use QgsWindow3DEngine class which inherits from QgsAbstract3DEngine class. After using the QgsWindow3DEngine class as parameter for Qgs3DMapScene i get "no matching constructor error".

Is there a way to use this class or should i use a different class for 3d view?


texts: Small features don't draw when zoomed out using Geoserver WMS

texts:
I am using Leaflet to access polygon layers through Geoserver WMS. When I zoom out the smallest polygons will disappear and not draw. They would essentially be a dot if they did draw. Is there a way for the dot to be drawn? This makes it confusing to the user as it can be their impression that there are no polygons in certain areas unless they zoom in.

Alternately, is there a way to display things say in larger hexagons with aggregated data when zoomed out and then to have it seamlessly change to the smaller polygons as soon as someone zooms in?


texts: Programmatically load composer from template and generate atlas using PyQGIS

texts:
I am trying to build a plugin to load a print composer from file, generate an atlas and export to image. So far I have been successful in loading the template and exporting it to image.

I have been unable to add any of the layers in the legend (which are also in the toc) to the exported map, which results in a blank map and none of the field expressions working.

    # Get layers in the legend and append, must be a cleaner way to do this?
    layers = self.iface.legendInterface().layers()
    layerStringList = []
    for layer in layers:
        layerID = layer.id()
        layerStringList.append(layerID)

    # Add layer to map render
    myMapRenderer = QgsMapRenderer()
    myMapRenderer.setLayerSet(layerStringList)
    myMapRenderer.setProjectionsEnabled(False)

    # Load template
    myComposition = QgsComposition(myMapRenderer)
    myFile = os.path.join(os.path.dirname(__file__), 'MMR_Template.qpt')
    myTemplateFile = file(myFile, 'rt')
    myTemplateContent = myTemplateFile.read()
    myTemplateFile.close()
    myDocument = QDomDocument()
    myDocument.setContent(myTemplateContent)
    myComposition.loadFromTemplate(myDocument)

    # Save image
    myImagePath = os.path.join(os.path.dirname(__file__), 'come_on.png')
    myImage = myComposition.printPageAsRaster(0)
    myImage.save(myImagePath)

Here is a snippet from the loaded template which should setup the atlas:

 <Atlas hideCoverage="false" featureFilter="reference = '61922'"    coverageLayer="desktop_search20130615160118593" fixedScale="true" composerMap="0" singleFile="false" filenamePattern="&quot;reference&quot;" enabled="true" filterFeatures="true" sortFeatures="true" sortKey="0" sortAscending="true" margin="1"/>

I am also unsure of the best way to add all the layer in the toc to the instance of QgsMapRenderer().

Thanks


texts:
How can I properly rasterize isolines with an absolute height value in QGIS 3?

When using "gdal_rasterize" in the source code I got tiff with "holes", see image below


texts:
I would like to know if there is a plugin/method in QGIS to calculate zonal statistics (mean, median, range, max, min etc.) of a raster file, corresponding to a polygon that I draw/highlight in QGIS.

For example, I have a netCDF file open displaying and I know that using the point selection tool I can find the value at that location, but if I were to highlight an area (by clicking and dragging), can I calculate the summary values of this area somehow?

I am looking for an on-the-fly solution as opposed to needing to create a shapefile and running RasterStats or similar.


texts: merging 2 polygon adjacent to each other using R

texts:
I have several shp files which are the components (or tiles) of a map, I have joint all these tiles together to have a large shp file. Then I realized some of the polygon is now split into 2 halves, as the upper part belongs to a tile, while the lower part belongs to another tile.

This output disturbs me a lot as I need to fill some polygon, but not part of the "split polygon", so I need to find a way to merge these split polygon back to one (preferably mechanical way, as I have 10000+ polygons, not knowing which are split, which are not).

I need to know if the two or more polygons originate from the larger polygon. And I think I can somehow use union and spRbind to create an algorithm for this task. But I doubt if I am really the first one who encounters this problem, so I wonder if there is any existing tool in R that can solve this.

Thanks.


texts: Using URL for Map Service in ArcGIS Server Manager?

texts:
I am having a Map Service from a ArcGIS Server Manager which I would like to add to the .cshtml page of my MVC project is this possible like the way shown in here by ESRI

https://developers.arcgis.com/en/javascript/jssamples/index.html#latest_samples

I am able to use the samples but how do I use my Map.


texts: Overwriting shapefile or feature class using ArcObjects?

texts:
I can copy a shapefile but I want to be able to overwrite the copied shapefile to prevent multiple copies being created each time I run the program. I would also like for the saving and renaming of the copied shapefile to happen behind the scenes i.e. the user doesnt see a gxDialog box.

How do I overwrite the copied file, either as a shapefile or feature class?


texts: ERROR 000464 when trying to update domains

texts:
I have a python script which runs nightly to update a few domains in an Enterprise Geodatabase (Oracle). I'm using the arcpy.TableToDomain_management tool. The script works fine unless there are schema locks on the domain. In particular, if ArcMap is open with a layer that is using one of these domains, the script fails to update the domain.
The error returned is:
ERROR 000464: Cannot get exclusive schema lock.  Either being edited or in use by another application.
Failed to execute (TableToDomain).

I have attempted to disconnect users, thinking that would work. The code to disconnect users is:
def dropUsers():
    userList = [user for user in arcpy.ListUsers(sde_workspace)]
    for user in userList:
        try:
            arcpy.DisconnectUser(sde_workspace, user.ID)
            print('Disconnecting user: {0}, userID: {1}.'.format(user.Name, user.ID))
        except Exception as e:
            print('Could not disconnect user: {0}, userID: {1}.'.format(user.Name, user.ID))
            print(e)
        finally:
            arcpy.AcceptConnections(sde_workspace, True)

sde_workspace in the above code is a path to a connection file using the sde account.
The code to actually update the domain is:
arcpy.TableToDomain_management(os.path.join(output_folder, '{}.csv'.format(workzone)),code_field='Code',description_field='Description',in_workspace=destination_workspace, domain_name=domain_name,update_option="REPLACE")

destination_workspace in the above code is a path to a connection file using the domain owner.
No matter what I try, I cannot update the domains. I should also add, that I tried the TableToDomain geoprocessing tool and got the same 000464 error. However, if I close ArcMap and ensure no one else has ArcMap open, and I don't disconnect users, it works fine.
I'm using ArcMap 10.8.


texts: How do you configure a connection to MS SQL Server from QGIS 2.18 on Linux?

texts:
I am attempting to connect to an MS SQL Server Database from QGIS 2.18 on running on Ubuntu 16.04.

I receive this error when clicking on the "List Databases". The login is a SQL Server login (not an active directory login), so it should be straight forward.

Are there additional packages that have to be installed in order for QGIS to form the connection to SQL Server?

OS Version:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial

QGIS Version:

QGIS version
2.18.13
QGIS code revision
8cba0bb
Compiled against Qt
4.8.7
Running against Qt
4.8.7
Compiled against GDAL/OGR
1.11.3
Running against GDAL/OGR
1.11.3
Compiled against GEOS
3.5.0-CAPI-1.9.0
Running against GEOS
3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version
9.5.2
SpatiaLite Version
4.3.0a
QWT Version
5.2.3
PROJ.4 Version
492
QScintilla2 Version
2.9.1

SQL Server: 2014


texts:
I am using shp2pgsql in a bash script to import shapefiles into postgres. I can successfully do this for shapefiles with hundreds of records however shapefiles with tens of thousands of records (in this case ~40,000) hangs so I have to use the postGIS shapefile importer in pgAdmin (which works ~30-45 seconds to complete).

I realize it's a substantial jump in magnitude regarding the number of records. Is it possible if I wait long enough it will succeed?

what are the runtime/data limits for shp2pgsql?


texts:
I have two Excel-Files (and after import two layers) where points are stored. They are around 2-4m away from each other.
How can I delete, or better, merge them to one point on map and on (fully) export to Excel again?
How to export to Excel with coordinates included in this file?


texts:
I am new to GeoRSS (& RSS also) and I have created small sample which displaying latest earthquake on map.

According to GeoRSS definition/concept, it is showing the feeds across the world using latitude, longitude information but I am not able to see that information in xml file.

I am using this xml file so the feeds are really coming from that place or somebody updating/replying that information in xml file

Going through this link and trying to understand the workflow (how the RSS feed get lat,lon from Geo-names database.

Any help regarding this like answer/explanation will be great!!


texts: Deploying Geoserver 2.5 using JBoss 7.1.1

texts:
I have geoserver deployed in tomcat Web container and i like to move the geoserver into JBOSS is it possible to deploy 'geoserver folder' directly to JBOSS??

I tried to deploy geoserver 2.5 war file under JBOSS 7.1.1 in windows XP, But when i try to enable it in JBoss management / deployment section following is the response am getting

and I also getting the following error in error console

Unknown error
Unexpected HTTP response: 500
Request
{
"address" => [("deployment" => "geoserver.war")],
"operation" => "deploy"
}

Response

Internal Server Error
{
"outcome" => "failed",
"failure-description" => {"JBAS014671: Failed services" =>     "jboss.deployment.unit.\"geoserver.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"geoserver.war\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"geoserver.war\""}},
"rolled-back" => true
}


texts: Can the formula used to calculate a field in a QGIS attribute table be viewed after it was run?

texts:
I have a .shp which had undergone some edits to the attribute table a while back. A formula was used to recalculate some of the field values. I now don't have access to the knowledge of how these fields were calculated. Does QGIS store this type of information anywhere in the file of is it lost after the calculations are done?
I could attempt a reverse calculation but this would prove somewhat time consuming and would prefer to get it straight from the horses mouth.


texts: Road Network with 4th & 5th road level (small agriculture roads & footpaths)

texts:
I have a need to use 4th & 5th level roads (small agriculture roads & footpaths) for Germany and the only provider I could find is the Logiball.

Is anybody aware of another provider?


texts:
I made a SQLServer database structure based on an XSD schema I got. In that schema two fields have gml:TimePeriodType. In database I put two columns for each field of this type (begin and end) and the datatype is datetime. I use FME to translate database into GML, and then MapForce to map that GML to XSD schema.

I supposed that I can map begin and end column to some attributes of TimePeriod columns in my XSD schema. But (guess), I cannot do it. Can some help me what I need to do and where I am wrong?

FME is translating this columns into string (e.g. 20140522000000.000), which is weird to me (I think I need 2014-05-22T00:00:00 format).

What I am missing?

Sorry if question is stupid, but I am new to all of this, and I need pointers for going forward.


texts: AutoCAD map server's text to ArcGIS Annotation - SAFE FME

texts:
autocade
Software: SAFE FME
Geodatabase - enterprise geodatabase

we have autocad data stored in oracle database and wishes to port them over to ArcGIS Annotation (text).

We are unable to do so just by directly migration.

after investigation we realize that the autocad store the alignment in line or point form and text in context.

May I know if there is a possible way to migrate them over?


texts: I want to navigate the map using mouse drag. we did it in openlayers2 using navigator control. Does Openlayers 3 have navigation control? should I add it to map like Openlayers 2?


texts:
Is the FME Extension for ArcGIS required in order to use arcpy scripts in FME? I dont think it is but when i run a simple startup/shutdown script in FME I am getting these error messages.

This article makes no mention of any known issues with the FME Extension for ArcGIS.

I am running FME 2013 SP2 (32bit) and ArcGIS 10.1 on a 64bit machine. A custom python intepreter has been set for FME [C:\Windows\SysWOW64\python27.dll]


texts: Adding metadata link to layer.resource in GeoServer with Python gsconfig?

texts:
I'm parsing layers from a catalog and I would like to edit metadata links directly from the code.

Until now, I tried:

cat = Catalog("http://localhost:8080/geoserver/", XX, YYY)
layers = cat.get_layers()
for layer in layers:
    lyr = cat.get_layer("layer_name")
    lyr.resource.metadata_links.append(('text/html', 'other', 'metadata.html'))
    cat.save(lyr)

---- EDIT -----
Found out the answer, see below.


texts:
I'm using QGIS 3.8 with GRASS. I have 3 rasters that are located far from each other and I would like to merge them into one raster layer.

I managed to merge 2 of them but the third one makes problem (I tried also all the 3 but it didn't work).

I got this error message:

Loading resulting layers The following layers were not correctly generated.
C:/this/is/a/path/Temp/processing_e3ae725664cf414481ec8d6bc10a25b3/c955b92928c545d29bc4ec3040703495/OUTPUT.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

I have created the problematic layer again but it didn't work. I don't know if it has to do with their distance from each other:

The blue is the merged ones and the red is the problematic raster.

My end goal is to have all of the 3 rasters in one layer. How can I achieve it?


texts: Landsat MSS data Masking for Clouds and Water bodies

texts:
I'm trying to construct mask for Landsat-1 mss data for:
clouds
clouds shadows
water bodies
Mainly using either ArcGIS, ENVI, Matlab and R softwares.
Firstly, I started with the mask for water bodies. Since MSS data does nor provide a BQA band for water. For this purpose I used ArcGIS Desktop and applied a 4 classes non supervised Iso Cluster algorithm classification and then reclassify water as 1 and the rest of the categories as 2 to get a first reclassification of the water-land mask. The Iso cluster algorithm in ArcGIS tools for some reason confuses some areas of potential "shadows of the mountains and hills" or potential effects of the terrain of MSS data as the same category as water leading to some mistakenly classified pixels of land as water. Most of water bodies are correctly classified as such, since are pool or small water bodies, but the a substantial import number of pixels incorrectly classified as water being land potentially due to "shadows of mountains and hills" of some "terrain effect".

What could be a relevant procedure to solve this problem of scattered pixels incorrectly classified as water within the land class?
Secondly, as far as I undertand the the BQA band for masking provided by Landat-1 MSS data is for clouds only. However ir appears to have many different class of clouds inside the same band.
How can I process such BQA bad with many categories in it to obtain a simple single binary mask band of the most important and relevant clouds from it?


texts: Convert CSV to Shapefile using GDAL_translate

texts:
I have some CSV files that need to be converted to ESRI shapefile.
These files are built like explained in the section "Building line geometries" from the GDAL documentation.
For example one file can be like this:

> head river_xy2.csv
way_id,pt_id,x,y
1,1,11.836,44.829
1,2,11.827,44.829
1,3,11.818,44.829
1,4,11.809,44.838
1,5,11.8,44.847
1,6,11.791,44.856
1,7,11.782,44.856
1,8,11.773,44.856
1,9,11.764,44.856

GDAL understands this, for example I can do:

ogrinfo river_xy2.csv -dialect SQLite -sql "SELECT way_id, MakeLine(MakePoint(CAST(x AS float),CAST(y AS float))) FROM river_xy2 GROUP BY way_id"

And I get a nice list of OGRFeatures in output. However, how can I save that to a shapefile? If I try to use GDAL_translate:

> gdal_translate -of "ESRI Shapefile" -a_srs EPSG:4326 river_xy2.csv river_xy2.shp
ERROR 4: `river_xy2.csv' not recognized as a supported file format.

While if I remove the first row I get an error after the first feature:

ERROR 1: Ungridded dataset: At line 549, change of Y direction

EDIT:
It looks like I can do:

ogr2ogr -dialect SQLite -sql "SELECT way_id, MakeLine(MakePoint(CAST(x AS float),CAST(y AS float))) FROM river_xy GROUP BY way_id" -a_srs EPSG:4326 river_xy.shp river_xy.csv


texts: Using CSV file to add values to value map?

texts:
I'm trying to populate a value map in the edit widget with some values from a csv file.

Could anyone let me know what format the csv file has to be in?
At the moment I have just a list of comma-separated values (in UTF-8 if that matters), but when i click on 'Load data from CSV file' and browse to the relevant file, nothing happens.

I am using QGIS 2.6.


texts:
I've been tasked with creating a simple MapBasic plug-in that will loop through a table in MapInfo, zoom to the location of each point, create a circle to highlight the point, and convert the map to JPEG.

I've got all the steps working except the loop (I'll post a separate question for that) and the creating a circle. This is the code I use for outputting a single JPEG;

levelOfZoom = 2
circRad = (levelOfZoom / 10)
Select * from TabName where StructureNo = sName Into Zoomtable
Set Map  Center (Zoomtable.Easting, Zoomtable.Northing)
east = Zoomtable.Easting
north = Zoomtable.Northing
Add Map layer Zoomtable
Insert Into Zoomtable (obj)
Values(CreateCircle(east, north, circRad))
Close Table Zoomtable
Close Table Selection

Set Map  Zoom levelOfZoom Units "km"
Save Window my_window_id As "U:\MapInfoOutputs\"+sName+" at "+levelOfZoom+"km.JPG" Type "JPEG" Width 5.20833 Units "in" Height 3.75 Units "in" Resolution 128

I'm getting a 'Zoomtable is read-only' error when I try and execute.
If I change the

Insert Into Zoomtable (obj)
    Values(CreateCircle(east, north, circRad))

To;

Update Zoomtable set
            obj= CreateCircle(east, north, circRad)

It creates the circle, but replaces the original point. I need the original point to show with the circle round it to highlight it.
Also, the circles need to be removed once the jpeg has been created, I'm not sure how to do this, but having a map with


texts: True color combination using Resourcesat-1?

texts:
I am working with an image from India. According to the metadata, I am working with an image acquired by the AWiFS sensor from Resourcesat-1:

<Name_of_the_Satellite>Resourcesat-1</Name_of_the_Satellite>
<Sensor>AWiFS</Sensor>

Which according to Wikipedia uses the following bands:

Each band was delivered in a separate image, so I have stacked them.

Now, my question is how to get a true color combination using those bands.

I remember that the following wavelengths correspond (more or less) to the following colors in the electromagnetic spectrum:

0.4-0.5 µm: B
0.5-0.6 µm: G
0.6-0.7 µm: R

Looking at the chart above, I realize that Blue is missing. So, is it even possible to get a true color image from these bands? If not, what would be the closest I can get?

My remote sensing skills are a little rusty as I am not working with imagery too much. I hope my question is clear. I am using QGIS 2.6.0 (what I used to stack the images), in case that makes any difference, but I am open to other options as well.


texts: ArcGIS Survey Analyst extension not working on Windows 10?

texts:
I am using ArcMap 9.3 for some digitization work. I have survey data from total station, data are comma seprated has pointid, northing, esting, height and comments as below

6001,3052500.000,532500.000,1000.000,
6005,3052500.000,532568.219,1000.000,
1,3052495.945,532477.080,1000.063,HC
2,3052494.001,532493.357,1000.055,HC

I am using Survey Analyst Extension to import point data. It works well in windows7 but not working on win8 and 10.

Every steps of the Import Survey Data Wizard works well but it does not respond on click of finish button.

What might be possible solution to make this work on windows 10?


texts: Howto write QGIS server WMS GetPrint with 'OR' in filter

texts:
According to the QGIS manual I can include 'OR' in a WMS GetPrint request (https://docs.qgis.org/3.4/en/docs/user_manual/working_with_ogc/server/services.html#filter)

But I cannot get it to work and I have not yet found an example of what the syntax should look like. Just one of the options I tried:

&FILTER=layer1:"attribute" = 3; layer1:OR("attribute2" = 5, "attribute2" = 6)


texts: Difference between GEE and sklearn random forest output

texts:
I am training a random forest in GEE to predict canopy cover. See here for example. Implementation of RF is

var rf_model = ee.Classifier.randomForest(5).train(to_TrainAll, target, bands);

My predicted output mean value is low (expected ~20%, predicted ~8%) so I exported the training data and estimated using the sklearn implementation of RF and this returned a more realistic value. Training data available here.

import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestRegressor

df = pd.read_csv('/Users/phil/Google_Drive/training_data_100.csv')
bands = ['B5','B7','B10', 'B11_mean','B1_variance3','B2_variance3','B8_variance3',
         'B8A_variance3','B12_variance3','B2_variance5','B8_variance5','B9_variance5',
         'B10_variance5', 'ndvi','ndvi_stdDev_5','ndvi_temporal_variance',
         'slope','aspect','precipitation','tavg_min','tavg_max']

output = []

for _ in range(10):
    df.loc[:, 'train'] = np.random.random(size=len(df)) < .95
    X = df[df.train].cc.values.reshape(-1, 1)
    Y = df[df.train][bands].values
    rf = RandomForestRegressor(5).fit(Y, X)
    output.append(rf.predict(df[~df.train][bands]).mean())

print 'actual: {:.2f} predicted: {:.2f}'.format(df.cc.mean(), np.mean(output))

  actual: 20.15 predicted: 20.37

Also if I run

ee.Classifier.cart().train(to_TrainAll, target, bands);

I get a more realistic value. What am I doing wrong?


texts: Get reclassified area categories in hectares using Python and GDAL?

texts:
I have a raster with reclassified values and I would like to get the area in hectares of those reclassified categories.

#RBR reclassification to USGS burn severity values

arr = np.array(RBR)

level1 = (arr >= -0.500) & (arr <= -0.251) #-2 #Enhanced Regrowth, high (post-fire)
level2 = (arr >= -0.250) & (arr <= -0.101) #-1 #Enhanced Regrowth, low (post-fire)
level3 = (arr >= -0.100) & (arr <= 0.99) #0 #Unburned
level4 = (arr >= 0.100) & (arr <= 0.269) #1 #Low Severity
level5 = (arr >= 0.270) & (arr <= 0.439) #2 #Moderate-low Severity
level6 = (arr >= 0.440) & (arr <= 0.659) #3 #Moderate-high Severity
level7 = (arr >= 0.660) & (arr <= 1.300) #4 #High Severity

levels = [level2, level3, level4, level5, level6, level7]
reclass_values = [-1, 0, 1, 2, 3, 4]

RBR_reclassed_arr = np.where(level1,-2, arr)
for level, val in zip(levels, reclass_values):
RBR_reclassed_arr = np.where(level, val, RBR_reclassed_arr)

saveRaster(RBR_reclassed_arr,path_RBR_reclass,cols,rows,projection)

After this I plot a cmap, but this is not relevant in this case. So next I would like to get that areas in hectares:

levels = {
'Unburned': 0,
'Low Severity': 1,
'Moderate-low Severity': 2,
'Moderate-high Severity': 3,
'High Severity': 4
 }

for cat, val in levels.items():
n_pixels = (RBR_reclassed_arr == val).sum()
print(n_pixels)

After this I would like to get in ha:

gt = B8_prefire.GetGeoTransform()
pixel_area = gt[1] * abs(gt[5])
print(n_pixels)


texts:
Using “calculate field” in python script fails to display Arabic characters correctly.

I have exported the modelbuilder to python script, but unfortunately the Arabic characters cannot by displayed correctly when the script is executed.

# Import arcpy module
import arcpy
# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "D:\\Test.gdb"
arcpy.env.workspace = "D:\\Test.gdb"
# Local variables:
Buildings_POINTS = "D:\\U.gdb\\Buildings_POINTS"
# Process: Calculate Field
arcpy.CalculateField_management(Buildings_POINTS, "Ref_MOLG", "\"المخططات الهيكلياهلين المعلن للاعتراض\"", "PYTHON", "")

Now when I copy the script to python:

I believe that its a Unicode issue. how can I fix it.


texts:
I have been looking at the UTFGrid specification and the usage of UTFGrid in Openlayers.

How do I create the required UTFGrid files for my data in PostGIS?


texts: Access to ITableFields interface from an ITable or IObjectClass interface

texts:
I am working in a File Geo Database and need to set certain columns to be readonly from an ArcMap user perspective only.  I am aware of the IFieldEdit.Editable property, however that locks it down from me being able to edit the columns programmatically as well.

On the feature layer level this is easily done by casting the IFeatureLayer interface to ITableFields and accessing the IFieldInfo3 interface for that specific field as such:

public static bool isFieldReadOnly(IFeatureLayer featureLayer, string fieldName)
{
        ITableFields tableFields = (ITableFields)featureLayer;
        IFieldInfo3 fieldInfo = (IFieldInfo3)tableFields.get_FieldInfo(tableFields.FindField(fieldName));
        return fieldInfo.Readonly;
}

However, how can this be done on an ITable or IObjectClass interface?

I have an ITable created in the same workspace using IFeatureWorkspace.CreateTable(...) method.


texts:
I am looking for a way to check the mxd version of a bunch of mxds. I found a script here at ArcPy method to determine ArcMap document version

I am using ArcGIS 10.3.1 on my desktop.

It goes through the directories and for every mxd it finds it grabs a bunch of details, one of which is the version. My only problem is that sometimes it can not find the version of ArcGIS; it seems to be about 50/50. At first I thought if it didn't return that correct value that meant it was below 10.0. But running my script on 200 mxds it returned the value 9.3 a few times, which means that the ones where it does not return any value could be any version and not just something below 10.0.

The current code taken from the other question:

def getMXDVersion(mxdFile):
    matchPattern = re.compile("9.2|9.3|10.0|10.1|10.2|10.3")
    with open(mxdFile, 'rb') as mxd:
        fileContents = mxd.read().decode('latin1')[1000:4500]
        removedChars = [x for x in fileContents if x not in [u'\xff',u'\x00',u'\x01',u'\t']]
        joinedChars = ''.join(removedChars)
        regexMatch = re.findall(matchPattern, joinedChars)
        #print mxdFile
        #print joinedChars
        #print regexMatch
        if len(regexMatch) > 1:
            version = regexMatch[len(regexMatch) - 1]
            return version
        elif len(regexMatch) == 1:
            version = regexMatch[0]
            return version
        else:
            return 'version could not be determined for ' + mxdFile

Is there any other way to find the map document's version number?


texts: Why doesn't QGIS export polygon styling when saving to KML?

texts: I'm trying to convert shp to kml using the Save As... dialog in QGIS 2.16, but none of the layer styling is appearing in the output kml. I've chosen the 'feature symbology' option, it doesn't seem to do anything. The output is always hollow polygons with a 1px red border. Is this normal behaviour?


texts:
I have been working almost half a year now trying to create a modern digital map of the local towns protected historical silver mines. The only GOOD map over the mines dates back to 1794. A new map was started on in 1920, but never finished.

This is a non-commercial hobby project, but the national Mining Museum of Norway supports me with access to historical maps and other available sources.
Although I have no experience contributing to maps, drawing the map is not a problem. I have found the Go Maps ipad app for openstreetmap (OSM) to be an exellent work tool with a digital terrain model (Lidar?) as background when I combine it with surveys.

My problem is that if I want to play by the rules using 100% correct tagging, what I draw will never be visible on OSM.
By cheating a little with the tags, what I have drawn so far is visible on Mapnik and is being used by people visiting the area. On my recommendation they are using an app like Galileo Offline Maps to tell them where they are and where to find f.ex. the adit of a mine.
What I miss the most in Galileo is the option to click on an object on the map and then open a panel showing the existing tags incl. links to web pages containing more info about the selected object.

I can easily extract what I draw from OSM and store on my computer as KML or GeoJSON data. It also seems I could be able to achieve what I am describing above with a Google MyMaps layer - but it would be nice to be able to do this independently of a commercial company.
I believe I am searching for an app where a “correctly” OSM map will be displayed with all details - or for a tool to create something myself without any knowledge except a bit of basic programming back in the 1990s.
Does eventually someone here know people who write such apps and/or render OSM Maps just for the fun if it?

Stein


texts: Openlayers creating RegularPolygon that is too small then return false

texts:
My project has to use imagelayer to show map , it can create box on map, box will be a area to put device marker on top , but when the box is
  too small , there will be a bug in project..., so is there some one who can tell me how to prevent this from happening?

The code is below:

// map init
$map = new OpenLayers.Map("gmap");
$map.addControl(new OpenLayers.Control.MousePosition());

//add basic layer
$map.addLayers([new OpenLayers.Layer.Image(
    'Main Layer',
    'images/ec/area/area1.jpg',
    new OpenLayers.Bounds(0, 0, 2565, 1293),
    new OpenLayers.Size(1282.5, 646.5),
    {layers: 'basic'}
)]);

//add vector Layer to map
vectorLayer = new OpenLayers.Layer.Vector("Overlay");//Area layer
vectorLayer1 = new OpenLayers.Layer.Vector("Overlay1");//device layer
$map.addLayers([vectorLayer,vectorLayer1]);

selectControl = {
    selector: new OpenLayers.Control.SelectFeature([vectorLayer,vectorLayer1], {
        onSelect: createPopup,
        onUnselect: destroyPopup
    }),
    box : new OpenLayers.Control.DrawFeature(vectorLayer,
        OpenLayers.Handler.RegularPolygon, {
            handlerOptions: {
                sides: 4,
                irregular: true
            },
            callbacks: {
                up: function(geometry){

                    if( geometry.getArea() < 2500 ){
                        alert("Box too small can not be create!");
                        return false; //still can not return false!!!!
                    }
                }
            }
        }
    )
};

//this can log Area Size But can not return false!!
selectControl["box"].handler.callbacks.create = function(data) {
    if(data.getArea() < 2500){
        console.log("Area Size:"+data.getArea());
        return false;
    }
}

Should I check when the box too small then remove it?

Or how to prevent the create box when the box is too small?


texts: Aligning shapefiles from different ArcMap documents?

texts:
I've been working on this one ArcMap document containing a shapefile of Hong Kong (HK) city. I've been adding lots of shapefiles to the city and creating mostly polygons(see below pic). I've made sure my data frame's coordinate system is the same as all the shapefiles in my document which is Hong_Kong_1980_Grid.

Then, I made a new arcmap document and imported an image which showed the vessel fairways of HK. I did not give the image a spatial reference as I can't figure out a way of doing it, but I'm not sure its necessary(?).Anyway, I digitized the fairways, again making sure they had the Hong_Kong_1980_Grid coordinate system. Then, I exported these shapefiles and made sure the coordinate system was the same as the data frame's. I then saved my document and opened back up the HK city ArcMap document. Then I imported the fairway shapefile into the document but found that they were not aligning although they have the same coordinate system. I can't seem to find a good answer online.


texts: Showing symbol even in case of polygon size is small in QGIS

texts:
I need to show at least one symbol (ideally on the center) on a polygon even if its size is small like in the picture below. In ArcGIS we succeeded but we need it on QGIS.
Updated to make the question more clear. In below picture scale is 10,000 and every polygons have symbols, ok, the polygon with number 15 is not ideal.

When we change scale to 25,000 symbols of some polygons doesn't show its symbols. I think it is because of view size of polygons is small to show it, at least qgis decided like that. I need to show at least one symbol on polygon in that case.


texts: Can an htm file be imported into Trimble's Data Dictionary Editor?

texts:
We've received several data dictionary files from other entities and they all are in *.htm format. We were hoping to not reinvent the wheel, as these are massive data dictionaries, so does anyone know if there is any way to import these files into Trimble's Pathfinder Office data dictionary editor? This is from more than one entity, so it made me wonder if there's something I'm missing or didn't know about htm files and data dictionary files. Thank you in advance. Here's a snippet of the htm file, I cut out several
 and
:

Attribute_Label:  PostSystem

Attribute_Definition:  Sign post system.

Attribute_Definition_Source:  GIS/BCPWD

Attribute_Domain_Values:

Enumerated_Domain:

Enumerated_Domain_Value:  Other

Enumerated_Domain_Value_Definition:  Other

Attribute_Domain_Values:

Enumerated_Domain:

Enumerated_Domain_Value:  Round

Enumerated_Domain_Value_Definition:  Round

Attribute_Domain_Values:

Enumerated_Domain:

Enumerated_Domain_Value:  Telespar

Enumerated_Domain_Value_Definition:  Telespar

Attribute:

Attribute_Label:  PostSupport

Attribute_Definition:  Sign post support.

Attribute_Definition_Source:  GIS/BCPWD

Attribute_Domain_Values:


texts: Working with File Geodatabase in QGIS for MAC OSX?

texts: I understand there are programs like OSGeo4W that allow windows users to work with Esri File Geodatabases, but is there something similar for Mac OSX 10.6?