texts: ogr2ogr postgres import: check if dataset exists

texts:
I have a PostGIS database which I update daily with ogr2ogr using CSV files. This works great.

Is there a way to check whether the actual value of a column already exists in the table (e.g. "event_id"=abc123 (no primary key)) and if so, that it will not append the dataset to the table. The other datasets that are not in the table should be appended to the table.

This is my actual command-line:

ogr2ogr -f "PostgreSQL" -append PG:"host=localhost user=user password=pw dbname=test" data.vrt -nln table_name


texts: I wonder if there is an option to add a CRS to QGIS which is not listed in the internal database of the program. I read that PostGIS allows adding a custom CRS.


texts:
I have a column as a string 10/12/2020 13:14:39 I want to convert it to Date format (I'll do that using the refactor tool later). First I need to rearrange this so the time is discarded and the dd/MM/yyyy is arranged as yyyy/MM/dd.
I'm using field calculator, how do I do this?
I've tried to_date("CreatedAt", 'dd/MM/yyyy') and format_date("CreatedAt", 'dd/MM/yyyy') neither give the correct result.


texts: Create a ground overlay kml from georeferenced raster

texts:
I have a world georeferenced raster (5m resolution, ~4000 x 4000 pixels) that I would like to display in google earth. I am looking for a simple and effective way to generate this kml file.

Using ArcGIS layer to KML outputs a kmz and resample the raster (I went as far as 3000 dpi, but quality is still pretty low)
Using GDAL raster2tile is slower than ArcGIS, but it also resample the image, yielding low quality output (I do not know how or if it is possible to tweak dpi or quality).
Using R maptools::GE_SpatialGrid function gave the best results so far, as it simply outputs a xml file specifying the extent of the raster. Though it does not display fully in Google Earth (no error message).

To sum it up, my preferred method would be to output a kml file, that would be entirely displayed in google earth.
I like the kml idea of simply specifying an extent, it is easy to update the raster without any more processing.


texts: Line intersection with multiple polygons from a shapefile in PostGIS/PostgreSQL database

texts:
I am trying find where a line (chosen by a user) intersects any of the multiple polygons within the shapefile. The shapefile is in EPSG:4326 and the coordinates are in (longitude, latitude).

I have loaded a shapefile containing all the buildings (i.e. polygons) from the centre of Rome and have built a schema inside a database with a PostGIS extension (note, PostGIS version: 2.3).

Link to SQL dump and shapefiles used for polygons of my current database set up: https://www.dropbox.com/sh/khszbfwg4lw8l64/AABtnTfgld6EyLwTHwR84ICLa?dl=0

output from my current query '':SELECT ST_AsText(ST_Intersection('LINESTRING (12.497626 41.897156, 12.4922 41.8902)'::geometry, geom::geometry));

I realise I am most certainly at fault here, as I'm no PostGIS expert. However, I'm stuck as 'geom'  is a column in the schema, hence, I'm uncertain as to how to proceed.

I have looked at the following similar-ish questions:
Intersection of multi-polygons in PostGIS
and
Intersection between line & polygon in PostGIS?
yet, I am still at loss on how to continue.


texts:
Is there a way to get the cluster or xytolerance from a shapefile into python using free/open source software?

I'm currently using the pyshp package and can't see methods for this anywhere.  Also it doesn't seem to appear in the WKT of the .prj file.


texts: In Google Earth Engine how can I find the elevation height of connected components

texts:
Requesting programming help / guidance In Google Earth Engine, to find how tall each connected patch of elevation data is in the flowing image "LabledSlopeElev" with 4 bands of information.  The first band is "labels" with unique names from "connectedComponents".  For each patch of connected Components I want to find the Max and Min value from the "elevation" band and calculate the height of the patch by subtracting the Max from the Min.  Finally, I would like to add a new band storing that height value for every pixel of the patch, such that when you click on a pixel in a patch you can see the height of the patch in the Inspector.

Here's my code so far.  I'm pretty new to this style of programming.

'''
var USNED = ee.Image('USGS/NED');
Map.setCenter(-76.816138, 39.315564, 16); // Daniles Maryland

// Load a table of state boundaries and filter.
var fc = ee.FeatureCollection('TIGER/2016/States')
    .filter(ee.Filter.eq('NAME', 'Maryland') );
var USNEDclip = USNED.clipToCollection(fc); //selected elevation data

var slope = ee.Terrain.slope(USNEDclip);

// Create a "Low elevation mask" revaling all the high slope areas
var High1 = slope.gte(38.0);
Map.addLayer(High1.updateMask(High1), {palette:'fc03f4'}, 'High Elev', true); // purple is high slope areas

// Uniquely label the patches.
var patchid = High1.connectedComponents(ee.Kernel.square(1), 256);

//Concatenate the given images together, bands will be - label, slope:int, elevation, slope_1:float
var LabledSlopeElev = ee.Image.cat([patchid, USNEDclip, slope]); print('LabledSlopeElev', LabledSlopeElev);
Map.addLayer(LabledSlopeElev, {} , 'Labled Slope Elev', false);
'''


texts:
Using a Trimble GeoExplorer 6000 Series GeoXT Handheld, I recorded uncorrected GNSS positions, for example:

Horizontal estimated accuracy in the field 4 meters.
Vertical estimated accuracy in the field 10 meters.
Position Dilution of Precision PDOP = 2

Am I correct in saying that these accuracies are specified as RMS and have 68% vertical confidence and a 63–68% horizontal confidence?
Is this accuracy ±? For example, is the horizontal accuracy ±4m or is it 4m across = ±2m?


texts: Manually sorting features in ArcGIS according to field other than what is being symbolized?

texts:
I have a hexagon grid with the dominant species of tree listed in each cell. I want to symbolize the tree type but put them in order of percentage of dominance in the legend. So a table like this:

Maple - 85%
Oak  - 100%
Pine - 75%

would end up looking like this in the legend:

Oak  - 100%
Maple - 85%
Pine - 75%

despite being out of alphabetical order.


texts: Loading SLD style (*.SLD) for vector layer in PyQGIS

texts: I'm writing a PyQGIS script for loading a set of vector layers in QGIS, and for them I have fixed SLD styles, how can I style them in the script?


texts: Fast way to get all points as integer of a LineString in shapely?

texts:
So I have a shapely LineString:

print np.round(shapely_intersecting_lines.coords).astype(np.int)
>>> array([[ 1520, -1140],
           [ 1412,  -973]])

I want to get all the points in between, that is I want to get the points of the line in between as integer values so I can use them in an image. Anyone know how I can do this with shapely? Or do I have to use another library. I need this to be as efficient as possible as I will be doing this many times.


texts:
I'm trying to clip "Terrain" raster I downloaded from the portal (https://www.arcgis.com/home/item.html?id=58a541efc59545e6b7137f961d7de883) in the shape of a polygon (a country's boundaries) by using "Clip" tool but the tool doesn't work properly. It gets stuck at 2% while running.

What could be the reason?

I'm using ArcGIS Pro 2.2.3.


texts:
I am trying to create a project and to make maps in that I have an specific template which is stored as a .qpt file. Now I want the data frames in the template to be changed using the Python code so that one by one maps can be created.
Is there any way so that I can create maps automatically?
Note: I had already tried atlas feature and it is not working for me .


texts: In memory spatial index for frequent updating point objects

texts:
Is there any in memory spatial index specialized for frequent updating point objects?

The dataset will be moving cars, most likely update per second but with millions of them.

The project will be written in c/c++.


texts: How can I extract only band 4 from a geotiff multi bands to create geotiff or AAIgrid with this band using Python?

texts:
I have a geotiff file with many bands...

I will like to create a .asc file or tiff file by converting only one band from the geotiff file.

I don't find the solution by using python...

With os.system, i use:

os.system("gdal_translate -b 4 -of AAIGrid C:\in.tif C:\out_onlyband4.asc")

it is ok, but i will like to use by from osgeo import gdal... How can i do that?

from osgeo import gdal

drv = gdal.GetDriverByName('AAIGrid')

ds_in = gdal.Open('in.tif')

#i just want to extract one band (sample 4...) and create AAIGrid or GTiff with only one band, can you help me?

ds_out = drv.CreateCopy('out_onlyband4.asc', ds_in)

ds_in = None

ds_out = None


texts: Sequential rasters - when did point x change

texts:
Using ArcGIS 10.1 with Spatial and 3D Analysts, and Python 2.7

I have a series of reclassified rasters in which every cell is either one or zero.  I need to programmatically create a single raster which shows when each cell first had a value of one.  The rasters contain the date in the filename, as well as in a date field in the raster. (More detailed description of the data below)

I am completely stymied.  I've tried using the Plus function in Spatial Analyst, but I lose the date.  I have very little experience working with rasters, so I'm hoping that the problem is my unfamiliarity with the terminology, and that someone can point me in the right direction.

If I can figure out how to do it ‘by hand’ in ArcMap, I’m confident I can create the scripts to automate the process.  Of course, a ready to go script would be very nice :^)

The data is 35 years of sea-ice concentration shapefiles from the Canadian Ice Service.  Clipped tifs were generated and reclassified so that each cell in the raster has a value of either one, if the ice concentration is below 50% (break-up), or zero if it is not (i.e. concentration greater than 50% or land).  I then added the date, parsed from the filename, using Create and CalculateField_management. The objective is to create annual maps showing the progression of the ice break-up to use in biological analyses.


texts: Features duplicated in multiple, different fields - label expression to avoid duplicate labels

texts:
Using ArcMap 10.4.1. I am trying to label a feature class of roads, there are 5 types: U.S. Highways, State Highways, County, Municipal, and Off Highway. Sometimes a road feature belongs to two classes (EX. Road 44M is both a County, and Municipal Road) There is just one 44M road, but it is listed as both of these types, so when I go to label, it duplicates the label right next to each other.

Removing duplicates doesn't work because that removes the duplicate labels for one type. Is there a way to write my label expression so it won't duplicate the same label across the different types. I want to solve this problem through labeling, not modifying the dataset.

If this doesn't make enough sense please let me know and I will try to clarify further.


texts: csv data into an .xml Workspace Document to import into my geodatabase?

texts: I'm looking to import data into my geodatabase from an .xml file using the import XML workspace document utility that comes from right clicking the geodatabase in ArcCatalog . Only problem is my source data is in .csv. What's the best intermediary way to get my data into an .xml file that matches my geodatabase?


texts: Creating metadata conformant to ISO 19139 standard?

texts:
My company would like to perform a complete overhaul of their metadata. They would like to use the ISO standard.

How can we go about this?

I have been researching and have done a lot of reading about metadata but I need to form a plan of action.


texts: When opening dwg files are there hidden fields by default in Layer Properties of ArcMap 10.3.1

texts:
There is a lot of fields in Layer Properties that are hidden by default when I open dwg file in ArcMap 10.3.1.

Is there some properties that define which fields are visible in Attribute Table and which are not?

Little explanation: I`m asking if there is a way to change the default settings on what CAD fields are made visible when loading CAD into ArcMap.


texts: How to select only some of the polygons from a Shapefile

texts: I have a Shapefile containing many polygons. I need to filter and save only part of them in another Shapefile. How can I do this using QGIS?


texts:
What I need to do:

rename a field name of a table/feature class
copy all values to the new field

So far I have done following code as @artwork21 suggests:

import sys
import traceback
import arcpy
from arcpy import env

## ARGUMENTS
# argv[1] = input table/feature class path
# argv[2] = input old field name
# argv[3] = input new field name

path = sys.argv[1]
oldFieldName = sys.argv[2]
newFieldName = sys.argv[3]

env.overwriteOutput = True

fields = arcpy.ListFields(path)
for field in fields:
    if field.aliasName == oldFieldName:
        if not oldFieldName == newFieldName:
            fieldType = field.type
            # Add new field
            arcpy.AddField_management(path, newFieldName, fieldType)
            #Calculates the new field based on old field values
            arcpy.CalculateField_management(path, newFieldName, "!"+oldFieldName+"!", "PYTHON", "")
            # Delete the old field (if necessary)
            arcpy.DeleteField_management(path, oldFieldName)

How can I map field.type to AddField_management method's field type? And while the field is in a middle place, then field deleted from middle and added to the last. That does not looks like as if field name is renamed.

Is there any better solution that help me to do these things?


texts: Editing Spatialite layer in QGIS gives "Problem deleting features" error

texts: I started off with an OSM file and used QGIS to convert into a Spatialite database. QGIS is able to load and display the tables just fine but when I try to delete a feature all I get is a "Problem deleting features" error. It seems to be a very generic error that doesn't help track down the problem. Does anybody know anything about this error?


texts: Making clickable hyperlink from URL with QT Creator for QGIS custom forms?

texts:
I am creating custom forms for QGIS with QT Creator.
I want to know how to make a clickable hyperlink from an URL.
It is said that QT Creator can handle them directly in a QLabel if the "OpenExternalLinks" and "LinkAccessibleByMouse" features are selected. But I can't manage to get a clickable hyperlink available and working…

Is there a way with a small Python code to force QT to do it?

Or by using a button instead?


texts:
I tried to run a ModelBuilder program but it gave the error below.

I am working in ArcMap 10.2, windows 7 64 bit pro and the raster format is Grid.

When installing ArcGIS 10.2, it required me to activate extension (customize/extension/select all extension).

After the install the Arc Hydro toolbar does not add to extension to enable it to be active.

I think the above error is because Arc Hydro has not been activated.

What is your opinion?


texts:
I have some layers :

layer 1
layer 2
layer 3

and I have create styles for any labels layer using base rule styles and labels and I have create a template .qpt and I use atlas correct.

In my template I have dynamic labels with my values from attributes like name id and more.

Here my template :

On my style I have define specific $mapid for any style and layer.

Now I want to create a plugin where add automate layers styles and create composed Atlas generation.

First have a plugin window where the user can chooses layers from ToC.

Here the window :

Second I create the PyQGIS code where add style on chooses labels:

def run(self):
    layers = self.iface.legendInterface().layers()
    layer_list = []
    for layer in layers:
         layer_list.append(layer.name())
    self.dlg.comboBox_1_layer1.addItems(layer_list)
    self.dlg.comboBox_2_layer2.addItems(layer_list)
    self.dlg.comboBox_3_layer3.addItems(layer_list)
    self.dlg.show()
    result = self.dlg.exec_()
    if result:
        selectedLayerIndex1 = self.dlg.comboBox_1_layer1.currentIndex()
        selectedLayerIndex2 = self.dlg.comboBox_2_layer2.currentIndex()
        selectedLayerIndex3 = self.dlg.comboBox_3_layer3.currentIndex()
        selectedLayer1 = layers[selectedLayerIndex1]
        selectedLayer2 = layers[selectedLayerIndex2]
        selectedLayer3 = layers[selectedLayerIndex3]
        selectedLayer4 = layers[selectedLayerIndex4]
        selectedLayer5 = layers[selectedLayerIndex5]
        selectedLayer6 = layers[selectedLayerIndex6]
        a='/layer1.qml'
        b='/layer2.qml'
        c='/layer3.qml'
        test1=uri+a
        test2=uri+b
        test3=uri+c
        selectedLayer1.loadNamedStyle(test1)
        selectedLayer2.loadNamedStyle(test2)
        selectedLayer3.loadNamedStyle(test3)
        pass

This code work fine I have specific style for any chooses layer.

But I don't know how to start/add composed with my layers where I chooses and how to define my atlas with my template.

Any idea how to do that?


texts:
I'm using the Nominatim API in geojson method to retrieve streets poly line.

For short streets I have no issue and the results are good.

However for long streets the data I'm getting back in the JSON is partial and I'm only getting a small part of the street.

Is there a method which I can use to give me the full street poly line even for long streets?

Here is an example of a street I have issue with and would like to get one JSON file with the all street poly line.

http://nominatim.openstreetmap.org/search.php?q=hayarkon+tel+aviv&viewbox=34.79%2C31.94%2C34.81%2C31.92&polygon=1

this is the JSON file I'm getting:

http://dev.peek.co.il/ajax/nominatim?address=HaYarkon,Lamed,Tel%20Aviv


texts: Exporting to PNG, PDF, JPEG not working in ArcGIS Pro

texts:
For whatever reason ArcGIS Pro has recently been unable to export to PNG,JPEG, or PDF layouts containing raster layers without arbitrarily cutting off bits of the raster.
Example below (the blue river portion in layout view crosses the frame without breaks):

Has anyone else encountered this? And if so did you find a work around. And no, before someone asks this is not data on an ArcGIS server (which is known to cause export issues).


texts: How to get correct lengths when switching from GCS to PCS?

texts:
I'm working on ArcMap 10 and need to get the lenghts (in meters) of the segments composing my line feature class. GCS of the line is WGS_1984. Extent of this data should be: Left 11.236520 dd, Right 11.247580 dd, Top 43.777520 dd and Bottom 43.771040 dd (I have no idea what "dd" means). I thought the correct way was to switch the Data Frame to PCS: WGS_1984_World_Mercator in order to get metric lengths with Calculate Geometry in a newly added field. I guess I was wrong since as I use the ruler to check if lengths are correct I see they are not (When I used the ruler with Data Frame set on GCS the lengths were correct).
Am I doing it wrong or it is impossible to get the same lengths with GCS and PCS?


texts: Pop-up window for a related layer doesn't show the right values in ArcGIS online

texts:
In my ArcGIS online map, I have two layers (morminte and layer2) related in a one-to-many relationship. For an item from the morminte layer I can have 0, one or two corresponding values from layer2. In the picture below it is shown the pop-up window for an item from morminte. In the pop-up,
only the Nr. Mormant field is from the morminte layer. This is the only field that returns the right value.

The rest of the fields are from the related layer.
The fields NUME (surname) and PRENUME (name) should return text values, DATA_NASTERII and DATA_DECES -> date values and VARSTA->a number. Instead, if for the selected item I have one corresponding value from layer2, the pop-up returns "1", if I have 2 corresponding values, then I get "2" and if there is no value to be related, then I get "0".

Before uploading the map to ArcGIS Online, I made sure that both layers involved in the relationship class are configured properly in ArcMap. NUME and PRENUME are string fields, DATA_DECES and DATA_NASTERII are date fields and VARSTA is a short integer field.

In the Configure Attributes window for the morminte layer, I noticed that I can select only  count in the Statistic Operator tab. I don't know if it has something to do with this.

I also created a layer that has the fields NUME, PRENUME etc. as it's own. In this case, the pop-up shows the right values. But in my map I want to use two  related layers instead of one because is more advantageous for what I need to do.


texts: Bounding the Google Maps Search area to my Fusion Layer area?

texts:
I have a searchable Google Fusion Layer of Glasgow Postcodes that highlights the searched areas on a map.
The search works fine if I enter a full postcode (for e.g. G1 1BL) that matches the data in the Fusion Table.

However, if I search for just the first part of the postcode to display all the postcodes in the sector ('G1'), instead of highlighting all the areas on my fusion layer with G1, it relocates my map to China where there is a highway named 'G1'.
This isn't the case for all sectors, for example if I search G84 then it highlights the corresponding areas on my map.

This happens with other searches too where unless its a valid postcode I am relocated to the other side of the world to another place with this name as opposed to the fusion layer I am querying.

Is there a way to fix this or will I have to limit the search to only full postcodes?


texts: Stopping script processing without shutting down QGIS

texts:
I'm looking for a way to abort a script execution if a sql query returns some results. I've found a few solutions on the forum but all of them lead to shutting down QGIS (thing I precisely want to avoid).
This question has already been discussed at How to terminate Python scripts in Processing framework properly? and the conclusion was that it was not possible yet.
7 years later, I'm wondering if this has eventually been made possible?
My script:
conn = psycopg2.connect(db_key)

cur = conn.cursor()

try:
    cur.execute("""
--
SELECT * FROM a.table1 WHERE ps_code like 'test_erreur'
""")

except:
    print ("Can't run this SQL query")

rows = cur.fetchall()

if rows is None:
    print("No error found")
if len(rows) > 0:
    iface.messageBar().pushMessage("Erreur", "Script processing had to be stopped because errors has been detected", level=Qgis.Critical, duration=30)
    for row in rows:
        print (row)
    sys.exit()


texts: MODIS: MYD021KM data set - can't find radiance scales to convert SI to radiances

texts:
I would like to convert the scaled integers (SI) to radiances for all my SDS MYD021Km thermal emissive bands.

In the MODIS Level 1B Product user guide on page 36 in section 5.5.1 it says:

  The values of radiance_scales and radiance_offsets are computed inside Level 1B and written as attributes to the Science data sets. Thus, radiance may be simply recovered from SI by reading these two attributes and applying Equation 5.8.

where Equation 5.8 states the relation between radiance, radiance_scales and radiance_offsets. However, I can't find those attributes in my hdf file. Even though, I downloaded the whole package without any post-processing choices on LAADS DAAC.

Where can i find them?


texts: AxSymbologyControl via WindowsFormsHost in WPF (ArcMap Add In Project)

texts:
I need a way to offer the user a choice of color ramps for the ClassBreaksRenderer.
I came across the AxSymbologyControl which was designed for WinForms. I tried also ESRIs (WinForms) example project and it works fine. However, I am building everything with WPF and according to ESRIs documentation one can add a WinForms control like the MapControl with the help of the WindowsFormsHost control.
This is what I tried:

<UserControl x:Class="MCDA.VisualizationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<Grid>
    <WindowsFormsHost Height="176" HorizontalAlignment="Left" Margin="33,102,0,0" Name="symbologyHost" VerticalAlignment="Top" Width="201" />
</Grid>

And in the code behind page:

 private void CreateSymbology()
    {
        _axSymbologyControl = new ESRI.ArcGIS.Controls.AxSymbologyControl();

        _axSymbologyControl.CreateControl();

        _axSymbologyControl.Location = new System.Drawing.Point(8, 16);
        _axSymbologyControl.Size = new System.Drawing.Size(272, 265);

        symbologyHost.Child = _axSymbologyControl;

        //Get the ArcGIS install location
        string sInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path;

        //Load the ESRI.ServerStyle file into the SymbologyControl
        _axSymbologyControl.LoadStyleFile(sInstall + @"\Styles\ESRI.ServerStyle");

        //Set the style class
        _axSymbologyControl.StyleClass = esriSymbologyStyleClass.esriStyleClassColorRamps;

        //_axSymbologyControl.GetStyleClass(_axSymbologyControl.StyleClass).SelectItem(0);

        _axSymbologyControl.OnItemSelected += new ESRI.ArcGIS.Controls.ISymbologyControlEvents_Ax_OnItemSelectedEventHandler(_axSymbologyControl_OnItemSelected);
    }

The problem is I can't see the control in my window - it is empty. It seems I miss something important.

In case there is a better approach I would like to hear more about it.


texts: Show diagrams of area of interest by using Atlas, QGIS

texts:
I use the Atlas of QGIS 3.2. I already figured out how to show only attributes inside current Atlas feature using $id = @atlas_featureid.

My problem is, as a coverage layer I am using layer with municipality borders, although my featured layer has borders of smaller administrative units. When I use the $id = @atlas_featureid, Atlas only shows one diagram per Map.

I partially found a solution to hide diagrams outside current map feature in this thread, but it doesn't solve my problem.


texts: Point patterns clustering around reference points?

texts:
I have two point shapefiles. I want to analyse whether the points in the dataset A are clustering around their respective reference point in the dataset B. Each reference point in the dataset B has a set of related points in the dataset A (linked through a common categorical variable). So, I want to carry out the analysis per sub-sets, based on attribute value, (A) in relation to the specified reference point in B.

Can I do this in ArcGIS  “Spatially constrained multivariate clustering"?


texts: Use arcpy.da.searchcursor to select rows to dissolve

texts:
I'm quite new to ArcGIS and hope someone can help me.

I have one table that lists which polygons are contiguous with each other called BLPUsCavPlaceContigBLPUs that looks like this:

OBJECTID   blpuid  contigid  shape-length
    1         1        7          38
    2         1        16         42
    3         2        8          14

I then have a table of all the polygons called BLPUsCavPlace where the objectID is the blpuid and contigid:

OBJECTID   SHAPE   SHAPE_length  SHAPE_area
    1     polygon    126.846       986.093

Therefore I know which can merge with which, such as 1 and 7.  I want to iterate through the first table, and for each row the cursor will take the blpuid and contigid and select these rows (OBJECTIDs) in BLPUsCavPlace, then it will dissolve them and add them to BLPUsCavPlaceDissolved.

So it would look at BLPUsCavPlaceContigBLPUs and select 1 and 7 in BLPUsCavPlace, then it would do the next row etc

The end result is that I have a polygon layer that contains all the possible dissolved polygons for each polygon within BLPUsCavPlace i.e. 1 + 7, 1 + 16, 2 + 8

I've been looking at arcpy.da.searchcursor which could retrieve the field values, but how would I then use the blpuid and contigid to select the rows in BLPUsCavPlace?

Any help is greatly appreciated!!

so i can run this:

fc = "BLPUsCavPlaceContigBLPUs"
fields = ["blpuid", "contigid"]

with arcpy.da.SearchCursor(fc, fields) as cursor:
    for row in cursor:
        print("{0}, {1}".format(row[0], row[1]))

to get the field values, i then want to take the two values and use both as objectid in the other table and run dissolve on them


texts: Finding line equation (on Earth) using two GPS coordinates

texts:
Assuming I have two GPS coordinates, how can I find the equation of Earth horizontal line that passes between them?
I tried searching for a method of finding a line on a sphere that passes through two points, but couldn't find any.


texts:
I am new to how to manipulate spatial data, so unfortunately after finding the command I want to use which is fast_extract as the following:
rs <- fast_extract(rd, county, velox = TRUE, fun = mean, na.rm = T, small = T, df = T, cellnumbers = F, sp = F)
where rd is a raster layer and county is the shapefile, it says that "velox" has been archieved, what should I do in this case?


texts: Making sequential number's not based on Object ID number

texts:
I have a question about sequential numbering.
I found a script (i'll put it below), which allows me to make a sequential numbering based on OID and thats good.
But what i need is different structure of numbering... for example, sometimes i need numbering from top to bottom of polygons line,
sometimes from left to right or from bottom to top and so on.
I'am using Arcgis pro (but example is made using simple arcmap)

Code block:

rec=0
def autoIncrement(string_prefix):
 global rec
 pStart = 1 #adjust start value, if req'd
 pInterval = 1 #adjust interval value, if req'd
 if (rec == 0):
  rec = pStart
 else:
  rec = rec + pInterval
 return string_prefix + str (rec)

.

autoIncrement("11A-5-(this number is changes sequentially"))


texts: r.watershed: How does the convergence parameter and "AT"- lcp work?

texts:
I generated streams with GRASS GIS r.watershed, executed in RStudio. Now, I want to explain the functionality behind that function.
The GRASS- manual explains a lot here: https://grass.osgeo.org/grass76/manuals/r.watershed.html,
but maybe it's not specificly explained enough or I simply do not understand it. So:

How does the "AT least-cost search algorithm" work?

How exactly does the parameter "convergence" influence the function, respectively at which point?

Do you have an alternative source than the link posted above?

usage:
execGRASS(cmd = "r.watershed",
      flags = c("overwrite"),
      parameters = list(elevation = "interpoliert_elev",
                        threshold = 100,
                        convergence = 1,
                        stream = "rwater_streams"))

Thanks


texts: How to create a Geo Names database in Hierarchical way from an ".mbtiles" file?

texts:
I am having a mbtiles file for a country. I want to make a geo names database in a hierarchical way.

By hierarchical I mean street names under one muncipality, muncipalities under a province and so on.

I tried this project, https://github.com/tarwirdur/mbtiles2osmand.

Is there any way around to set up a Geo names database in a hierarchihcal way?


texts: Clipping raster with vector layer using GDAL

texts: I have installed GDAL using the Osgeo installer. How can I clip a raster layer with a vector layer programmatically? Is there any GDAL API available which can help me with this? I am using Python.


texts: Selecting an Area/ Boundary on MouseDown Event and find all the feature class within that boundary scope Using C#

texts:
I was thinking to select an area or a boundary in ArcMap on MouseDown Event and select all the features inside it.

How do I select the boundary with the code in C#?

Here is what I did:

public override void OnMouseDown(int Button, int Shift, int X, int Y)
    {
     screenPoint = new ESRI.ArcGIS.Geometry.Point();
     screenPoint.X = X;
     screenPoint.Y = Y;

     IScreenDisplay screenDisplay = (m_application.Document as IMxDocument).ActiveView.ScreenDisplay;

     mapPoint = screenDisplay.DisplayTransformation.ToMapPoint(X, Y);

     IMxDocument pMxDoc = (IMxDocument)m_application.Document;
     IMap pMap = (IMap)pMxDoc.FocusMap;
     mapPoint.SpatialReference = pMap.SpatialReference;

     ITopologicalOperator pTopOp = mapPoint as ITopologicalOperator;

     ISpatialFilter pSpatFlt = new SpatialFilterClass();
     //pSpatFlt.SpatialRel =esriSpatialRelEnum.esriSpatialRelIntersects;
     pSpatFlt.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

     ESRI.ArcGIS.esriSystem.UID pFeatLayerUID = new
     ESRI.ArcGIS.esriSystem.UIDClass();
     pFeatLayerUID.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"; /* refer http:// help.arcgis.com/EN/sdk/10.0/ArcObjects_NET/componenthelp/index.html#/Layers_Property/001200000m9t000000/ */
     IEnumLayer pEnumLayer = pMap.get_Layers(pFeatLayerUID, true);
     ILayer pThisLayer;
     //IFeatureLayer pThisFeatLayer = pThisLayer as IFeatureLayer;
     IActiveView activeView = (m_application.Document as IMxDocument).ActiveView;
     IFeatureLayer pThisFeatLayer;
     while ((pThisLayer = pEnumLayer.Next()) != null)
         {
         pThisFeatLayer = pThisLayer as IFeatureLayer;
         IFeatureCursor pFtCur = pThisFeatLayer.Search(pSpatFlt, true);
         IFeature pFt = pFtCur.NextFeature();
         FlashFeature(activeView, pFt);
         if (pFt != null)
             {
                 IFeatureClass fC = (IFeatureClass)pFt.Class;
                 MessageBox.Show(fC.AliasName.ToString());
                 break;
             }
         }


texts: Applying custom plugins using PyQGIS script

texts:
I've downloaded the select within plugin to select features inside polygons objects. I've imported the plugin using import SelectWithin as sw in the console but QGIS does not suggest any of its methods to use.
How can I apply this plugin to my script using PyQGIS and is it possible to use the functions of this plugin in the script?


texts:
We have a distributed ArcMap application on a citrix farm.

We've come across a strange problem where the ESRI.style doesn't load.

If you create a session, you can then go through the style manager and load the ESRI.style  file, which is there, and it's fine.  However, if you shut down, the next time you start, the same problem exists.

There's no real logic to it.   Has anyone come across this before?

I have edited this for a bit of clarity, and now I am thinking with my mouth, but I am starting to think if the user is setting the style back in the citrix session, that is why it is not being saved, so it actually needs to be done on the instances on the Citrix farm, if that makes any sense?


texts: Label polylines parallel but off line end

texts: I can get polyline labels to appear parallel to the line but I'd really like to have them off the end of the line, not on the line. Is there a way of doing this with QGIS?


texts: Is it possible to export a layer with a related table to kml/kmz and view related data in Google Maps?

texts:
I have a polygon shapefile with a related table in ArcGIS 10. When I use the "Layer to KML" tool to export the shapefile and then load it into Google Maps, it doesn't see the related data. I would like the related data to appear in the balloon pop-ups in Google Maps. Is this possible?

Thanks,

Vanessa


texts: Unable to display 'https' Geo-Server layers in Ckan

texts:
I am using the following stack on 'development' server

Instance 1 : Geoserver 2.18, Apache & Cent OS 7
Instance 2 : Ckan & Cent OS 7
SSL Configured : On instance 1

Problem statement : For regular Geo-server 'http' request in Ckan it works fine but for 'https' request it gives an error "Could not proxy resource because a connection error occurred-. [SSL: CERTIFICATE_VERIFY_FAILED]"

Verified certificates on Server  it's fine.
Both machines are able to connect properly.
Proxy and other part are configured okay.
Geo-server request is trying to go outside firewall (not sure why ?)
Researching more on my side.


texts: Can a splash page be enabled for an ArcGIS Online Organization's homepage?

texts:
I am working with an established ArcGIS Organization account. I'm looking to push out communication to all users and would rather not go the route of emailing all users.

Is it possible to have a splash screen at the homepage or Gallery page of our ArcGIS Online organization account in order to communicate to users?

I'm envisioning a splash screen which functions in a similar way to a splash screen inside a web-app.


texts: Arcmap table of contents flashes and system becomes unresponsive episodically on windows 10

texts:
This problem took me awhile to solve, so I am sharing both the problem and solution here. I searched, and found, some helpful discussions on the internet that pointed be in the right direction (see solution), but nothing that actually provided explicit instructions for solving the problem.

The problem occurs in ArcGIS Arcmap 10.5.1 running on Windows 10.
Episodically throughout the day, ArcMap will make the whole system become unresponsive, whether it is running in the foreground or background. Even the mouse cursor lags, moving in spurts. If ArcMap is in the foreground, the table of contents panel turns grey, and then flashes white again 5-6 times. After this 10-30 second episode, the system returns to normal operations.
This has occurred regularly for me in ArcMap for the last 5 months since I started using this computer. It is not a huge problem, but drives me batty as it happens every couple of hours throughout the day.


texts: Replacing text in AutocadMAP File using excel data

texts:
I have an autocad drawing with so many light fixtures with all different names.Now we have to change all those names, i already have an excel sheet containing two columns with first one containing "name in drawing" and second one containing respective "new name".
Is there any way to replace the names in cad file using that excel sheet?


texts: Problem with Local ArcGIS Server used with local Web AppBuilder

texts:
At the beginning I will describe what I did:

I installed ArcGIS server on WM on my computer. Then I published WMS and WFS on the server.
I can connect to WFS and WMS in my local network and display it using eq. QGIS with: https://192.168.1.55:6443/arcgis/services/shetches/MapServer/WFSServer

I downloaded the ArcGIS Web AppBuilder (Developer Edition) ZIP and followed all whe steps in the tutorial:
https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm

I entered http://localhost:3344/webappbuilder as URL and
Redirect URIs:
http://localhost
https://localhost
http://desktop-auvhne   (my computer name)
https://desktop-auvhne

I ran Web AppBuilder and created a simple app with AddData Widget:
https://desktop-auvhne3:3344/webappbuilder/apps/3/

If I try to add WMS by URL everyting works fine and WMS is displayed: https://192.168.1.55:6443/arcgis/services/wms2/ImageServer/WMSServer
(When I pasted the above URL into the form field I got a warning:

Please enter a URL starting with https:// or http://

, but WMS was displayed)
There is a problem with WFS:
If I try to https://192.168.1.55:6443/arcgis/services/shetches/MapServer/WFSServer I get the same warning:

Please enter a URL starting with https:// or http://

but this time it works partly.
I see in devTools that requests for getCapabilities and describeFeatureType works fine: eg. https://desktop-auvhne3:3344/proxy.js?https://192.168.1.55:6443/arcgis/services/shetches/MapServer/WFSServer?service=WFS&request=GetCapabi...
Layer with WFS is added, but there is an error with getFeature.

POST
https://desktop-auvhne3:3344/proxy.js?https://192.168.1.55:6443/arcgis/services/shetches/MapServer/WFSServer
net::ERR_EMPTY_RESPONSE

In Web AppBuilder for ArcGIS console i see:

Error: Argument error, options.body

How to fix it? What have I done wrong? I am not familiar with web technologies


texts: Perfectly running python script gives error when run from web.py

texts:
I have the following python script which runs perfectly if run separately:

import arcpy

val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")
print str(val)

I want to expose this as a web service and so I installed web.py and wrote the following code for code.py. but it gives errors(when invoked. compiles fine).

import web
import arcpy
urls = (
    '/(.*)', 'hello'
)
app = web.application(urls, globals())

class hello:
    def GET(self, name):

        val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")
        return  str(val)

if __name__ == "__main__":
    app.run()

When i invoke this using http://localhost:8080, i get the following error:

<class 'arcgisscripting.ExecuteError'> at /
ERROR 000582: Error occurred during execution.

Python  C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py in GetCellValue, line 8460
Web GET http://localhost:8080/
Traceback (innermost first)

C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py in GetCellValue
          be returned."""
    try:

        retval = convertArcObjectToPythonObject(gp.GetCellValue_management(*gp_fixargs((in_raster, location_point, band_index), True)))
        return retval
    except Exception, e:
        raise e ...
@gptooldoc('GetRasterProperties_management', None)
def GetRasterProperties(in_raster=None, property_type=None):
    """GetRasterProperties_management(in_raster, {property_type})
        Returns the properties of a raster dataset.

I have tried Debugging it in many ways, the code .py runs fine if i just return a "hello".  The library i am using is a ArcGIS Geoprocessing toolbox library.

Any ideas as to what might be wrong?


texts: Can I use georeferenced jpeg raster as map layer in GeoJSON.io?

texts:
Can I use georeferenced .jpeg raster as map layer in GeoJSON.io?

I thought that I could, but it doesn't work.

I converted .tif raster visualization of LiDAR data to georeferenced jpeg. After this, I uploaded to server and when I pasted link in geojson.io -> Add map layer it didn't show anything. Jpeg is georeferenced in CRS WGS84.

What I am doing wrong?


texts: Feature layer (AGOL) export to Excel failure?

texts:
When I try to export data from an AGOL feature layer into an xlsx i receive the following error.

"Excel cannot open the file, file format or extension is not valid"

When selecting to export you don't get an option to select the extension so I don't understand why this should be an issue.

Can anyone suggest a reason why this is happening or a work around?

For information :
The data been exported is a point feature with 3 text attribute fields.


texts:
I am a Land Surveyor.  I would like to "cut/clip" the tax parcels of a Section.
The amount of data in the file is to great, so I need to "cut/clip" pieces of the file and save them individually so that they can be uploaded to another program.
I have managed to find several Youtube channels for help.
I was even able to "clip" what I described above once and have failed to repeat what I did.


texts: Unable to plot in R some locations over a shapefile

texts:
I have a shapefile of polygons that I got from here, and a CSV file with longitude, latitude data (i.e. lon= -71.4; lat=42.5).

The shapefile has the following CRS information: "+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"

I can plot the shapefile and the location CSV file separately, but I have not been able to do it jointly.

Any idea what is going wrong in the code below?

shp <- readOGR('zipcodes_nt',
               'ZIPCODES_NT_POLY', stringsAsFactors = FALSE)
coords = c(-71.42043,42.50242)
sp <- SpatialPoints(coords)
proj4string(sp) <- CRS("+init=epsg:4326") # Google use WGS84.
sp84 <- spTransform(sp, CRS("+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=200000 +
                                                 y_0=750000 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"))
plot(shp)
plot(sp84, col="red", add=TRUE) # do not add anything!


texts:
i have a data which contain a code of area an value of area in shapefile, ex.:

area|value
1|33
1|43
1|31
2|12
2|43
3|66
3|76

the question is how to calculate total value per area with arcgis, i heve been tried with arcgis calculator and it doesnt work?
what i expect for result is

area|value|total
1|33|107
1|43|107
1|31|107
2|12|55
2|43|55
3|66|142
3|76|142


texts:
What technologies and skill sets should one who wants to do web GIS development study/acquire?

One skill/technology per answer please.


texts:
Looking for vector data for the country Turkey, specifically roads, railroads, and rivers shapefiles... no cost would be nice, but it needs to be more detailed and accurate than mapcruzin's free data.

Something under $500 would also be considered.

Anyone here have experience/recommendations with locating low cost shapefile data for Turkey?


texts: Stop Grid Coordinates Overlapping in Print Layout

texts: I have created some data driven pages in the print layout (controlled by atlas) using QGIS 3.4. The grid spacing is set to a fixed interval (20m). This works fine until one of the pages is located in such a way that means the Y coordinate label overlaps the X. Is there a setting that will stop a coordinate printing if it overlaps another?


texts: QGIS3 Python setLayers for map item in layout

texts:
I have a layout with four maps over four pages in QGIS 3.4. I am building a python plugin to simplify map production for non GIS users. I am having difficulty defining the layers I want in each map item, as each map item will have slightly different layers. So far I have the code (I have left out some code above that loads a layout template and yes I have no doubt my code has some ineffeciencies :p ):

project = QgsProject.instance()
projectLayoutManager = project.layoutManager()
layout = projectLayoutManager.layoutByName("test")
iface.openLayoutDesigner(layout)

layerList = QgsProject.instance().layerTreeRoot().findLayers()

extent = iface.mapCanvas().extent()
extent.grow(0.7)

map1 = QgsLayoutItemMap(layout)
layers =  QgsProject.instance().mapLayers()
zoning = layers.values(map_layer1)
map1.setLayers(zoning)
map1.setFrameEnabled(True)
map1.setRect(QRectF(20, 20, 20, 100))
map1.setExtent(extent)
layout.addLayoutItem(map1)

I have tried a few options but keep getting the same error:

NameError: name 'map_layer1' is not defined

So, I'm not really sure where to go from here. I am just testing with two layers in the  map canvas at this point, map layer 1 and map layer 2.


texts:
i try to send geocode from my tracker to cartodb. It seems like that my coordinate or my sql statement are wrong.

This is the Tracker format: ddmm.mmmmm

Formatting:
    var val;
    val = parseFloat(geo);
    var dd =  parseInt(val / 100);
    var mmmm = val % 100;
    var res = dd +(mmmm /60);

SQL:
 sql.execute("INSERT INTO test_table(the_geom, imei) VALUES (ST_SetSRID(ST_Point("+info['longitude']+", "+info['latitude']+"),4326),"+info['imei'] +")")

Did i do something wrong?


texts: Can ArcGIS Desktop create LAS (or lasd) files from ASCII data?

texts:
I have many ASCII files containing LiDAR xyz values. In order to create an ArcGIS LASD file, I need to convert these ASCII files into las files. I can do this with FME or LAStools, but I can't see a way in ArcGIS.

Does anyone know if this is possible in ArcGIS Desktop 10.3.x?


texts:
I would like to locate (position) people inside buildings without forcing them to download a native app. I'm focusing on iOS and Android devices.
I therefore thought about wifi triangulation (trilateration), GPS repeater, GSM beamforming or even acoustic background spectrum.

Is there any product/tool to achieve this task?


texts: Update of field in feature of a vector layer with PyQGIS in QGIS not reflected in attributeTable

texts:
In QGIS with PyQGIS I want to update values of a field in features of a vector layer. I see that the feature field is updated when I do a print. But it doesn't commit the value, and I don't see them updated in the attributeTable. Why is that? Anyone has a clue?
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
from qgis.PyQt.QtCore import QVariant

sanitation = pd.read_csv("data.csv")

layer = iface.activeLayer()

adm2PCodeFNI = layer.dataProvider().fieldNameIndex("ADM2_PCODE")
budgetPercentFNI = layer.dataProvider().fieldNameIndex("BDGT_PERC")
print(adm2PCodeFNI)
print(budgetPercentFNI)

layer.startEditing()

for feature in layer.getFeatures():
    for i in range(0,len(sanitation)):
        adm2_pcode = sanitation.iloc[i, sanitation.columns.get_loc("adm2_pcode")]
        if feature.attributes()[adm2PCodeFNI] == adm2_pcode :
            bP = sanitation.iloc[i, sanitation.columns.get_loc("budget_perc")]
            feature[budgetPercentFNI] = bP
            print(feature.attributes())
            layer.updateFeature(feature)
            break

layer.commitChanges()


texts: Adding attribute values from CSV to multiple shapefiles in PyQGIS

texts:
I’m looking for a way to do the following in a Python script in QGIS. I have multiple shapefiles (shape_x.shp, shape_y.shp, shape_z.shp) and a CSV table which is structured like the following example:

Now I want the values value_a, value_b and value_c to be written to a new column in the respective shapefile. This is not particular a classical table join, because all the features from the shape should get the same value. So, there is no need for a common column.

The attribute table of the shape_x.shp might look like this before the data is added:

…and a knew column, based on the value of the CSV, should automatically be added, so that the attribute table of the shape_x.shp afterwards looks like this:

The different shapefiles have a varying number of features, so no matter how many features, the value from the CSV should be added as a new column to every feature.

I hope I made the problem clear. I searched for automatically adding data to shapefiles and any kind of join (like this example), but no success so far.


texts: How do I add a caption(legend) inside a button when turning on / off a layer?

texts:
I'm working with OpenLayers 3 on creating a webgis
I want to add a caption (png image) of a map via a button, as I demonstraded.

When someone click the button I would like the caption image to appear inside the map.

  <button id="testButton" onclick="legend()" class="fas fa-list-ul">
     <img src="http://datageo.ambiente.sp.gov.br/geoserver/datageo/wms?REQUEST=GetLegendGraphic&VERSION=1.1.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=datageo:DensidadeDemografica2016&bbox=-124.73142200000001,24.955967,-66.969849,49.371735&srcwidth=768&srcheight=330&srs=EPSG:4326&legend_options=countMatched:true;fontAntiAliasing:true">
  </button>

The caption is generated through a WMS request from OpenLayes 3 itself, by REQUEST = GetLegendGraphic.

I tested this alternative, however, without success.
I've added my layers inside an array to make the view call from them, as you can see.
Can anybody help me? Thankful

        var layersArray = [];
        var map;

        function layer () {

            var osm = new ol.layer.Tile({
                preload: Infinity,
                source: new ol.source.OSM()
            });

            var layer =  new ol.layer.Image({
                        source: new ol.source.ImageWMS({
                            url: 'http://datageo.ambiente.sp.gov.br/geoserver/datageo/wms',
                            params: {'layers':'datageo:DensidadeDemografica2016', 'TILED':true},
                            ratio: 1,
                            serverType: 'geoserver'
                        })
            });
            layer.setVisible(false);

            var layerUm =  new ol.layer.Image({
                source: new ol.source.ImageWMS({
                    url: 'http://datageo.ambiente.sp.gov.br/geoserver/datageo/wms',
                    params: {'layers':'datageo:DensidadeDemografica2015', 'TILED':true},
                    ratio: 1,
                    serverType: 'geoserver'
                })
            });
            layerUm.setVisible(false);

            layersArray.push(osm); //0
            layersArray.push(layer); //1
            layersArray.push(layerUm); //2

             map = new ol.Map({
                    target: 'map',
                    controls: ol.control.defaults({attribution:false}).extend([
                        new ol.control.ScaleLine(),
                        new ol.control.ZoomSlider()
                    ]),
                    renderer: 'canvas',
                    layers: layersArray,
                    view: new ol.View({
                    center: [-23.6526023,-46.8906052],
                        zoom: 4
                    })
               });

        }

        // funcao para aparecer e desaparecer a legenda quando clicar no botao
        function legend() {
            layersArray.events.register("visibilitychanged",layersArray, function() {
            if (layersArray.getVisible() === true) {
                map.addControl.getElementById("testButton");
                } else {
                map.removeControl.getElementById("testButton");
                }
            });
        };

       //funcao para ligar e desligar uma layer num checkbox
        function layerswitch(evt){
            layersArray[parseInt(evt.value)].setVisible(evt.checked);
        }`


texts: Performing kNN between two 3D sets of points (pointclouds)


texts:
I'd like to create a new, custom PostGIS function that would return a point geometry from a polygon that I can use for generating label points from a polygon, but I am not sure how to go about composing the function itself.
My goal is really simple...

generate initial label points for all polygons using ST_Centroid,
Test the label point to ensure that it falls on the surface of the polygon,
For centroids not on the surface of the polygon, fall back to ST_PointOnSurface.

This would mean most label points are at the Centroid, but ensure that irregular and "C" shaped polygons would have the label point at least somewhere on the surface.  I feel like the psuedo-code would look something like this:
SELECT gid,
  CASE
    WHEN ST_Intersects(ST_Centroid(x.geom), x.geom) THEN ST_Centroid(x.geom)
    ELSE ST_PointOnSurface(x.geom)
  END AS geom
FROM x


texts: Viewing GeoPandas Dataframe in VScode or PyCharm like Pandas Dataframes

texts:
I'm not sure if this is a missing feature or something that I couldn't figure out so I wanted to get some help; I started learning geopandas library, now I'm following some tutorials I realized that neither pycharm nor vscode have the ability to show geopandas dataframes like they do in pandas dataframes. I have checked the same code in Spyder that comes bundled with Anaconda distribution and I have the ability to see and inspect geopandas dataframes just like pandas dataframes.

Here is what I see on VSCODE same is true for PyCharm as well, if I double click on pandas dataframe it shows me the entire dataframe, if I double click on geopandas dataframe nothing happens.

This is the same exact code in Spyder, no matter which dataframe I double click, it shows me the content.

Am I missing anything or this is not possible using PyCharm or VS Code?


texts: Using conditions in Graphical modeler QGIS 3.10.5

texts:
I have a question about my model which is quite complex.
I have two types of line INPUT and the model will not be executed unless one of the line INPUT is empty. The problem is with a tool 'Snap points to lines' (logically - because there are no lines and points neither).
The question is, if there is some way with Graphical modeler to use a condition like
IF one of the line INPUT is empty
THEN 'freeze' this branch of model, but continue with the second line INPUT

I guess the best way is to turn the model into a script and here I can manage better the conditions.
But I am not really PRO in Python so anybody can give me a hand?


texts: Is there a way to dynamically hide annotations that intersect map extent border?

texts:
I have a feature linked annotation feature class with a number of annotations displayed only partially on the edges of the visible extent of the layout data frame.

The link annotation class will be used in a number of other maps of the same scale and paper size but showing different locations.

Is there a way to dynamically hide the partially displayed annotations?

Out of the box solution preferred, programmatic (ArcObject, VB.Net Addin) acceptable


texts: Many pipelines and buffers need to display one at the time,

texts:
I have more than 1000 individual pipeline in one shapefile with 4 different buffer size. I wish to show one pipeline at a time with its corresponding buffers after each other in a very quick way. I tried to query out every single line after each other front of all the people during the screening meeting but it is way to long and painful process with over 1000 lines. I was thinking to split them and calculate the buffers for each line but again that would take too much time.
I am trying to see if a building fell into one of my buffer but if all the pipeline is displayed the map is way to crowd and the buffers (I'm using only the line without fill) are overlaying unable to see which one is belongs to the particular line I am looking fat. I need to switch fairly quick the lines so the others can decide if the line is close to a house or not.
]]1


texts: Attributes table keeps crashing in QGIS 2.2

texts:
I am currently working on an intensive project that requires me to edit the fields of literally thousands of line segments. While updating the shapefile, it crashed on me. Today, qgis has probably crashed on me upwards of five times now. Originally, I thought it was just my computer but now it's happened to one of my group members. I tried  opening the project file and re-adding a slightly older version of the file, but qgis crashed once more when I tried to look at the attribute table to see any saved changes.

Both of us are running qgis 2.2 on mac laptops. The crashing happened in the version of qgis before this one, which is why I upgraded. I thought that maybe there was a bug that had been addressed in the latest version.

Has anyone else ran into this issue of editing large files and being unable to open their shapefiles' attribute tables without crashing? Does anyone know any way around this issue?

Thanks


texts: Creating animation from multi-band raster?

texts:
I have a GeoTiff raster with 1461 bands, each band representing 1 day for a total of 4 years. Basically, the geotiff is just a collection of 1461 images.

What would be the best option to animate this GeoTiff that shows all bands in succession?
Ideally I want to show 24 bands (24 frames sequentially) per second in my video/gif.


texts:
What raster format should I use to create viewsheds in QGIS using the grass r.los plugin?
I am using the Ordnance Survey Opendata DTM (tried both ascii and shapefile formats) and srtm geotiffs but when I run r.los I can't select an input raster - does that mean the raster is the wrong format?


texts: Finding the Closest Points using ST_ClosestPoint() for MULTIPOLYGON


texts: Convert UTC to local time in map label using an expression

texts:
I am trying to figure out a way to convert a datetime stamp of the last_edited_date (tracking changes) that is stored in UTC to local time.

I am putting together a map service that allows our heavy equipment folks to update road conditions for our campus during a snow storm.  When users view the map I want to show the last edited date for each feature so people know how long ago a road was plowed.  I want to pull the last_edited_date field and show it in a label.  Unfortunately the time is UTC and the labels do not autoconvert to local browser time when viewing the map service.  Since our heavy equipment folks are updating the map via a feature service, switching to Database time to the track changes in sde wont work.

I am hoping someone knows of some kind of expression to either straight up convert or at least know of someway to subtract 7 hours from the time (we are in the pacific time zone).


texts: Automatically set attribute values for a layer based on proximity relations to another layer in QGIS

texts:
Is it possible to automatically set attribute values for a layer based on proximity relationships to another layer in QGIS?

This is a more generic question with a variety of applications, so here is a concrete example: I have a road network (linestrings) with attributes (among others) road_name and road_sgmnt_id and a point layer with building sites also with attributes road_name and road_sgmnt_id (also among others). What I would like to do during digitizing a building site is to find the closest (proximity relationship) road segment, retrieve certain attribute values and insert them into the building site form as shown in the screenshot:

I must confess I am not quite experienced with user defined forms in QGIS (ui-files) but I think such form with some python logic defined behind it could do the trick.

Hint: Since the datasource is not necessarily a database, and if, the form could not be auto-filled this way during digitizing, a trigger function would only be a second option (if any).


texts: Updating z values from joined table using ArcPy?

texts:
I have joined two tables. The first table includes the current z values, while the new table includes new z values. I first tried to snap, but this didn't update the Z values, only X and Y. How can I update the z values of the joined table? I tried some python scripting, but Im not very good at it.

import arcpy
mast = "VoltTotal.GDB\Export_Output"

with arcpy.da.UpdateCursor(mast['test_endre_geom.SHAPE@Z','feat3d.POINT_Z']) as cursor:
  for row in cursor:
                    row[0] = row[1]

                    cursor.updateRow(row)

Currently I'm getting an error displaying: RuntimeError: A column was specified that does not exist.


texts: How to use Qgis Gridsplitter Plugin in Console

texts:
I would like to use Gridsplitter plugin in console. I have the following code for doing it:

from qgis.core import *
import qgis.utils
import imp

gridSplitterPath = "C:/Users/Mossy/.qgis2/python/plugins/gridSplitter/gridSplitter.py"
outputpath = "C:/Users/Mossy/Desktop/NewFolder/Output"
cutlayerpath = "C:/Users/Mossy/Desktop/NewFolder/InputData/cutlayer.shp"
layertocutpath = "C:/Users/Mossy/Desktop/NewFolder/InputData/layertocut.tif"

iface = qgis.utils.iface
module = imp.load_source("gridSplitter",gridSplitterPath)

mySplitter = module.gridSplitter(iface)
mySplitter.outputfolder = outputpath
mySplitter.layertocut = QgsRasterLayer(layertocutpath,"laytocut")
mySplitter.cutlayeris = True
mySplitter.cutlayer = QgsVectorLayer(cutlayerpath,"cutlay", "ogr")
mySplitter.pref = "cut_"
mySplitter.subfolderis = False
mySplitter.tileindexis = True

mySplitter.operate()

However, I get the following error:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "c:/users/Mossy/appdata/local/temp/tmpqc7_fe.py", line 23, in <module>
mySplitter.operate()
File "C:/Users/Mossy/.qgis2/python/plugins/gridSplitter/gridSplitter.py", line 206, in operate
self.layertocutcrs= layertocut.crs()
AttributeError: 'NoneType' object has no attribute 'crs'

Does anybody know how to solve this problem?


texts: Reducing excessive segmentation from Linear Referencing?

texts:
Can anyone suggest a resource which discusses different approaches to cleaning up linearly references events in order to minimize the occurrence of small dynamic segments?

I'm working with many overlapping events that in many cases should terminate at the same place, but in many cases don't. This results in very small dynamic segments. I want to reduce the occurrence of these by snapping events to other events, but only if each event isn't significantly modified. For example, an event could be extended by 10% but not 50%. The number of involved events is unknown, typically between 1 and 10, and I am not using spatially-aware software. (pure tabular processing)

I have an existing approach, but am interested in learning about other methods.

[EDIT: DESCRIBING EXISTING APPROACH AS REQUESTED]

The data depicts the locations of highway construction projects. They have been overlaid into a LRS data-structure where each project is an event, and some locations have multiple projects (overlapping projects). The problem is that many projects should terminate at the same location, but for various reasons they don't. I need to cleanup the data to minimize short segments, which implies adjusting the locations of projects slightly.

My current approach processes the segments in multiple passes. Each pass attempts to extend segments over top of a neighboring segment (replacing it) if doing so would not overly change the total length of the projects. Each pass is only permitted to "touch" a project once, and the process is looped until no more modifications are possible. One round of iterations is done which extends segments "forward" over the next segment, and a second round is done which extends them "backward" over the preceding segment. Every record is considered in each pass.

This is all done using a language called SAS, which has no spatial awareness. I could also work in Python. The reason I posted in a GIS forum is because of the linear-referenced data structure, which to most people implies GIS. I do ultimately pass the results into a GIS system.

[EDIT2: ask a specific question]

Specifically, I would like a more efficient way of doing this, ideally one which can prioritize certain projects over others. For example, I'm able to identify which projects have the most accurate termini, but my current solution isn't able to take advantage of that information.


texts: Transposing raster values on the fly in QGIS

texts:
Say, I have a raster with some annual statistics data.

Then

Daily avg = Annual / 365
Weekly avg = Annual / 52
Monthly avg = Annual / 12

I know I can do this via Raster calculator in QGIS (v2.18.15). However, there is always a new output. Therefore I am looking for more convenient to do it on-the-fly. Is there some tool to manipulate raster data settings?

For vector data, there is Query builder (in Layer Properties -> General) to exclude or manipulate the dataset (which is not exactly the same, but does a great job with data).


texts: CartoDB, Choropleth and bucket numbers in skewed data sets

texts:
How can I maximise the number of buckets in the choropleth map?

We have a data set range from 1-14 and 7 is the most # of buckets available in the wizard.

Unfortunately, most of the data occurs between 1-5, with fewer values at the 6-14 end of the spectrum.

Our preference would be for 14 buckets. Unless I'm missing another obvious solution?


texts: Stopping values from rounding to whole numbers in ArcGIS attribute tables?

texts:
I am trying to edit an attribute table in ArcGIS 10.1 and so far have been unable to keep it from rounding to whole numbers.  Even when I manage to "pad with zeroes" using the numeric settings, it will round to 6.0. I have tried the Editor > Options > General method as well.  My decimal places are currently set to round to 6, but any data I enter rounds to a whole number.  My field is set to "Long Integer".

What obvious solution am I missing?


texts: How to create ArcGIS tool with list and "sublist" using arcpy?

texts:
I have been tasked with making a tool, that when you open it you can choose from a list in a dropdown box, which then populates the second dropdown box with a sublist, like so:

However I only have a basic understanding of Python and I barely understand GIS, so this is a giant learning experience for me. I have tried using ESRI's site and this community, but alas I am still horribly stuck.

Where it goes wrong is at "self.params1.filter.list =" I can make it work with if I give it a list like ["Option 1", "Option 2"], however i already have the list "mergedList" where I have the values I want, but I cannot for the life of me make it work.

I have tried with:
self.params1.filter.list = mergedList

and

self.params1.filter.list = sorted(mergedList.keys())
and one other which eludes my brain right now.

Current code, it only has one of the params, since I can't get that to work I haven't done the other one.

import arcpy

class ToolValidator(object):
  """Class for validating a tool's parameter values and controlling
  the behavior of the tool's dialog."""

  def __init__(self):
    """Setup arcpy and the list of tool parameters."""
    self.params = arcpy.GetParameterInfo()

  def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""

    # Variables for Cursor
    featureClassName = r'ArcGIS_Drift_Grundkort_DB.GISGRUNDKORT.Jordstykke'
    cursorNavn = "ELAVSNAVN"
    cursorNr = "MATRNR"

    #Generate empty Lists
    listNavn = []
    listNr = []

    #Populate lists
    with arcpy.da.SearchCursor(featureClassName, (cursorNavn,)) as cursor:
        for row in cursor:
            listNavn.append(row)

    with arcpy.da.SearchCursor(featureClassName, (cursorNr,)) as cursor:
        for row in cursor:
            listNr.append(row)

    #Merge lists into a single list with keys
    mergedList = {}
    for i, v in enumerate(listNavn):
        mergedList[v] = mergedList.get(v, []) + [listNr[i]]

    #toolbox stuff
    self.params[1].filter.list = mergedList

    return

  def updateParameters(self):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parameter
    has been changed."""
    return

  def updateMessages(self):
    """Modify the messages created by internal validation for each tool
    parameter.  This method is called after internal validation."""
    return

It is very likely there is a better way of doing this, I just need the unique data from column A (ELAVSNAVN) which is like companies and then a sublist with the numbers (MATRNR) that goes with that.

The tool itself is incomplete since i am stuck on just the list part, just need some pointers / tips for that.


texts: Persisted member in an application extension does not save to stream

texts:
I have an ArcMap extension in which I'm trying to persist a string value. When the document is saved, the public member m_LayerName in the application extension class is not being persisted. Either it's not being written to the stream or it's not being loaded correctly once the document is reopened. I'm not sure what I'm doing wrong. The Save and Load events are definitely being executed appropriately, but no data is being saved. This is my first attempt at persisting data with an extension so I'm missing something. Below is the relevant code.

Public m_LayerName As String

...

Public ReadOnly Property ID() As ESRI.ArcGIS.esriSystem.UID Implements ESRI.ArcGIS.esriSystem.IPersistVariant.ID
    Get
        Dim typeID As UID = New UIDClass()
        typeID.Value = Me.GetType().GUID.ToString("B")
        Return typeID
    End Get
End Property

Public Sub Load(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Load
    m_LayerName = CStr(Stream.Read())
    Marshal.ReleaseComObject(Stream)
End Sub

Public Sub Save(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Save
    Stream.Write(m_LayerName)
    Marshal.ReleaseComObject(Stream)
End Sub


texts: Highlight specific area in a box in print composer

texts:
My problem can be easily illustrated by the first picture on this site:
http://bitmedia.dk/rentegning-af-kommunekort-til-faktaillustration/

I already have the overall map, but I want to make a box in print composer where the specific area of some municipalities are highlighted.

Best regards,
Kasper


texts:
I have 2 polygon featureclasses with Polygon ZM features.
I am trying to do a ITopologicalOperator.Difference() on these feature classes but it errors saying that:

  Geometry cannot have Z values

Does anyone know a way round this?

PS - I am trying to emulate the same functionality as the Erase function in the Geoprocessing API - but you cannot access this functionality in ArcEditor, you must have ArcInfo.  I take it. I am taking the right approach?


texts: OSRM Contract with multiple input OSM files stalling

texts:
I received multiple shapefiles for USA states map data split into different groups of states.
Approach - 1: I can't merge multiple shapefiles and merge into a single .osm file because it's exceeding more than the 4GB limit.
Approach - 2: I generated a respective .osm file for each state and then used osmosis/osmconvert to merge all .osm into a single .osm file. I feed that file to osrm-extract and able to generate .osrm file. Next step, Osrm-contract process is taking more than 12 hours for just couple of states. I have enought memory and CPU to process this data. Is it something wrong with the process I am following?
Commands tried :
Actual goal is to start osrm cluster.
For merging, I tried :
osmosis --rx Streets_1_filtered.osm --rx Streets_2_filtered.osm --rx Streets_3_filtered.osm --rx Streets_4_filtered.osm --rx Streets_5_filtered.osm --rx Streets_6_filtered.osm --rx Streets_7_filtered.osm --rx Streets_8_filtered.osm --rx Streets_9_filtered.osm --rx Streets_10_filtered.osm --rx Streets_11_filtered.osm --rx Streets_12_filtered.osm --rx Streets_13_filtered.osm --rx Streets_14_filtered.osm --rx Streets_15_filtered.osm --rx Streets_16_filtered.osm --rx Streets_17_filtered.osm --rx Streets_18_filtered.osm --rx Streets_19_filtered.osm --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --merge --wx Streets_filtered.osm

osmconvert Streets_filtered.osm -o=Streets_filtered.pbf

osrm-extract -p car.lua Streets_filtered.pbf

The last line generated some warnings:

[warn] Turn is a u turn but not turning to the first connected edge of
the intersection.   Node ID: 19205984, OSM link:
http://www.openstreetmap.org/?zoom=18&mlat=46.2385&mlon=-116.6238
[warn] Turn is a u turn but not turning to the first connected edge of
the intersection.    Node ID: 19205984, OSM link:
http://www.openstreetmap.org/?zoom=18&mlat=46.2385&mlon=-116.6238
[warn] Turn is a u turn but not turning to the first connected edge of
the intersection.    Node ID: 20112910, OSM link:
http://www.openstreetmap.org/?zoom=18&mlat=43.47379&mlon=-111.96569
[warn] Turn is a u turn but not turning to the first connected edge of
the intersection.    Node ID: 20117125, OSM link:
http://www.openstreetmap.org/?zoom=18&mlat=42.65019&mlon=-112.19086

The next process is taking more time:
osrm-contract Streets_filtered.osrm


texts: Broken image from MapServer, PNG not rendering

texts:
I'm trying to render WMS MapServer data on top of Google Maps using the OpenLayers JS library. My problem arises when I try to render the data as a series of points throughout the New York City area. On my local machine I get a broken image, but on my live server I get no broken PNG data or anything at all.

Any help would be very much appreciated.

You can also check out the live site at: http://134.74.146.40/~Oviedo12/final/subway%20crowding/view.html.

OpenLayers JavaScript code below:

var map;
var mapBounds      = new OpenLayers.Bounds(-8266100.0, 4938263.9, -8204223.4, 4999860.8);
var movementBounds = new OpenLayers.Bounds(-8266100.0, 4938263.9, -8204223.4, 5030000.0);
var aliasproj = new OpenLayers.Projection("EPSG:4326");
var options = {
        projection: "EPSG:4326",
        units: "ft",
        maxResolution: 'auto',
        restrictedExtent: movementBounds,
        maxExtent: mapBounds
    };

function init(){
    map = new OpenLayers.Map('map', options);
    var base_layer = new OpenLayers.Layer.Google(
                    'Google Streets', // the default
                    {   numZoomLevels: 20,
                        projection: aliasproj,
                        isBaseLayer: true
                    });

    //change 'Oviedo12' to your login name
    var wms_layer = new OpenLayers.Layer.WMS("WMS Overlay",
        "mapscripts/dynamicwms.php",
        {layers: 'L_line', transparent: true, format: 'image/png', reqType:'wms'},
        {isBaseLayer: false, visibility: true}
    );
    //*/

    map.addLayers([base_layer, wms_layer])
    //map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
    map.zoomToExtent(map.maxExtent);
    map.addControl(new OpenLayers.Control.MousePosition({position: new OpenLayers.Pixel(0,0)}));
}

Map file code:

MAP
  IMAGETYPE      PNG
  STATUS         ON
  IMAGECOLOR     255 255 255

  PROJECTION
    "init=epsg:4326"
  END

  SYMBOL
      NAME 'circle'
      TYPE ELLIPSE
      POINTS 1 1 END
      FILLED TRUE
  END

  OUTPUTFORMAT
    NAME png
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
  END

  OUTPUTFORMAT
    NAME jpeg
    DRIVER "GD/JPEG"
    MIMETYPE "image/jpeg"
    IMAGEMODE RGB
    EXTENSION "jpg"
    FORMATOPTION QUALITY=80
  END

END # All map files must come to an end just as all other things must come to...

PHP code for dynamic render:

<?php

if (!extension_loaded("MapScript")) dl("php_mapscript.so");

$request = ms_newowsrequestobj();

foreach ($_GET as $k=>$v) {
     $request->setParameter($k, $v);
}

$request->setParameter("VeRsIoN","1.0.0");
ms_ioinstallstdouttobuffer();
$oMap = ms_newMapobj("../maps/dynamic.map");

$new_layer =ms_newlayerobj($oMap);
$new_layer->set("type", MS_LAYER_POINT);
$new_layer->set("dump", 1);
$new_layer->set("status", 1);
$new_layer->set("name","L_line");
$new_class = ms_newClassObj($new_layer);
$new_style = ms_newStyleObj($new_class);
$new_style-> color->setRGB(0, 0,255);
$new_style->set("symbolname", "circle");
$new_style->set("size", 5);

$new_layer->setConnectionType(MS_POSTGIS);
$new_layer->set("connection","stuff to connect to db");
$data="the_geom from (select the_geom from station2 where lines = 'Canarsie') as foo using unique the_geom using SRID=4326";
echo ;
$new_layer->set("data",$data) ;

$oMap->owsdispatch($request);
$contenttype = ms_iostripstdoutbuffercontenttype();
if ($contenttype == 'image/png')
{
   header('Content-type: image/png');
   ms_iogetStdoutBufferBytes();
}
else
{
    $buffer = ms_iogetstdoutbufferstring();
    echo $buffer;
}
ms_ioresethandlers();
?>


texts: Trying to update layer location using .replaceDataSource

texts:
I'm dealing with several layer files that have out-of-date sources; the actual layers refered to in the .lyr file started in L: and have since been copied to W:/FOR/RSI/DKL/Local_Data .

I'm trying to update the .lyr files (in Python 2.7) to point to the new source layers. It should be straightforward, as each .lyr file has a single source, so I'm not (yet) dealing with group layers or anything like that.

My output (see below) tells me that the lyr data source is updated, but checking it in ArcCatalog, I see this is not true.

How do I actually update the dataSource in the layer file?

It seems to me I am simply changing a property of the lyr object.

I have a feeling that my arguments are maybe not quite correct in this line:

lyr.replaceDataSource (newLayerString,"SHAPEFILE_WORKSPACE", layerName)

Code:

for layerFile in glob.glob(layerFilePath + "/*.lyr"):
        print layerFile
        lyr = arcpy.mapping.Layer(layerFile)  # returns the object from each
layer file
        layers = arcpy.mapping.ListLayers(lyr) # returns the list of objects
(i.e. the actual layers) referenced by the layer file

    for layer in layers:
            if layer.supports("dataSource"): # some layers might not support the property "dataSource"
                    layerString = str(layer.workspacePath)
                    layerName = layer.datasetName
                    print '\t',"Layer ToC name is %s and workspace path is %s" %(layer.name, layer.workspacePath)
                    if layer.dataSource[-4:] == ".shp":
                        workspaceType = "SHAPEFILE_WORKSPACE" #add in other possibilities here for coverage sources, SDE feature classes etc..
            if 'L:' in layerString:     #this is a better way to select part of a string than an element search i.e.
                    newLayerString = layerString.replace(r"L:",r"W:/FOR/RSI/DKL/Local_Data",1)
    lyr.replaceDataSource (newLayerString,"SHAPEFILE_WORKSPACE", layerName)
    print '\t',"The updated source for %s is %s" %(layer.name,lyr.dataSource)
    del layer, layers #get rid of these objects
    print""


texts: QGIS 3.10 install on Ubuntu 18.04 will not recognize any projections

texts:
As the the title states a clean install of QGIS 3.10 on ubuntu simply will not recognize any projections and sets all data (both raster and vector) to unknown projections. This issue even extends to the popular quickmap service plugin.

I have tried numerous different methods of installing and each one has this issue and I simply can not figure out why as QGIS on my laptop running ubuntu does not have this issue.

The about page:


texts: Can a Geopackage file be created by Spatialite

texts: Starting with the Spatialite application, can a new Geopackage file be created, or is Spatialite only capable of working with existing Geopackage files?


texts: How to select route lines that fall outside ZIP boundaries

texts:
I have two tables. One of route lines, with associated Zip Codes, and another of Zip Code boundaries. Some of the lines cross over their Zip boundaries. Below is zoomed in picture demonstrating my problem.

The areas circled in gray are where I would have to go in and change the boundaries to encompass the route. They are color coded by Zip Code.

Is there a select by attributes solution to this, that would show me which lines are outside of their respective zones?

I am using ArcMap 10.2, Thanks for any possible help!


texts: Integrate static database with spatial database

texts:
I have some questions about how to integrate static database with spatial databases.

problematic:

I have several static data bases on different platforms (Oracle, MySQL, SQL Server) I want to turn into spatial data for some users to work in QGIS.

Step 1: geocode data
Initially I wanted to create a routine to geocode the data using OSM and OpenLayers.

Step 2: Provision of the data in spatial database
These data should be available in Oracle Spatial (is a standardization that I follow). This is where my questions begin what better way to do this integration?
There are business information that should not go to the bank so I have space, for example, a SQL Server based with static data a routine that geocodes the data and provides the correposndentes in Oracle Spatial geometries. That is the best?


texts:
I have some GeoTiff files. I want read their header and save it to .txt

I've tried several programs, but none of them work properly. If u know some GeoTiff reader let me know ;)


texts: How to get accurate coordinates from google geocoding services?

texts: Can I write my address in a better way to increase the odds of getting better coordinates  from google geocoding services. If someone has insights about how GIS parse addresses or experinces with geocoding services, please share


texts: Write geo information to TIFF by LibGeoTiff.NET

texts:
Currently I am writing a crop function for georeferenced TIFF files. I use Free.Ports.LibGeoTiff which seems to work quite well to read the TIFF, also the geo references.

It is also possible to write a copy of the TIFF file to a new file, but I can't find a solution to write the geo references as well. The copy is a non-referenced TIFF.

I use the following code to read the geokeys according to the rare example codes and write them back in the copy file:

foreach (Free.Ports.LibGeoTiff.geokey_t geotag in Enum.GetValues(typeof(Free.Ports.LibGeoTiff.geokey_t)))
    {
        try
        {
            if (Free.Ports.LibGeoTiff.libgeotiff.GTIFKeyInfo(geotiff, geotag, out Free.Ports.LibGeoTiff.tagtype_t tagtype) > 0)
            {
                switch (tagtype)
                {
                    case Free.Ports.LibGeoTiff.tagtype_t.TYPE_ASCII:
                        if (Free.Ports.LibGeoTiff.libgeotiff.GTIFKeyGet(geotiff, geotag, out string geovaluestr) > 0) { Free.Ports.LibGeoTiff.libgeotiff.GTIFKeySet(geoouttiff, geotag, geovaluestr); }
                        break;
                    case Free.Ports.LibGeoTiff.tagtype_t.TYPE_DOUBLE:
                        if (Free.Ports.LibGeoTiff.libgeotiff.GTIFKeyGet(geotiff, geotag, out double geovaluedbl, 0) > 0) { Free.Ports.LibGeoTiff.libgeotiff.GTIFKeySet(geoouttiff, geotag, geovaluedbl); }
                        break;
                    case Free.Ports.LibGeoTiff.tagtype_t.TYPE_SHORT:
                        if (Free.Ports.LibGeoTiff.libgeotiff.GTIFKeyGet(geotiff, geotag, out ushort geovaluesht, 0) > 0) { Free.Ports.LibGeoTiff.libgeotiff.GTIFKeySet(geoouttiff, geotag, geovaluesht); }
                        break;
                }
            }
        }
        catch (System.Exception)
        {
            Console.WriteLine(geotag.ToString());
        }
    }

    bool saved = Free.Ports.LibGeoTiff.libgeotiff.GTIFWriteKeys(geoouttiff);

Debugging tells me the GTIFKeyGet() will read the data. Also, after setting the values I need to write the values into the file with the function GTIFWriteKeys() which returns true, but it does not actually do that.

Does anyone have a brilliant thought about this (I prefer this library and not look at GDAL)?


texts: ArcGIS difference reclassify tool properties symbology

texts: Is there a difference between the reclassify tool and just changing the ranges of a layer within the properties>symbology?


texts: GeoServer: Rasters in GE and opacity with map-type:values and css

texts:
I am pretty new to GeoServer and am having some issues with styling rasters for Google Earth using the css plugin.

I have a raster that covers a particular areas which has 1 band and 6 values in that band. I have  the following css style code

/* @title raster */
* {
raster-channels: auto;
raster-opacity: 0.4;
raster-color-map-type: values;
raster-color-map:
 color-map-entry(#00FF00, 0) color-map-entry(#008000, 1) color-map-entry(#00FFFF, 2) color-map-entry(#0000FF, 3)  color-map-entry(#FF8200, 4) color-map-entry(#FF0000, 5);
}

On the preview I am getting the expected results (everything the right color and opacity according to plan). When I download the KML but with Google Earth I am seeing the raster with no opacity and surrounding the raster is black which covers the whole globe.

I have also found when i leave out the 'raster-color-map-type' property, it looks like I want it to, but I need discrete vales rather that ranges

Has anyone else seen this issue before, and do you have a way to fix it?


texts: Use of Raster Calculator in ModelBuilder

texts:
I have the following equation:

3000*(1-exp((-0.000664)*input raster))

I want to make a tool to use this equation on raster images. I want to do this with the Raster Calculator with the help of ModelBuilder. Can you please explain the procedure for making this tool?


texts:
I was reading this GIS.SE question about whether TileMill will be replaced by Mapbox Studio. I got worried about the future as a TileMill user, and the question suddenly came to me "isn't tilemill opensource?". Why can't we branch it if something goes wrong. To check, I went to their official website, and only found that [TileMill is]:

  Powered by open source
  TileMill is built on a suite of open source
  libraries including Mapnik ...

Nothing is said about whether TileMill itself is open source. I went to the github site, and the license reads:

  Copyright (c), MapBox All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ...

The rest of the text looks pretty much open-source. What about the "MapBox All rights reserved." part? Does that conflict with the open-source spirit?

I am not familiar with the legal terms. But I don't see any familiar license terms like GPL, LGPL, apache or BSD.

My question is:

is TileMill open source or not?


texts:
I have two polygon layers, where one is river catchments and the other is subcatchments.

I want to identify which catchment each subcatchment belongs to. So, I would like either a list where each subcatchment is related to their catchment, or to get the catchment names added to the attribute table for the subcatchment layer.

I have done a lot of searching but have not found anything that answers my questions.


texts: Ground Control Points change when moving from one reference system to another?

texts:
In this question I'm interested just in the theoretical part. So, let's say we have such GCP in local reference system:

 (-2,14) (186,180) Label "Point 1",
 (-2,13) (211,6072) Label "Point 2",
 (-1,13) (6108,6052) Label "Point 3",
 (-1,14) (6088,161) Label "Point 4"

This data is taken from a real world TAB file. At each row there are two pairs of coordinates - the first pair, as I know, corresponds to geographic coordinates and the second pair to image pixel points. It is important to notice, that geographic coordinates are not in some well known coordinate system, in other words there is no SRID or EPSG number, which describes these coordinates. However, I know perfect parameters, that can convert these coordinates to some well known coordinate system. Applying these parameters I can get this file as an output:

 (x1,y1) (186,180) Label "Point 1",
 (x1,y2) (211,6072) Label "Point 2",
 (x2,y2) (6108,6052) Label "Point 3",
 (x2,y1) (6088,161) Label "Point 4"

The parameters which converted (-2,14) to (x1,y1) are just sin, cos and x and y offsets. What I do not know is whether I should apply the same transformation to pixel coordinates like (186,180) at the first row. Should I rotate these coordinates to get correct positioning or not? It seems like I should, because when I publish my map I see some positioning errors (around 20-70 meters). But I'm not sure of that.


texts: What type of object QGIS native:mergevectorlayers accepts for LAYER parameter?

texts:
Here is part of the code which I am using:
from qgis.processing import alg
from qgis.core import *
import processing

@alg(name="ex_new", label=alg.tr("Example script (new style)"), group="examplescripts", group_label=alg.tr("Example Scripts"))
@alg.input(type=alg.MULTILAYER, name="INPUT", label="Input layer")
@alg.input(type=alg.VECTOR_LAYER_DEST, name="OUTPUT", label="crowns")

def testalg(instance, parameters, context, feedback, inputs):
    """
    Description goes here. (Don't delete this! Removing this comment will cause errors.)
    """
    mergelayer_params = {'LAYERS':['INPUT'], 'CRS': QgsCoordinateReferenceSystem('EPSG:2180'), 'OUTPUT':parameters['OUTPUT']}

    mergedlayer_result = processing.run('native:mergevectorlayers', mergelayer_params, context=context, feedback=feedback)

    return {'OUTPUT': mergedlayer_result['OUTPUT']}

I am trying to pass multiple .shp files with QgsProcessingParameterMultipleLayers with alg.MULTILAYER to process native:mergevectorlayers.
But it returns error
Invalid parameter value for LAYERS.
I was thinking that with QgsProcessingParameterMultipleLayers I am passing a list which should work for used processing algorithm. What I am doing wrong?


texts: Adding Table to Layout View using ArcPy?

texts:
I am using ArcGIS 10.1 and I have a non-spatial table and some layers in a Data Frame.

When I switch to Layout View I want to be able to show the map in a data frame element and the table in another element (something that one could do with "Add Table To Layout" from Table Options, but I want to do this in one step without having to go to Table Options).

Is there a way to do this using ArcPy?

I couldn't find any function in the ArcPy library that would create a new Layout Element ... and then I also don't know how to add the contents of the table to the Layout Element.


texts:
I'm trying to make a select on a mysql table and then write it out to a geojson file. I'm getting close but there are a few issues. Here's what I have so far:

<?php
require("dbinfo.php");

// Opens a connection to a mySQL server
$connection=mysql_connect ($hostname, $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active mySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// json output
$query = 'SELECT * FROM markers LIMIT 5';
$dbquery = mysql_query($query);
// $rows = array();
// while($r = mysql_fetch_assoc($dbquery)) {
//  $coords = $rows['lng'] . ", ";
//     // $rows[] = $r;
// }

if(! $dbquery )
{
  die('Could not get data: ' . mysql_error());
}

// Parse the dbquery into geojson
// ================================================
// ================================================
// Return markers as GeoJSON
$geojson = array(
    'type'      => 'FeatureCollection',
    'features'  => $feature
 );

while($row = mysql_fetch_assoc($dbquery)) {
    $feature = array(
        'type' => 'Feature',
      'geometry' => array(
        'type' => 'Point',
        'coordinates' => array($row['lng'], $row['lat'])
            ),
      'properties' => array(
            'name' => $row['name'],
        'comment' => $row['comment']
            )
        );
    array_push($geojson, $feature);
};
mysql_close($connection);

// // Return routing result
    header("Content-Type:application/json",true);
    //header("Location:map.html");
    echo json_encode($geojson);
?>

The result I get is:

{"type":"FeatureCollection","features":null,"0":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.677811","45.569889"]},"properties":{"name":"Bear on a Box","comment":"Bear on a box."}},"1":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.653770","45.542503"]},"properties":{"name":"test","comment":"aksdhvah"}},"2":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.675400","45.515690"]},"properties":{"name":"Bike Art","comment":"Bike pile."}},"3":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.688789","45.517735"]},"properties":{"name":"Goose","comment":"lipsumLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ut urna dolor. Sed iaculis velit quis nis"}},"4":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.649132","45.513401"]},"properties":{"name":"Goose","comment":"lorem ipsum"}}}

So, the issue is that the "features" item  does not hold the rest of the info as an array. It remains 'null'. Then, it appears the array position is written into the result which I don't want either. Lastly, I need to get rid of the quotes around the coordinates so it can be read properly by Leaflet's GeoJSON constructor. I'm flailing with arrays and probably not getting it. I mean, does everything that gets pushed into an array have to be surrounded by quotes?


texts: Atlas zoom on layer outside coverage layer

texts:
The Goal

Generate maps based on communities (701), within districts (50). Overview map next to the main map that shows the district within the region (8). In the main map I only show the district that the community belongs to. The maps will be printed and the zoom needs to be on the district.

The Situation

I have followed How to generate multiple maps where one highlighted attribute changes? to highlight the map.

Used How to filter features in other layers of a QGIS Atlas? to filter out only the district that the community belongs to.

All works perfectly, now I create the Atlas and the maps are created. Problem now is that it zooms on the community, while we want to show the district as a whole with the community moving inside.

Possible workarounds

In the attribute table, add a column with the scale and other columns to define the extents, per district. This would be manually and I have to do it 50 times.

Any idea if it is possible to zoom based on a layer outside the coverage layer, in this case the district layer?


texts:
When I try to create a signature file in ArcMap 10.7.1 I am getting an error.
error: failed to create signature file
I tried making a Map copy to c:\gis, shapefile copy to c:\gis, and tried to save the signature file to c:\gis (from c:\gis\assignment) that previously was and didn't do any good. The same goes for when I tried to save at the desktop.


texts: What is this line, how did I do and how do I delete it?

texts: I have taken up QGIS 2.18 today and have created a map of sales territories but in doing so have somehow put a line across England. If I hide all the layers it remains in place, I can find no way of selecting it and have no idea what it is. My main aim is to remove it but any extra information (how, what, purpose etc.) would be welcome too.


texts: I used sDNA Prepare to repair the road network in ArcGIS10.2, but the error was always reported. Could you tell me the reason?


texts: Nation_script_load.sh asks for the DB password for each step

texts:
I'm loading TIGER geocoder data with the nation_script_load, during the process, I have to type the password several times. The same password that I set earlier along with the paths.

export PGPASSWORD= "my_password"

Is this normal or can I avoid to type/paste the password each time?


texts: GWR- interpreting standard residual and local R-square

texts:
I have run GWR for a layer with polygons. For some features the Std Residual has high value as well as the local R-square.

How is this possible?

If std residual is high, the predicted value will be higher than the real, is it right?

So, the local R-square shouldn't be small as the regression didn't predict right the real value but the local R-square is high.

What is the misunderstanding?


texts: Spatial Resolution Reprojection - rom Angular to Rectangular Values with GDAL?

texts:
I have an image in a WGS 84 / No Defs projection. I can get it spatial resolutions in angular units for X axis and Y axis through geotransform parameters.

If I would reproject this image into WGS 84 / World Mercator, then geotransform parameters will become reprojected too, and I will be able to get new spatial resolution for my image in meters

How can I reproject those resolutions without image reprojection?


texts: Decrease polygon vertices count maintaining its aspect

texts:
Is there an algorithm or technique that allow me to decrease the number of vertices of a polygon while maintaining it at some acceptable aspect?

The problem: I have a functionality in my system  (that uses PostGIS) that tests which polygons a given point is inside. Occurs that I have dozens of polygons that goes from 20 to thousands of vertices and this test is taking too long to run. One possible solution would be to decrease the number of vertices to a given maximum (let's say 100) while maintaining the format and removing the details.