texts:
A while back (ArcGIS 10.0 times, or maybe even 9.3) a colleague of mine created a mxd with a few hundred manholes and attached dynamic hyperlinks to them (pointing to photos of them). (I know this might not be the most efficient method, but done is done.)

However, now we can't seem to find this shapefile/mxd, and I would really need a way to search for a shapefile that has such hyperlinks.

In the ArcGIS Help (linked above) it states that: This [hyperlink] association is stored with your layer. They are also stored with your layer if you save the layer to a file. /.../ ArcMap uses the feature ID (FID) field to associate dynamic hyperlinks with features.

This far in my research I've been unable to find a way to see where they are stored or how to convert the dynamic hyperlinks into a field based hyperlink (which could indicate how to access the hyperlinks). I can probably figure out a couple of strings that should be in a list like that, if it could be of any use.

Is there a way to search for shapefiles which contains dynamic hyperlinks? Preferably without heaps of programming, but I'm open to suggestions!


texts: Unable to import base layer onto Cartodb

texts:
I have been trying to import basemap (crm_hillshade) from this website http://www.ngdc.noaa.gov/wiki/index.php/WMS_Service_List onto Cartodb but it keeps showing error and the basemap is unable to load.

Is anyone else having the same problem with importing basemap from this website?

Are there other websites which I can use for Cartodb maps?


texts: I've installed QGIS 2.10.1 Pisa on my PC, but I don't have the OpenLayers option in the plugin section (Módulos). And also not appear in the Web section. I've uninstalled it and installed back the QGIS, but this option is not there! I really need this tool to my work. Please help me!


texts: Writing where clause for Feature Class To Feature Class in ArcPy?

texts:
The following picture shows the table for the shapefile.
I need to extract those rows with different values of TotalCT, which means I need to extract the first row into a new shapefile named Value_1.shp, and extract the second and third rows into another new shapefile named Value_2.shp. I wrote the below code, but it gave me the empty shapefiles. Any suggestions?

casefile = r"C:\Users\TL\Desktop\831test\913\FULLNAME_Atlanta_Park_Rd.shp"
outputfolder = r"C:\Users\TL\Desktop\831test\casefile"
ValueCT = unique_values(casefile, field)
i = 1
field = "TotalCT"
for value in ValueCT:
    arcpy.FeatureClassToFeatureClass_conversion(casefile, outputfolder, 'Value_' + str(i), "TotalCT" + "= %d" % value)
    i += 1


texts: Loading Shapefiles into PostGIS using shapefile import/export manager

texts:
I am a complete beginner with PostGIS. I've started learning it using the tutorials provided by Boundless. In section 4 of this tutorial where I want to import shapefile in PostGIS, I do not have the PostGIS shapefile Import/Export Manager tool in the PgAdmin III.

I've followed the tutorial step by step. They have never pointed if I need to install such tool or how to activate it, etc. Any idea what the problem could be? and how I can solve this?

I've installed Postgresql 9.3, PostGIS 2.1 , pgAdmin3 1.12.3 on Windows Server 2012 R2 Standard.

by the way, the relevant page for this issue in the tutorial is at:
http://postgis.net/workshops/postgis-intro/loading_data.html

Thanks!


texts:
I am working on a project that involves some back and forth between ArcGIS 10.1 and Bentley Microstation and Geopak.

Microstation/Geopak has the ability to import/export LandXML files for 3D surfaces.

I have been bringing LandXML files into ArcGIS through the "LandXML to TIN" (3D Analyst) tool.

Now that I've done some processing in ArcGIS I'd like to send the surfaces back to MicroStation.

Using LandXML as an intermediate again would make sense except that ArcGIS seems to lack a "TIN to LandXML" tool.

Does anyone know how to convert a TIN to Land XML? Or, alternatively, any format that can be read by MicroStation/Geopak?


texts:
I'm just starting using QGIS. I have run a couple of geoprocessing tasks and the results look good but I'm trying Union and am not having much success.

The main one I'm trying to do is, I have a city corporate boundary and two types of road data - road centerlines and ROW boundaries. I am trying to union the corporate boundary with each one separately, and in both cases, when I run it the resulting shapefile seems to be empty.

The original vector files (roads and corporate boundaries) are all from geodatabases and the output is shapefile.

Any assistance would be help, maybe it's already been covered elsewhere here and I just didn't see it.

Ok, that seemed to work. See below.

Now, my next step is I'm trying to polygonize. But I'm getting an error message. Basically what I'm trying to do is divide the city into blocks so I can assign a value to each block. Maybe I should post this as a separate topic but I'll try here. I'm not sure if I'm getting the error because of something about the lines or someting in the attribute table... Or something else. Here's a closeup of what the street centerlines look like.

Maybe I need to clean up the lines or something, not sure. But anyway here's the error message I get when I run it.


texts:
This JSfiddle example currently changes the visibility of a layer using two individual buttons.

However, i want to change this to just one check-box, the check-box in this case has been styled by Bootstrap Check-box.What would be the most simple method to bind the set.visibility command to this?

Edit: I have also tried to do this with a function toggleOSM()linked the onClick of the check-box as per this JSFiddle but it doesn't appear to work.


texts: Merging Multiple Shapefile Polygons in R

texts:
I have a regional shapefile of England and Wales but without containing Scotland and Northern Ireland.

I want to add the outlines of Scotland and Northern Ireland in without regional divisions so the combined would consist of the following polygons:

London
North-West
North-East
East of England
East Midlands
West Midlands
South-West
South-East
Yorkshire & The Humber
Scotland
Northern Ireland

I have a separate shapefile with just the country border of Scotland and Ireland - my question is it possible to add this to my regions map and if so how can I do so in R?


texts: Defining layer CRS and avoiding CRS dialog in PyQGIS?

texts:
There is an existing Shapefile, which I want to add.

At the moment my code looks like:

self.iface.addVectorLayer(self.shpFilePath, "Track", "ogr")

It works fine, but i want to define the crs within the code. Is it possible?
I found some similar questions like this one: Programmatically Select a CRS in QGIS 2.4 using Python

But i don't get it work anyway.


texts:
When I us a cursor on a table and get a column that doesn't exist error as follows:

with arcpy.da.SearchCursor(r'P:\csvExample.csv', ["ID", "example", 'long list of other headers']) as cursor:
...     for row in cursor:
...         print row[1]
...
Runtime error
Traceback (most recent call last):
  File "<string>", line 2, in <module>
RuntimeError: A column was specified that does not exist.

I would like to know which specific field(s) were specified that don't exist.  In this example, the field 'example' should actually be 'Example' to match the header name in the file.  I would like to either add my own error or in some way extract the information that it is the specific field 'example' that is creating this issue.  Any elegant ways to do this?


texts: Can't see my postgres geometry tables in QGIS

texts:
When I link my postgres/gis table to QGIS I expect to be able to add the table into QGIS. But for some reason QGIS does not recognize my tables as geometry tables. The datasets were originally shapefiles. After uploading them with the shapefile uploader of postgis they do have a geom column.

When I uploaded them I did have to change UTF 8 to LATIN1. Postgis is enabled in my database.

I would like to know why it is not working, I don't know where to start. Can anybody help me out here?

On advise of a comment I have added the result of the geom column when doing \d tablename in the psql shell.

 geom       | brondata.geometry(MultiPolygon,28992) |
Indexes:
    "wijk_2014_pkey" PRIMARY KEY, btree (gid)
    "wijk_2014_geom_idx" gist (geom)


texts: Landsat 8 band combinations aren't appearing the way they should in ArcMap

texts: I did all the right steps of combining 7 of Landsat 8 bands into one .tif in ArcMap but the combinations aren't just appearing the way they should, attached picture related.


texts: I am using QGIS 2.6.1 but I don't know how to split a state into two states

texts: I have a shapefile file of the states but my file is older one and after that one state in India converted into two different states so how can I separately show both the states on the map using QGIS. I also have the shapefiles files of districts within the states.


texts: I have a jpeg image of a district. I need to georeference it. The problem is that I am able to find only one control point of it. All other line features (are roads) are those which I am not able to match with Google since the boundary of my area and the area given in Google Maps differs. I am hereby attaching the image. Please help me to solve the issue


texts: Retrieve sentinel2 cloud mask through an API

texts:
Have you ever heard about an API to download sentinel2 cloud mask only ? Not all bands but just cloud mask. Because I just want to process a small part of each satellite tile and it's very time consuming to download plenty of tiles full of cloud. The average cloud information per tile does not fit my expectation.

For the moment I download all the bands and cloud mask through this API : Sentinel-download


texts: Convert Array of Interger to GeoTiff in Java?

texts:
I am having the Hashmap of lat,long which is key for the Integer which represents the color value

hashmap<Class of lat/long , Integer> // where class of lat/long is my custom class represent a area

means at a particular position the color of that area 30x30 meter square represented by one pixel should be decided by the Integer value
if 1 == Green like wise

that i convert it into the array of a square which could enclose this area
and created a array as

int[max.length][max. width ] // so that they could enclose the area

In the array if the point ie int[x][y] this x and y lies on area i made the value 1 for that color Green color.
 But if point does not lies on area its value in array is -1.
as in image

please help


texts: Clearing the "Geometry Imports" and "Drawing" tools from the Map in Earth Engine

texts:
I am trying to remove the "Geometry Imports" and "Drawing" tools from the Map in Earth Engine. I have tried

  Map.drawingTools().clear();

But it did not work. I was not able to find any solution from internet. Is there anyone who can help me with this issue?


texts: Unique constraint for SpatialLite geometry column

texts:
I am creating a SpatiaLite database where I want to ensure that the contents of the geometry column for a table are unique. For normal SQL I would add a UNIQUE constraint to that column but, I don't know how to do this for a SpatiaLite geometry. In case it is relevant, the geometry column in question contains points.

I found a question here asking how to remove duplicates from a table: Remove duplicates from Spatialite. The solution provided here is potentially useful but, I would prefer preventing duplicates from entering the table in the first place.

How can I ensure that the geometry column for this table is unique?


texts: Finding all airports in given country or region using Overpass API?

texts:
I'm starting using the Overpass API and I would like to request airports data in some given regions and countries.

So for instance, I've written,

{{geocodeArea:Île-de-France}}->.searchArea;
node["aeroway"="aerodrome"](area.searchArea);
out;

To find all the airports in the Paris region.

Nevertheless, it only returns two very small aerodromes, but not the two main airports.

Is the data incomplete or is my request not properly written ?


texts: US ZIP Codes +4 By State or County- Shapefile (or table/dbf)

texts:
I am looking for Zipcode data with the +4 digits at the end for a City (I can use it by state and clip the points to my municipal boundary). I called the post office and had no luck (national customer center in Memphis, TN- claimed that their +4 ZIP Code GIS Layer is not for the public).

Would anyone know where I could find this data?


texts: VBA Convert decimal degree to Meters button

texts:
I have 2 data frames one which has WGS data in it and the other OSGB1936. I am trying to create a button where the user can input decimal degrees (WGS) and it will zoom them to that location in British National GRid (OSGB1936) I have done the code but when it zooms to OSGB data frame it does not convert the decimal degree to meters. It returns incorrect values for Northing and Eastings in meters.

The code does work only if i have done it as a ToolControl_MouseDown but that uses pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y. which i dont want to do because i want the user to enter the value from a text box. Any ideas please?

Private Sub CommandButton2_Click()

Dim pSREnv As ISpatialReferenceFactory2
Set pSREnv = New SpatialReferenceEnvironment
Set m_PCS = pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_BritishNationalGrid)

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim x As Double
Dim y As Double

 y = CDbl(Texty.Text)
 x = CDbl(Textx.Text)

Dim pEnvelope As IEnvelope
Dim pMap As IMap
'Set pMap = pMxDox.FocusMap

Dim strName As String
    strName = "Layers"

Set pMap = GetMap(strName)
 If Not pMap Is Nothing Then
    If pMxDoc.ActiveView Is pMxDoc.PageLayout Then
        Set pMxDoc.ActiveView.FocusMap = pMap
    Else
        Set pMxDoc.ActiveView = pMap
    End If

    End If

    Dim pPoint As IPoint
    Set pPoint = New Point

    pPoint.PutCoords x, y     'pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y

    Dim pGeom As IGeometry
    Set pGeom = pPoint
    Set pGeom.SpatialReference = pMxDoc.FocusMap.SpatialReference
    pGeom.Project m_PCS

    Set pEnvelope = pMxDoc.ActiveView.Extent
    pEnvelope.CenterAt pPoint
    pMxDoc.ActiveView.Extent = pEnvelope
    pMap.mapScale = 5000
    pMxDoc.ActiveView.Refresh

        Application.StatusBar.Message(0) = "meters east: " & pPoint.x & ", meters north:" &     pPoint.y

End Sub

The below code is the updated but still does not do what it should. When i enter the decimal degrees 53.47574, -2.22553 it returns a value of -512464, -2174656 which is in the incorrect position. So somewhere in the conversion between WSG and OSGB it is going very wrong.

`Private Sub CommandButton2_Click()

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pEnvelope As IEnvelope
Dim pMap As IMap

Dim pSREnv As ISpatialReferenceFactory2
Set pSREnv = New SpatialReferenceEnvironment

Dim pProjCoordSystem As ISpatialReference
 Dim pProjCoordSystem2 As ISpatialReference
Dim pGeoTrans_A As IGeoTransformation
'Dim pGeoTrans_B As IGeoTransformation

Set pProjCoordSystem2 =   pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_BritishNationalGrid)
Set pProjCoordSystem = pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_WGS1984UTM_14N)

Set pGeoTrans_A = _
pSREnv.CreateGeoTransformation(esriSRGeoTransformationType.esriSRGeoTransformation_OSGB1936_To_WGS1984_1)

 Dim strName As String
    strName = "Layers"

 Set pMap = GetMap(strName)
 If Not pMap Is Nothing Then
    If pMxDoc.ActiveView Is pMxDoc.PageLayout Then
        Set pMxDoc.ActiveView.FocusMap = pMap
    Else
        Set pMxDoc.ActiveView = pMap
    End If

    End If

Dim x As Double
Dim y As Double

 y = CDbl(Texty.Text)
 x = CDbl(Textx.Text)

   Dim pPoint As IPoint
    Set pPoint = New Point
    'Set pPoint = New esriGeometry.Point
    Set pPoint.SpatialReference = pProjCoordSystem2

    pPoint.PutCoords x, y     'pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y

   Dim pGeom As IGeometry2
    Set pGeom = pPoint
    Set pGeom.SpatialReference = pProjCoordSystem2
    pGeom.ProjectEx pProjCoordSystem2, esriTransformForward, pGeoTrans_A, 0, 0, 0

    Set pEnvelope = pMxDoc.ActiveView.Extent
    pEnvelope.CenterAt pPoint
    pMxDoc.ActiveView.Extent = pEnvelope
    pMap.mapScale = 5000
    pMxDoc.ActiveView.Refresh

    Application.StatusBar.Message(0) = "meters east: " & pPoint.x & ", meters north:" & pPoint.y

   End Sub'


texts: Creating daily grid from table using ModelBuilder?

texts:
I´m trying to create a daily grid file for precipitation from a xlx table table that has X, Y, P1, P2,..., P365 columns and n gauges rows.  I´m new in ModelBuilder but it seems this may be the best way for somebody that has no programming.

How can I do this?


texts:
I'm a GIS newbie trying to design a fiberoptic network in QGIS. What I'd ideally need is to draw lines on top of a map or orthophoto, assign a name/id to each line and a type. Get a list of all the lines and how long they are.

I'm grateful for any tips on how to go about doing this and what resources to read.


texts: Visualize polyline n-to-n relations in QGIS using PyQGIS

texts:
I have 2 traffic networks (A and B) with links relating to each other. Each link has an id. E.g. link 1 of network A can have a relation to 3 links of network B. Link 2 of network A might also have a relation to 1 of those 3 links of network B, and also to another one etc. I'm depicting these relations in GeoJSONs with features in the form of:
  "features": [{
  "type": "Feature",
  "properties": {
    "id": 12345,
    "name": "Street with a certain name",
    "relations": [
      123,
      456,
      789
    ]
  },
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [-74.06, 40.60],
      [-74.06, 40.60],
      [-74.06, 40.61]
    ]
  }
}]

So in a different layer/GeoJSON of network B there will be linestrings with the IDs 123, 456, 789 that relate to the Linestring above of network A and vice versa.
Another possibility, instead of storing relations within the JSON, would be to have the relations in a separate (csv) table, with each row depicting a relation, like:
id_A,id_B
12345,123
12345,456
12345,789
etc.

I would like to be able to visualize these relations, e.g. when selecting the link of network A above, I would like the 3 related  links of network B to be 'highlighted' in some way, or at least be filtered automatically.
Is there a way to easily and efficiently achieve this in QGIS, maybe via a Python script (Networks could contain multiple thousand links)? This is supposed to be part of a larger Python plugin. My preferred way to achieve this would either be highlighting the relating links while at the same time keeping a view of both whole networks, either somehow automatically when this 'mode' is enabled, or at least by activating some script after selecting the link, like 'Visualize Relations'.


texts:
I am trying to recreate this demo using QGIS only. https://thomasthoren.com/2016/02/28/making-a-new-york-times-map.html

Specifically I am trying to reproduce the hillshade and color portion without using a Makefile and the command terminal (i haven't progressed that far in my technical skills).

rm -rf tmp && mkdir -p tmp
gdaldem \
    hillshade \
    tif/afghanistan-cropped.tif \
    tmp/hillshade.tmp.tif \
    -z 5 \
    -az 315 \
    -alt 60 \
    -compute_edges
gdal_calc.py \
    -A tmp/hillshade.tmp.tif \
    --outfile=tif/afghanistan-color-crop.tif \
    --calc="255*(A>220) + A*(A<=220)"
gdal_calc.py \
    -A tmp/hillshade.tmp.tif \
    --outfile=tmp/opacity_crop.tmp.tif \
    --calc="1*(A>220) + (256-A)*(A<=220)"

The result will produce something like this:

Is it possible to complete this only in QGIS? I have the Raster GDAL plugin installed. I have tried using Raster>Analysis>DEM tool to recreate this but I haven't been able to succeed in getting a similar result.


texts: "RuntimeError: wrapped C/C++ object of type X has been deleted" in QGIS Plugin

texts:
I cannot use the QGIS settings options, because I am getting the error as per below:

Traceback (most recent call last):
  File "C:/Users/mariuszk/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\provider.py", line 69, in loadAlgorithms
    self.addAlgorithm(alg)
RuntimeError: wrapped C/C++ object of type ORSdirectionsPointsLayersAlgo has been deleted

It applies not only for digitalizing, but also for colour changes and any other option.

How can I fix it? Or shall I do the reinstallation/upgrade to new version? Upgrade QGIS to version 3.10 didn't help.


texts: How to explain why a particular ArcSDE state does not compress?

texts:
I am maintaining an ArcSDE database and would like to avoid killing connections to ArcSDE in order to run the compress operation.  Our versioning workflow is very simple.  Everyone edits the DEFAULT version directly. I know that it is not possible to compress to state 0 without reconciling and removing connections but we do not need to compress to state 0.  All our applications are accessing SDE via ESRI software or an API which can access the DEFAULT version so our users/scripts should have access to all the data all the time.

Having said that I am constantly monitoring the states that remain uncompressed and sometimes I cannot explain why a specific state would not be merged with state 0.  I know that if there is branching in the state tree due to current edit sessions, some of those states cannot be removed.  Same is the case if you have named versions that have not been reconciled.  Also if users have locks on particular states, those states will not be blown away. For this reason I kill processes that are older than 1 day.

But what if I have a linear state tree and a couple of states that do not have state locks on them do not get removed?  Why might this be?  What other factors influence which states get removed during a compress.

The ultimate goal here is to have no down time at all except for when performing schema changes.


texts: Matching two types of data (elevation and imagery) which are in different scale?

texts:
My problem is that elevation and imagery data I'm getting from USGS is in different scales and is aligned to different grids. I don't want to match it manually in Photoshop.

Does QGIS know how to match this data?

(huge, blue square is elevation, small ones, imagery)


texts: How to count the number of pixels with a specific value of a .gif file in QGIS

texts:
So I have this .gif file that has values from 0-255 but not entirely grayscale. I tried the r.report and it does not work. I also tried the raster calculator like: "myraster@1"= 1 (because I want to count how many pixels have the value 1) then I get a completely wrong output with nonsense values. Is it that the r.report and the raster calculator can't handle .gif files or am I doing something wrong?  The white pixels have a value of 1 and I want to count these pixels. Here is the .gif file.

If it helps I am adding the colortable of the .gif:

Like I said, I need the number of white pixels that have the value 1.


texts: I want to check whether a .pbf file is up to date. Are there any methods to acquire such a kind of information?


texts: How to display the map within two longitude lines

texts:
I am new to GIS and I try to use the following code to display a pacific-centered world map.

+proj=robin +lon_0=-198 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

However the map displayed is a bit messy as below:

I'm wondering whether I can limit the map within two longitude lines to eliminate those horizontal lines. However I don't know the proj4 code to realize this.


texts: How is Sentinel 2 MSI Natural Colours Profile in SNAP calculated

texts:
Using the ESA Toolbox named SNAP one can load a sentinel 2 data package and see a RGB view using the profile.

I am wondering what this profile in mathematical terms are.

Is it just information about which bands to use?
Is it a weighting of the bands?
Is it static across time/geo position?

How would one create a RGB geotiff from a sentinel 2 data package using GDAL?

I noticed that seeing the RGB images in SNAP they seemed dark. What tools do we have to auto adjust images to best possible visual appeal?


texts: How do I keep my callout boxes from looking wrong when the data frame is rotated?

texts:
I sometimes like to rotate a data frame in a layout, for example to fit more on the page if my area of interest is rectangular and runs from, say, northeast to southwest. But when I do, something strange happens to any labels I have which are in the callout box style: the carat pointing from the box to the feature gets very long and thin, and it looks terrible. Here's what my labels look like when the data frame is not rotated:

I can convert that to annotation and move it around and the carat still looks like it should:

But when the data frame is rotated, this is what it looks like, the carat is squashed down to a thin line. The only change I've made here is rotating the data frame:

Converting it to annotation and moving it around doesn't improve things much:

Any ideas as to why this happens, and how to prevent it?


texts: Automatic numbering of attribute table in QGIS?

texts:
I have a shapefile containing population data for Baltic countries. Using the SQL formula: $rownum in the field calculator, I was able to create an automatic numbering of rows (far right on the picture below), from 1 to the end of my table. However, for no apparent reason, the numbering is broken at row 129 and switches to 766. It changed at the exact place where I have a new country, so maybe it is linked.

Any reason why this happens?


texts: Unsupervised K means clustering image classification

texts:
I am trying to do unsupervised classification on time series hyperspectral bands using K-means clustering techniques in Qrfeo toolbox plugin of Qgis to mask out shadow area.

But my problem is I am not able to compare the results to each other because the classes assigned are different from image to image.

Could any one of you help to resolve this issue?


texts: How to manage two map items in a QGIS composition with python?

texts:
I need to manage two different map items in the same map composition, with a stand alone python script.

Each composer map has been referenced like this:

composerMap1 = composition.getComposerMapById(0)
composerMap2 = composition.getComposerMapById(1)

Then, I suppose that I should alternatively set to True and False the keepLayerSet variable, using the function setKeepLayerSet(), and each time I should add a new layerset to the Map Renderer, with the function setLayerSet(layerlist).

At least, that's what I think... seen that this is the procedure for the desktop QGIS software. But it does not work properly: in the exported image there is always an empty map, while the other display the same set of layers.
Has anybody tried to do the same thing, and has some hint to share?
Thanks!


texts: Hiding polygons outside of current atlas feature in QGIS?

texts:
Within the above image, I would like to ideally hide the polygons outside the current atlas feature (some to the east and also to the west - these are part of other atlas features)

They are currently masked which helps, but it would better if they could be hidden entirely.

I still want the MasterMap to show through, so I cannot just increase the strength of the mask (unless I can do that and exclude the MasterMap from the mask somehow?).

This is being created within QGIS 2.18.17 in a map composer.


texts:
I have a table with one of the fields named Date_Time. The features are like 21-5-2016 14:47:00 (field type is string).
I want to extract the dates and add them to a new field with the Conversion function "to_date" in the Field Calculator.

I tried but the conversion has no result. The new field stays empty.
Whether I giving the new field the type "string", "date", etc. and changing the Date_Time field type into date as well (with refractor).
Nothing works.
Can anyone help?


texts: How to infer a dataset's projection when its unknown (and possibly custom)? Some features have a lat/long that I can check against

texts:
I have a dataset with an unknown and possibly custom projection. However, some of the features have lat/long coordinates in the attribute table. How might I figure out the projection and coordinate system of this data based on this info?

What I've tried:

Asking the folks who provided me with the data--so far this isn't helpful.
Assuming a datum and projecting the data in ArcMap to common systems, then checking if it looks right.
Georeferencing an image of the data based on known coordinates. Looks good, but isn't precise enough.


texts: Is there a GIS to locate exact opposite locations on earth?

texts: I was wandering if there was a GIS that offers to locate the exact opposite location of key locations (countries, even cities ?) on earth ?


texts: Requirements to create ESRI Grid from CF-compliant NetCDF?

texts:
I found a lot of information how to create an ESRI grid from NetCDF without ever finding a list of requirements for the NetCDF format.
CF compliant does not seem to be enough for ESRI sometimes.
What I want to do is to produce CF compliant NetCDF that loads directly into ESRi's ArcGIS without any further processing. I will have 2 and 3 dimensional data plus time as (unlimited) dimension.
Since I do not have access to ArcGIS myself I am looking for a kind of spec for the NetCDF.


texts: Identify Unknown Coordinate System (not Georeferenced)

texts:
I got coordinates to old survey data in an Excel Spreadsheet.  The coordinate system is unknown.   I enter the values into a proprietary system to display them in module using Google Earth. I tried to guess the coordinate systems, since I know roughly the physical addresses  of the locations in question, but none of the standard systems plot even remotely accurately. (NAD 83 UTM 11N, State Plane AZ Central/ NAD ft, NAD27 UTM 11 N, etc....)

Sadly, I don't have ArcGIS, and I am stumped.  Can anyone help, or recommend some means of ferreting out an answer?  Most online forums seem to discuss only shape files.

Here are some examples:

Address: 500 W Laguna St, Tucson AZ  Lat: 459579  Long: 9894182
Address: 250 E Roger Rd, Tuscon AZ Lat: 466476 Long: 993325


texts: Why does GeoServer WMS not work in OpenLayers?

texts:
I am really new to Web GIS and currently I am trying to develop a web map using FOSS software. This is my code of OpenLayers and it is not working.

GeoServer URL

http://localhost:8080/geoserver/sac/wms?service=WMS&version=1.1.0&request=GetMap&layers=sac:Luse&styles=&bbox=105097.8879663402,181965.81598811893,107146.57910105384,183739.10929816443&width=512&height=443&srs=EPSG:5235&format=application/openlayers&

OpenLayers code:

<script type='text/javascript' src='OpenLayers.js'>
</script><script type='text/javascript'>
var map; function init()
{
   map = new OpenLayers.Map('map_element', {});
   var wms = new OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://localhost:8080/geoserver/sac/wms',
   {layers: 'sac:Luse'},
   {}
);
map.addLayer(wms);
if(!map.getCenter()){ map.zoomToMaxExtent(); } }
</script>
</head>
<body onload='init();'>
    <div id='map_element' style='width: 500px; height: 500px;'>
</div>
</body>
</html>

What is the problem?


texts:
I'm automating some sde geodatabase management.  In the ReconcileVersions_management function there is an option create a log file of the result ("reconcileLog").  If the script runs five nights a week it will create 260 text files. In the script I already have a text file that I append a message to at each step of the script and each time the script runs. I would like to append the "reconcileLog" to the "log" file that I maintain.  Not sure how to do this?

# Create a text file for logging
log = open("C:\\Compress Script\\CompressLog.txt", "a")
log.write("***********************************************************\n")

# Later in the script
reconcileLog = r"C:\Compress Script\ReconcileLog" + str(datetime.date.today()) + ".txt"
arcpy.ReconcileVersions_management(defaultWorkspace,
                                   "ALL_VERSIONS",
                                   "sde.DEFAULT",
                                   versionList,
                                   "LOCK_ACQUIRED",
                                   "ABORT_CONFLICTS",
                                   "BY_OBJECT",
                                   "FAVOR_EDIT_VERSION",
                                   "POST",
                                   "KEEP_VERSION",
                                   reconcileLog)
log.write(str(time.asctime()) + ": Edit versions reconciled and posted to DEFAULT.\n")


texts: How to show labels for dynamicLayerInfo in ArcGISDynamicMapServiceLayer

texts:
Does anyone know how to show labels for dynamic layers
I have used below code for show dynamic layers which is working fine and now I have to display labels for that dynamic layers.
    var dataSource = new esri.layers.TableDataSource();
    var layerSource = new esri.layers.LayerDataSource();
    var dynamicLayerInfo = new esri.layers.DynamicLayerInfo();
    var drawingOptions = new esri.layers.LayerDrawingOptions();
    var layerinfoTemplate = new www.InfoTemplate();
    var options = [];
    dataSource.workspaceId = "..."
    dataSource.dataSourceName = "..."; //shapefile name
    layerSource.dataSource = dataSource;
    dynamicLayerInfo.id = i;
    dynamicLayerInfo.name = "...";
    dynamicLayerInfo.source = layerSource;

    dynamicLayerInfos.push(dynamicLayerInfo);
    var labelClass = new w.LabelClass({
        useCodedValues: false,
        labelExpression: "Name: {CITY_NAME} Area: {CITY_AREA}",
        labelPlacement: 'esriServerLinePlacementAboveAfter',
        symbol: new w.TextSymbol({
                      color: new w.Color("#000000")
                })
        });
        drawingOptions.renderer = new SimpleRenderer(new SimpleLineSymbol(new
 SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 0]), 2));
        drawingOptions.showLabels = true;
        options[0] = drawingOptions;
        EsriDynamicLayer.setDynamicLayerInfos(dynamicLayerInfos, true);
        EsriDynamicLayer.setLayerDrawingOptions(options);


texts: How to automate performing analysis (intersection) between objects within different feature classes, for large number of objects?

texts: I have two tables of roads - the same roads, from different sources, and am trying to compare how similar their positions are. I'm wanting to buffer each road in one of the feature classes and calculate the % overlap between it and the corresponding road from the other feature class. Could obviously do this manually but since there are hundreds of roads would rather use Python. The thing is, I'm new to it. Any help on how to automate using the intersect tool between objects from different tables would be very welcome. The objects will have an attribute in common.


texts:
With R I am looking to smooth my Polygon:
inter2.csv

code:

inter1 <- read.table("c:/inter2.csv", header=TRUE)

# add a category (required for later rasterizing/polygonizing)
inter1 <- cbind(inter1, cat = rep(1L, nrow(inter1)), stringsAsFactors = FALSE)

# convert to spatial points
coordinates(inter1) <- ~long + lat

# gridify your set of points
gridded(inter1) <- TRUE

# convert to raster
r <- raster(inter1)

# convert raster to polygons
sp <- rasterToPolygons(r, dissolve = T)
plot(sp)
# addition transformation to distinguish well the set of polygons
polys <- slot(sp@polygons[[1]], "Polygons")

require(Hmisc) # for Bezier curve
output <- SpatialPolygons(
  Srl = lapply(1:length(polys),
               function(x){
                 p <- polys[[x]]

                 #applying bezier curve for smoothing polygon edges
                 px <- slot(polys[[x]], "coords")[,1]
                 py <- slot(polys[[x]], "coords")[,2]
                 bz <- bezier(px, py)
                 slot(p, "coords") <- as.matrix(cbind(bz$x,bz$y))

                 # create Polygons object
                 poly <- Polygons(list(p), ID = x)
                 return(poly)
               }),
  proj4string = CRS("+init=epsg:4326")
)

# plot
plot(sp, border = "gray", lwd = 2) # polygonize result
plot(output, border = "red",  add = TRUE) # smoothed polygons

I get this result:

It's some days I look for the problem without success, can someone help me please?


texts: How to change text style in qgis2threejs?

texts: Is there any possibility to change text style for names of places in QGIS 2 three js plugin? That's my result: black font with white outline, while in layer style properties I have for this label just white font color.


texts: Zooming openlayers map to fit in selected features

texts:
In my openlayers based application, I need to trigger zoom when user selects features so that all the selected features fit within the map extent.

I make use of this code:

map.getView().fit([swLong, swLat, neLong, neLat], map.getSize());

(swLong, swLat) is the south-west corner and (neLong, neLat) is the north-east corner of bounding box containing the selected features. These are in degrees.

What I am not sure is whether I need to provide these in pixels or degrees is the correct way?


texts: Leader lines that only appear when labels is at a particular distance from point

texts:
Is it possible to build an expression (or set the style) so that it will not generate a leader line when a label is within x-distance of a feature, but will generate a leader line when a label is greater than x-distance from a feature?

Basic leader line code I am using:
make_line(make_point($X,$Y),make_point("X","Y"))


texts: I have a dataset containing a grid of geo-referenced points that have a corresponding value. I'd like to create geographical areas (polygons) at certain levels within the grid, basically combining all points of a given range (i.e. area1 >1 and <=10, area2 > 10 and <=15, etc.) with each area having its own polygons. The polygons may have holes and parts of one polygon may be within another polygon. What is the best way to go about doing this? Is there an algorithm available or perhaps a feature of a GIS tool that can do this? The best analogy would be a DEM an it's corresponding contours, but this is not a DEM.


texts: QGIS 3 crashes when QgsExtentGroupBox.setOriginalExtent() is called

texts:
Below is the relevant code. I am using QgsProjectionSelectionWidget to get the CRS.

    canvas_extent = self.canvas.extent()

    transformer = QgsCoordinateTransform(
        self.canvas.mapSettings().destinationCrs(),
        self.input_projection_cbo.crs(),
        QgsProject.instance()
    )

    transformer.setDestinationCrs(
        self.input_projection_cbo.crs()
    )
    transformed_extent = transformer.transform(canvas_extent)

    self.extent_box.setOriginalExtent(
        transformed_extent,
        QgsCoordinateReferenceSystem(
            self.input_projection_cbo.crs().authid()
        )
    )

    self.extent_box.setOutputCrs(
        QgsCoordinateReferenceSystem(
            self.input_projection_cbo.crs().authid()
        )
    )
    self.extent_box.setOutputExtentFromOriginal()
    self.extent_box.setCurrentExtent(
        transformed_extent,
        QgsCoordinateReferenceSystem(
            self.input_projection_cbo.crs().authid()
        )

    )

Below is the entire report.

h2. User Feedback
h2. Report Details
*Crash ID*: 8e827b9e58264385e7a945fbe0ac6df5b4daf9a5
*Stack Trace*

 QgsExtentGroupBox::setOriginalExtent :
PyInit__gui :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QMetaObject::activate :
QGroupBox::childEvent :
QGroupBox::mouseReleaseEvent :
QgsPresetSchemeColorRamp::clone :
QWidget::event :
QGroupBox::event :
QgsPresetSchemeColorRamp::clone :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

*QGIS Info*
QGIS Version: 3.2.1-Bonn
QGIS code revision: commit:1edf372fb8
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4

*System Info*
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17134


texts: QGIS "python3.exe: No module named gdal_merge"

texts:
I just would like to merge several raster of GeoTIFF but after the QGIS update from 3.3 to 3.4, even this simple tool can´t be used for the same raster anymore.

 GDAL command:python3 -m gdal_merge -separate -ot Float32 -of GTiff -o "F:/Data Outcomes/mergeTest3.tif" --optfile C:/Users/AppData/Local/Temp/processing_83de971f88c4406dbddd1acd440e9c00/5b473ea0219940439f0fb5c63b9ee370/mergeInputFiles.txt

GDAL command output: E:\QGIS3.4.2\bin\python3.exe: No module named gdal_merge
Execution completed in 3.12 seconds
Results:
{'OUTPUT': 'F:/Data '
'Outcomes/mergeTest3.tif'}

I already tried to reinstall QGIS couple of times and also on different computers (Windows10), but it still doesn´t work. Does anyone have the same issue or perhaps know how to solve the issue?


texts: How to obtain Census block data in SQL format?

texts:
I am trying to create a web app where users can query a certain type of data that is offered by the Government. Unfortunately, the government prefers "Census Tract/Blocks" as opposed to Zip codes (it makes sense, but still unfortunate)

There are approximately 11 million Census blocks, 73k Census tracts versus 54,000 Zipcodes (these are rough numbers) I was thinking I could simply find a database with census blocks and tracts, and do the mapping myself.

So I found the Census block database, it is a shapefile.

However...I am using a Mac, so I cannot use ArcGIS to view the TIGER shapefiles offered by census.gov (https://www.census.gov/geo/maps-data/data/tiger-geodatabases.html)

If I had ArcGIS, I was thinking I could be able to import the shapefiles and make sure it was the data I needed, but I can't.

I then found a tool called ogr2ogr, but it appears it prefers a database called PostGIS, or SQL Server.

I also keep trying to find maybe someone already went through this craziness, but am unsuccessful.

Given a proprietary dataformat - ERSI Shapefiles - are the only source offered by the Census, how should I go about translating this data to SQL somehow?

This would help me a lot because on my other dataset, there is a field called "FULLFIPSID", which is a FIPS code that the Census uses in it's geography references. Or maybe there is another way without having to use the shapefiles?


texts: How to intersect Box3Ds with PostGIS 2.3?

texts:
I am storing several axis aligned bounding box representing complex gemoetries as

BOX3D(POINTZ(x1,y1,z1), POINTZ(x2,y2,z2))

I need to perform queries to identify elements that intersects a given query BOX3D.

It seems that PostGIS allows using st_3Dintersects only with POINTZ, LINESTRING and TIN

How can I accomplish that?


texts: html file not loading google maps and current location

texts:
I have a html file that when I click on it, it should open in a browser but it does not load. The link of the html opens and loads the image. Below is the link:

http://cambridgeaviation.org/location/Intro_Direction.html


texts: Stack RasterDataset taking into account dates between images using R

texts:
I would like to stack a raster dataset taking into account the number of days between images. Sometimes the number of dates between observations are 8, 16 or 365 days.
Is there any function to do it automatically?
The code that I have right now is as follows:
setwd("C:\\NDVI_prueba")
rlist=list.files(pattern=".tif$", full.names=T)
rasters=stack(rlist)
rasters

I guess that this code does not count the separation between days and has the same interval for all the images?
The name of the files is NDVI.2000_01_01_NDVI.
Is it correct or should I give a special name to be able to determine the date in each image?


texts: How to save the result of an Arcade expression to the database?

texts:
What course of action would you recommend if I did want to store the results of an Arcade attribute expressions to a database?

For example, right now I have a layer which includes Leveraging Partner Direct Dollars and Leveraging Partner In-Kind Dollars.

I’m using an attribute expression to display the sum of these attributes as Total Leveraging Partner Investment.

Is it possible to somehow store the Total Leveraging Partner Investment in the database?

If this is not possible to do with Arcade, is there a better way to achieve the desired outcome of storing a sum of two attributes in another attribute in ArcGIS Online?


texts: gdal_rasterize multiple attributes to multiple bands

texts:
I have a shapefile consisting of polygon geometries, each row/geometry associated with multiple attributes. I want to generate a raster file with multiple bands, where each band will have a different burn in value using a different attribute.
I can successfully generate a single banded raster using the command below:
gdal_rasterize -l grid_polygon_attributes -a attribute_1 -tr x_res y_res -a_nodata -99.0 -te xmin xmax ymin ymax -ot Float32 -of GTiff "in.shp" "out.tif"

I could not manage to do it for multiple bands associated with multiple attributes [the following does not work]
gdal_rasterize -l grid_polygon_attributes -b 1 -b2 -a attribute_1 -a attribute_2 -tr x_res y_res -a_nodata -99.0 -te xmin xmax ymin ymax -ot Float32 -of GTiff "in.shp" "out.tif"

ALSO: It will be great if I can also do this in Python - I tried using osgeo.gdal.Rasterize() with no luck.


texts:
What are the main differences between these SDI, especially in the level of geospatial features and ease of integration with existing CMS?

Cartaro
Geonode
GeOrchestra
EasySDI

I wonder for the reasons why SDI software is not so popular?


texts: Importing Data from CSV without longitude and latitude but a location code

texts: I am new to QGIS. Above is the image of data I have. The .shp file in QGIS have that geographical department codes as well. I want to read the data from CSV and plot in map but don't know what to put in x-axis and y-axis. Below image have the result I want to get.


texts: ArcGIS Server 10.1 - GPU Processing Support

texts:
Does ArcGIS Server 10.1 or any of its extensions (e.g. 3D Analyst, Spatial Analyst) take advantage of GPU processing?

Dell have a new server, the R820, that has an option to include a GPU. Hence the interest.


texts: When I move a vector layer at the top of all the other layers this action doesn't translate on the map canvas. It still exists under other layers there. In the image below layer namned "my_12 (Ytskikt med markslag)" is second in the layer panel but it still appears below the two raster layers in the map canvas.


texts: ArcGIS field calculator: Calculating a new field using multiple fields with python

texts:
Basically, I have a large polygon data set that has soil data for an area and I want to assign numeric values to the data based on soil texture text values (e.g. SIL=4, CLY=7, ...). However, the soil texture is divided into three different columns:
1) TEXTURE1;
2) TEXTURE2; and,
3) TEXTURE3.
 Usually TEXTURE1 gives me the data I need to assign the numeric value in a new field, but in some cases the value for TEXTURE1 is listed as N/A, and I need to use the text from TEXTURE2 to assign the number. Is it possible to write a script where if the text from the TEXTURE1 field is NOT N/A return TEXTURE1, else return TEXTURE2?
The new field would be a text field.


texts: How to go about creating points at river confluences?

texts: Working in ArcGIS 10.4. I have a rivers dataset, and I want to create a point wherever two rivers meet (tributaries join with other rivers, etc.). I tried the Intersect tool, but I think that tool requires more than one input dataset. I have Network Analyst, if that helps.


texts: How can I create Multiple joins over 5 tables in ArcGIS?

texts:
I have a relational database which uses the following relational schema to create a query:

Parcel.IsBooked is joined to Bookinglocation.ID

Bookinglocation.IsPartOf is joined to Bookingpage.id

Bookingpage.id is joined to Namenumber.isPartOf

Namenumber.called is joined to Person.id

This is the relationship path from the shapefile "parcel" to the table "Person" which contains the name of the parcel owner.

My question is....How is it possible with ArcGIS to select parcels from the shapefile and see the selection in the "Person" table? I seem to only be able to join a shp to a table...but not a table to a table. I need to actually remove names out of the "person" table which fulfill a certain criteria...so exporting tables joined to shapefiles won´t do the job. Is this possible with ArcGIS?


texts: Change colour shapefile based on its own field in Google Earth Engine

texts:
I have Google Earth Engine scripts with shapefile with 4 different colour code in each record.

The Symbology Colour should be display like picture above,
With "No" field in the shapefile as numeric code for different colour.
'No' = 1 = Blue (00aaff)
'No' = 2 = Red (ff0000)
'No' = 3 = Green (55ff00)
'No' = 4 = Yellow (ffff00)
var Shapefile = ee.FeatureCollection("users/k2yulianto/Shapefile/Symbology");

var empty = ee.Image().byte();

var palette = ['00aaff', 'ff0000', '55ff00', 'ffff00'];
// The shapefile Symbology's colour should be follow in it's own 'No" field record:
// 'No' = 1 = Blue (00aaff)
// 'No' = 2 = Red (ff0000)
// 'No' = 3 = Green (55ff00)
// 'No' = 4 = Yellow (ffff00)

var filledAndOutlines = empty.paint(Shapefile, 'No').paint(Shapefile, 0, 2);

Map.addLayer(filledAndOutlines, {palette: ['000000'].concat(palette), max: 14}, 'SHP with edges and fills');

Map.addLayer(Shapefile, {}, 'default display');
Map.setCenter (101.4916, 0.4808, 10);

But My problem , the scripts just only show all become yellow.
Here is my GEE scripts
https://code.earthengine.google.com/028f6726a75ac54d92e28fc3daa8c47b
How can I solve this?


texts: Updating a layer's bounding box in GeoServer after WFS-T insert

texts: I'm creating a data store in GeoServer from an OpenLayers DrawFeature control, using WFS-T to save the geometry into GeoServer. This works great, except the data store's bounding box doesn't get set in GeoServer. However, if you create a data store from a shapefile, the bounding box gets automatically set. I know you can go into the GeoServer admin page and tell it to calculate the bounding box, but I need a way to do it programmatically.


texts: generate spatial geom from lat lon points for map in PostGIS

texts:
I am interested in a PostGIS implementation of the R-based soulution from a previous question, How can I convert data in the form of lat, lon, value into a raster file using R?

Currently, I am hoping to generate tiles for a map in CartoDB from a table with columns "lat, lon, value".

I have found some hints on the CartoDB google group, which boil down to "insert polygonized raster/values into a valid empty polygon table in CartoDB"

But the examples include a deprecated function (ST_MapAlgebraExpr) and a suite of nested ST_* functions, including st_transform(st_setsrid(st_multi(st_makevalid((.... Being new to PostGIS, this is fairly difficult to understand and apply, and the help of the individual functions requires some basic understanding.

I am new to PostGIS so please pardon that I haven't gotten very far, and the scope of new data types and transformations are daunting. If I can get my toe in here, I promise to show improvement before my next post :)


texts: Row.Value returns rounded SHAPE.area and SHAPE.len values?

texts:
I have created a VB.Net Add-In, and am using IRow to get the value of fields in tables in ArcMap to use in a query.

But I am encountering a problem when getting the values of the SHAPE.area and SHAPE.len fields. The values returned using IRow.Value seem to be rounded from the actual value of the field (the value that would be used to select using the table's Select by Attributes).

So, for example, I can select a polygon using Select by Attributes and the query:

SHAPE.area =  50.775141666668361

But the following code doesn't work to produce a value to use to successfully query:

Dim value As New Double

value = pRow.Value(pRow.Fields.FindField("SHAPE.area"))

And it doesn't work because value = 50.7751416666684

I tried it with value as a Decimal and value as a String. I also wrote the Row.Value directly to notepad without first storing it in a variable, and in all cases the number returned is rounded to two decimals fewer than the actual value.

Is there a way to get the actual, non-rounded, value?

I can use a workaround if I need to, but I'd rather be able to get the actual value of the area and length fields.


texts: Enabling "Snapping" in QGIS while drawing polygons?

texts:
I tried to draw polygons in QGIS 1.7.0 and somehow I can't find or failed to find the "Snapping" option.

I'm used to ArcGIS 10.0 where you have some snapping options, like placing points of polygons at points/edges/shapes/etc., see image below.

Is this also possible with QGIS? And if yes, how to activate it?

I've tried to figure out all the editing options, but couldn't find any snapping or similar.


texts: In ArcMap, how to highlight the overlapping part when it is superimposed in the same layer？

texts: In ArcMap, I want to know how to make this effect without splitting the data in the same layer?


texts: PostgreSQL Queries, how can I handle logic and complex mathematical functions to update a column

texts:
I have a Postgres Table of u and v wind velocity components as follows:

ugrid  vgrid
-2.7   -6
-2     -6.3
-1.7   -6.4

I need to calculate the speed and direction as per the JScript Psuedocode below and store the result in two new new columns in the table:

uu = U Value
vv = V Value

if vv = 0 and uu = 0 then everything is zero
if vv = 0 and uu > 0 dd = 270, ff = uu
if uu < 0 dd = 90, ff = -uu
if vv < 0 dd=Math.atan(uu/vv)*180/Math.PI
else
dd=Math.atan(uu/vv)*180/Math.PI+180;

if dd <0 dd=dd+360
ff = Math.sqrt(uu*uu+vv*vv)
returns dd as wind direction in decimal degrees
returns ff as wind speed in m/s

I have never worked with mathematical functions in Postgres.

What is the best approach, can a Query handle this type of logic, or should I process the data in some other system first?

If a query is possible, how would I construct it?


texts: The term for determining the pixels of a raster image

texts:
I am looking for an english well-established term for determining:

1) invalid/nodata raster image pixels (№ 1 - black ones on the image below) and

2) valid/data raster image pixels (№ 2 - other ones on the image below)

In example:

1 - is "nodata area"

2 - is "raster's body".


texts: Any reason NOT to convert to a single projection when loading GIS data?

texts:
I have been given the task of:

Loading a list of properties with lat/long coordinates into a SQL Server 2008 database.
Loading points and areas (polygons) of interest from a variety of shapefiles from various local, state, and national sources.
Allowing the user to query the areas of interest within certain distances of a given property.
Allow another programmer to extract both the property and points/areas of interest to KML files for visualization in Google Earth.

My problem is that each source of shapefiles uses their own projection and SQL Server cannot perform comparisons on geographical data using different projections, nor can it convert from one projection to another.

I have determined that, using the pyproj library, I am able to convert a point from a given projection to lat / long.  I tested this by converting a point location known to be in Pinellas Park, Florida and then displaying the corresponding lat / long in Google maps — and the displayed point is in Pinellas Park (although Google's estimate of the building number is off a little; 5551 XYZ Ave instead of 5541).

My question (at last): is it a safe and reasonable strategy to convert all the points in the incoming shapefiles to lat / long and store them that way, using the SQL Server standard SRID of 4326?  Is there any danger of loss of precision or shifting in the conversion?  If the converted lat / long polygons are displayed in Google Earth will they be identical to a display produced from the original shape files?


texts: Parse WKT and zoom to polygon extent using openlayers

texts:
I'm having trouble getting Openlayers to zoom to a polygon extent using "map.zoomToExtent(vector.getDataExtent());" The object parsed as WKT loads and displays fine but I want to zoom to the polygon extent. I have a bunch of these to do, so manually setting it is not an option.

This is an adaptation of the standard WKT parsing example.

<!DOCTYPE html>

<title>WKT example</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.6.0/ol.css" type="text/css">


texts: accessing mapinfo data without using mapinfo api

texts:
I need to be able to access various mapinfo layers but without using the mapinfo api.

I have found that I can convert the mapinfo layers to an access database to get the attribution and I can use sharpMap to load and view the layer.

The problem is now I'm not sure how to get a location shown in sharpmap and then query the objects to get to the attributes, or if its even possible.

It seems that mapinfo might keep this kind of link internaly perhaps


texts: Multiple Country Codes? - World Geocoding Service (ArcGIS REST API)

texts:
Using single field geocoding, (ArcGIS REST API) I am having an issue with the World Geocoding Service when it comes to getting results that include both USA and US territories, like Puerto Rico for example.

Code:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?find=puerto rico&SingleLine=puerto rico&sourceCountry=USA&f=json&outFields=Loc_name&callback=esriDojo.io.script.jsonp_esriDojoIoScript10._jsonpCallback

In the geocode request string above, I am limiting results to USA only ('sourceCountry=USA'), however I get a result that doesn't include Puerto Rico (the commonwealth) - only Puerto Rico, Texas. This is the same if I change my search parameter to "San Juan" - I would like to get San Juan, PR as a result, along with the rest of the 'San Juan' location in CONUS.

Esri Help states that you can limit the 'sourceCountry' parameter to "USA" for only results in the US, but problematically this means CONUS, not Puerto Rico or other "US" territories like Virgin islands, Mariana Islands, etc.

Esri also has a specific country code geocode limiter for Puerto Rico (PRI)  however I cannot find a way to combine this with (USA) into one request which would limit return results to only USA, PRI together. It seems to allow one country code per request, currently.

Since this is a web map focused solely on USA and territories, with full extent set to CONUS (including PR and Hawaii), it doesn't make sense for me to remove the 'sourceCounty' parameter altogether. We don't want international results to come up (and they will) since the results are typically ordered by total population.

Can anyone recommend a different approach (or updated geocode string) to limiting the results to only USA and Puerto Rico? Is there a way to combine multiple 'sourceCountry" parameters to account for USA & PRI into one geocode request?

Thanks in advance


texts: How can a MXD point to a path that does not exist?

texts:
We work on ArcMap 10.6, and have MXDs using database connections (.sde files) that point to the C:\ of a user that no longer exists (e.g. C:\users\alpha\test.sde) and certainly, that path doesn’t exist on the PC from which the MXD is being loaded, but the MXD loads without error.
We were playing with connection neutral SD files for publishing, with the original MXD pointing to our development database. However, when we publish to our Pre-Production environment, it is still pointing to the Development environment despite no data store existing on the server for that connection. I would expect that publishing to fail or throw an error but it worked fine, how is this possible?


texts: Editing custom ISO 19139 metadata template in ArcGIS Desktop?

texts:
I created an ISO 19139 metadata template. Before I imported it to test it I noticed I couldn't edit it at all. On the top of the editor in ArcCatalog on the description tab there is usually a choice to print, edit upgrade or import the metadata.

On the template I created there is only a choice to print or import the metadata.

I also tried importing it and nothing changed.


texts:
I am new to GDAL in Python (and Python in general), so as a way to begin learning, I am trying to perform basic functions such as getting extents from a single raster and printing them out.

However, I'm having some issues opening a file using gdal.Open.  I believe I have the syntax correct, and Visual Studio Code does not throw any errors, but I am not able to print out the desired information.

import os
from osgeo import gdal
file = "tile1.tif"
ds = gdal.Open(file)
ulx, xres, xskew, uly, yskew, yres = ds.GetGeoTransform()
lrx = ulx + (ds.RasterXSize * xres)
lry = uly + (ds.RasterYSize * yres)
print (lrx ',' lry)


texts: Writing to file geodatabase table using ArcPy cursor?

texts:
I wanted to copy a specific row of a table to another new table. So what I did was,

copy the data of the row to a particular Array called c[].
Write them to a file Geodatabase table called Dead_T

I have completed the 1st step. Now I want to do the 2nd step. I have tried the following code for step 2, but it is not working. Can anyone tell me the mistake that I have made here?
(Here filedname is one of the names of columns available in the table Dead_T)

Dead_T='C:\Users\Shanaka\Desktop\TL _HAndling\cad\Cad_Data.gdb\DD_IF'
with arcpy.da.UpdateCursor(Dead_T, "filedname") as cursor1:
    for row1 in cursor1:
        row1[0] = c[0]
        arcpy.AddMessage ("done")

        cursor1.updateRow(row1)


texts: Calculate the proportion of points within a polygon over a threshold value

texts: I have a set of point observations and a county shapefile for CA.  I would like to calculate the proportion of points within each county that are above different threshold values, giving me a result of one value for each county.  I can do this in R, but can't seem to figure out how to do it in ArcGIS (10.3).


texts: Performing batch Join Field in ModelBuilder?

texts:
I have a list of 250 feature classes (X1, X2 X3, ...) which all have an individual field that I want to join to another feature class Y. The join can be established through a common field that are both present in Xx and Y. Individually I can use the 'join field' tool to join each Xx field to the Y feature class but this will take me a long time. Is there a way I can batch 'join field' where I use wildcards within the join field settings? Preferably I would like to do this in ModelBuilder, unless someone knows a working python script.

Within ModelBuilder I have tried to use the batch 'join field' tool and an iterator. This did not do the job as the list of values (Join field as list of parameters) did not recognize the joins.

I have attached a picture which might clarify my problem. The issue is that I cannot edit the input join Field column as it gets this list from a geodatabase through an iterator.


texts: Geoprocessing tool: different - KeyError 1006

texts:
I'm trying to use the "intersect" geoprocessing tool, to extract the surface of a layer (which I call "streams") that overlaps with another layer (a buffer of peoples). But I got this error "Algorithm Difference starting ... 1006 See log for more details - Key error 1006"
How can I solve this problem ?

I don't have any other information in the log


texts: qgis2web clustered point features issues

texts:
I try to make a cluster points layer map with a huge amount of points (i.e 300000) using qgis2web plugin. In QGIS I set my project layers with scale dependency accordingly to avoid performance redenring issues. Unfortunatley it's tooke 45 minutes after updating the previewto display the preview without displaying cluster points features.

Is there any workaround, or qgis2web plugin is limited to a maximum points features?


texts:
I want to create a map of India showing 30 districts that have the highest COVID-19 cases as of 31 December 2020 using QGIS. I marked the 30 districts and added the CSV file to this layer. I want to create a proportional symbol according to cumulative confirmed cases, but not with discrete values, but for specific ranges because the number of cumulative cases ranges from 55000 to 6 lakhs. I searched for the "Assistant' option in the 'size' section in the 'Properties' of the point. But in the input menu I am not able to give the source. It doesn't show anything for selection.So if I apply my changes, it is displaying graduated symbols not proportional symbol.
How can I solve this? Why does the input menu display nothing? I want to gave the column name of the confirmed cases in the csv file  in that section. But it shows nothing.

attribute table of csv file

layer panel screenshot

screenshot of csv file with header missing


texts: Optimizing pixel extraction from GeoTiff using Python

texts:
I am creating IDF Curves for work using python and 30-minute rainfall rate rasters. There are 24 rasters per day and about two decades worth of data. I basically input lat/lon coordinates and my python script grabs the pixel value from each raster throughout the period and stores it in a DataFrame to use for statistical analysis. This process currently takes about 5 hours to run per lat/lon coordinate with the majority of the time coming from opening the raster and extracting the pixel value. Are there any ways to optimize this process for speed? I am completely stuck and can't find if there is any speed efficiencies native to GDAL. I've submitted the function I use for extracting the pixel value. Please let me know if you have any questions or suggestions, thanks!

def extract_point_values_from_raster(raster_filepath, lat_lon_str):

    lat_lon = lat_lon_str.split(',')
    lat = float(lat_lon[0])
    lon = float(lat_lon[1])

    try:
        src_ds = gdal.Open(raster_filepath)
        gt = src_ds.GetGeoTransform()
        rb = src_ds.GetRasterBand(1)

        if (lat < gt[3] and lat > (gt[4] - gt[3]) and
            lon > gt[0] and lon < (gt[2] - gt[0])):

            px = int((lon-gt[0])/gt[1])
            py = int((lat-gt[3])/gt[5])

            intval = rb.ReadAsArray(px,py,1,1)

            if intval == None:
                raster_val = None
            else:
                raster_val = round(intval[0][0],2)

        del src_ds

    except:
        raster_val = None

    return(raster_val)


texts: HDF4 Raster File upside down (no CRS) QGIS

texts:
I have the following data: http://fizz.phys.dal.ca/~atmos/SURFACE_NO2_ANNUAL_HDF.zip which is provided by the Atmospheric Composition Analysis Group (alternativley you can go to the Website of the ACAG and find the link under "Annual ground-level NO2 mixing ratio ~9:30-11:30 overpass time, in [hdf] format."
The data is provided as .hdf files, which do not contain any information about the CRS. When I load them into QGIS 3.8 or higher (with ArcGIS the problem is the same), the maps are shown upside down. I have found related questions, where people do some work arounds using world files. However, I did not manage to properly do this for my specific problem here.
So the basic question is: can I somehow save the file in a standard CRS like WGS84 EPSG:4326 and put the rasters into the "right" projection?


texts: Unable to complete operation in Parks Finder?

texts:
So I've downloaded, setup, and configured the ParksFinder web application from ESRI. It took some tweaking and it's finally up and running. But I am having issues that need to be resolved before this site goes live.

I've reduced the Parks listing down to 5 parks in the database because I thought that might be part of a problem I am having.

Whenever I click on one of the Parks, I get the error message, "Unable to complete operation." The icons for Activities do not show up, the URL for the park is not shrunk down to a "More Info" link, and there is no way to add photos? I'm lost.

When I check Chrome's Javascript Console I get something like this...
0: "Error in querying feature attachments."
1: "Layer or Table with ID: 0 does not support Attachments."

I've checked the LocalGovernment DB and there are a Park__ATTACH and a Park__ATTACHREL tables.


texts: Why does a track point layer attribute table have no positional information?

texts:
I imported a track log in GPX format to QGIS. The track had two layers, the track points and the track, a smooth line joining the track points.

Why does the attribute table for the track points have no positional information in it?  It has info I can understand in the hdop and vdop columns and also the one for ele(vation) but there is no column in the attribute table to hold positional data.


texts:
I have around 4GB of tif raster layers (roughly 2000 individuals tifs) which I want to load into QGIS. Loading them without visualisation is not a problem but once QGIS starts rendering my PC locks down. Since I need this data for my atlas creation I believe it is indispensable to render them once.
For a future project my data amount would even double.

What solutions are there?


texts: How to maintain data types in QGIS when importing from PostGIS?

texts:
I have data stored in an AWS RDS PostgreSQL database with the PostGIS extension enabled. When I connect to the data from within QGIS (2.18.2) the data types are not preserved. For example a column of type 'bigint' (in PostgreSQL)

is converted to qlonglong int8 (in QGIS):

The problem arises when I export the data to another file format (e.g. GPKG). integer columns are saved as doubles. The data type should be integer 64 bit / 8 byte. How can I convert a postgis table with bigint to geopackage without converting the bigint to double? (preferably without extra steps)

PostgreSQL version:

PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit

PostGIS version:

POSTGIS="2.3.4 r16009" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.1.3, released 2017/20/01" LIBXML="2.9.1" LIBJSON="0.12" TOPOLOGY RASTER


texts: Include only selection of a layer in a QGIS aggregate formula in field calculator

texts:
The following collects the chainage along a road at the start of a segment.

aggregate(layer:='DSC_Roads_10m_Chainage.tab', aggregate:='max', expression:="distance",
          filter:= intersects(buffer($geometry,10,10), start_point(geometry(@parent))))

However since the source dataset has the chainage of all roads in the network, sometimes if the Chainage value along another road (B) is closer to the start of road A, it gets the value from B.

Note the label is RoadMntnc + the value of the expression (ie chainage at start point of segment).

In the example above both Jones and Syndicate should have a value of 0 as it's the start but it's getting a value from the connecting road instead.

Is it possible to have

aggregate(layer:='DSC_Roads_10m_Chainage.tab', group_by := 'RoadMntnc', aggregate:='max', expression:="distance",filter:= intersects(buffer($geometry,10,10), start_point(geometry(@parent))))

that's based on https://github.com/qgis/QGIS-Enhancement-Proposals/issues/59

Where A is the layer the field calculator is processing and B. is the dataset it's referring to?

I can't run an intersect without a buffer as the chainage point may not be on the start of a segment.

UPDATE based on Kazuhito's answer

The yellow road section should be Syndicate Rd 640 instead of 650 as it's closer.


texts: Is there a gallery of QGIS maps anywhere?

texts:
Specifically, I want to see the gorgeous map of Chugach State Park that you see when starting QGIS 2.4 "Chugiak". Is there a website out there where people share maps? I would like to share and see others' styles and ideas.

Thanks!


texts: QGIS scalebar shows circa half the distance of what I measure

texts:
I'm using QGIS3.16.13 and when I add the scale-bar from "view > Decorations > Scalebar" to my map I noticed that it shows the wrong distance. I'm not talking about the print-composer, just the usual QGIS-interface. The scalebar is less than half of what I measure:

I know for a fact that this measurement must be correct (and the scale-bar must be off) as I know my raster's pixel-size is 0.5 m. So when I zoom in, on a single pixel an re-measure, the miss-alignment maintains roughly the same ratio: the scale-bar is circa half of what I measure:

I found this question on a similar issue (but almost 10 years old). However, in contrast to the issue there, I use the same coordinate system & projection for my project, my raster-files and my shapefiles are all in (EPSG:32739 - WGS 84 / UTM zone 39S - Projected).
My measurement tool's settings are below. However, I think the issue is not a wrong measurment, but a wrong scale-bar, as the measurement for e.g. a pixle length is correct, regardless of zoom level:


texts: Selecting basins with discharge direction to East using ArcMap 10.3

texts:
I have watersheds shapefile created, some discharge their water to the east, others to the west.
Is there is a way to automatically select the ones that discharges to the East using ArcMap 10.3?


texts: Update sister table with vertices as rows (when SHAPE is updated)

texts:
I have an Oracle 18c table that has an SDO_GEOEMTRY column.
create table a_test_sdo_geom (id number, shape mdsys.sdo_geometry);

insert into a_test_sdo_geom (id, shape)
    values(1, sdo_util.from_wktgeometry (
               'MULTILINESTRING ((671834.096 4861699.7127, 671836.5099 4861701.9158), (671838.2206 4861700.7607, 671842.2311 4861703.3157))'));
insert into a_test_sdo_geom (id, shape)
    values(2, sdo_util.from_wktgeometry (
               'MULTILINESTRING ((671800.123 4861600.1234, 671800.1234 4861700.1234)))'));
commit;

And I have a sister table that stores the vertices from that table as rows:
create table a_test_vertices (id number, vertex_num number, x number, y number);

insert into a_test_vertices (
select
    a.id,
    v.id as vertex_num,
    v.x,
    v.y
from
    a_test_sdo_geom a
    ,table(sdo_util.getvertices(a.shape)) v
);
commit;

        ID VERTEX_NUM          X          Y
---------- ---------- ---------- ----------
         1          1 671834.096 4861699.71
         1          2 671836.510 4861701.92
         1          3 671838.221 4861700.76
         1          4 671842.231 4861703.32
         2          1 671800.123 4861600.12
         2          2 671800.123 4861700.12

Question:
Is there a way to automatically update the vertices table whenever the source table's SHAPE gets updated?

When a source row is created
When a source row is deleted
When the source SHAPE column is updated (but not when any of the other columns get updated)


texts: Using Flex what event is fired when loading the popup defined in my layer tag?

texts:
Here is my Config.xml
...snip...
    <layer label="Pop-up (turn on/off)" type="dynamic" visible="true"
        alpha="0.8"
        url="xxx.xxx.xxx">
        <sublayer id="0" popupconfig="popups/Parcels.xml"/>  -->

    </layer>
</operationallayers>

So, when I click a point on the map a popup appears. That popup displays information about a parcel that was clicked, provides a "zoom to" button.
What event fired to make that occur?  I'd like to heavily customize what occurs when I click the map.  Bonus points if you can verify which object is being used to render the popup
Parcels.xml
<?xml version="1.0" ?>
<configuration>
    <title></title>

       <description>
        <![CDATA[Account# {Strap}
Owner: {Name1}
Address: {Locn} {Locd} {Locs}

**2014 Values**
Just(Market)Value: ${Just}
Land Value: ${Land_Val}
Improvement Value: ${Improvemt}
Assessed Value: ${Assessed}

Homestead(x=yes): {Homestead}
Land Sq Ft: {Lsqft}
Total Building Area: {GrossArea}
Total Living Area: {Living}
Year Built: {Yrbl}

Additional Information
]]>
    </description>

    <fields>
        <field name="Strap"/>  Used in title, do not repeat in content

        <field name="Yrbl" alias="Year Built">
            <format usethousandsseparator="false"/>
        </field>

        <field name="Land_Val" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="Improvemt" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="Just" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="Assessed" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="Lsqft" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="GrossArea" percision = "2">
            <format usethousandsseparator="true"/>
        </field>
        <field name="Living" percision = "2">
            <format usethousandsseparator="true"/>
        </field>

        <field name="SALE_DATE">
            <format dateformat="shortDate"/>
        </field>
    </fields>

</configuration>


texts:
Can GeoServer be hosted in Azure?

I presume that it would be as a virtual machine, because it needs a JRE.


texts: QGIS: Edit elevation in DTM to get correct slope of a river

texts:
I am new to QGIS and just need it to do a hydrolocic analysis of an area of which
I later make a flow model with HEC-RAS 2D.

I made it according to this tutorial: https://www.youtube.com/watch?v=Ro-RRzMMw-c&t=1774s

Unfortunately there is a railway with lower terrain nearly at the end of my river which is misunderstood as the stream so I can't make the catchment area to the very end of the river.

How can I edit the elevation of the DTM to get the correct stream (or is there another way)?

My river "Kraimser Bach" with the wrong end of the stream. It would go along the railway to north direction and not into the bigger river:

I tried to chagne the z-value of the DTM along this shapefiles to get the correct stream but it didnt worked the way I tried it.

I tried to do it with rasterize from polygons but that didn't work.
(According to this: Modifying DEM elevation data in QGIS using a polygon)
I also tried it with the SAGA tool "Burn streams into dem" but therefore I would need the real slope and so it didn't worked as well.


texts: Making fields added to attribute table appear without closing/re-opening?

texts: I'm using ArcPy and am experiencing some troubles. I added some fields to an existing arc (coverage) but then do not appearing in attribute table. Only when i close arcgis and reopen the fields appear in attribute table.What may be happening?


texts: How to input attribute data quickly in ArcGIS?

texts:
In ArcMap I select a polygon (in edit mode) and press the number keys from 0 to 9 on the keyboard an appropriate value recorded in the attribute table of selected polygons in a specified field.

Is it possible to set hotkeys in ArcMap for this case?

I have a layer "Build" with the field "Level_final" (long integer). I editing process I input value from 0 to 9 and for the convenience and speed I need "hot keys" that would be implemented next step: when typed on the keyboard any keys from 0 to 9 the same value prescribed in the field "Level_final". I can do it in window with feature attributes, but it is slower. I have a tool that performs that function for MapInfo and it is made in the form of hot keys. But since I work more in the ArcMap and wont have such "hotkeys" in ArcMap

I know all about attribute window but, believe me, it is still slow when you need manual (without the automatic calculated) input data from 0 to 9 to 10,000 polygons per day! I wrote that for MapInfo exists this functionality as a hotkeys and it works very quickly and efficiently! So I want to realize this functionality for ArcMap!


texts: Rewrite QGIS project by standalone PyQGIS

texts:
I have a QGIS project with layers were imported from cad and I am trying to use standalone pyqgis to rewrite this project and a new csv layer to it. But when I try to rewrite the project I get all layer show up in layer browser like this:

but nothing show up in map browser.

Here is my code. Is there anyone please help me out with this?

import sys
import os
sys.path.extend([r'C:\OSGeo4W64\apps\qgis\python',r'C:\OSGeo4W64\apps\Python37\lib\site-packages'])
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = r'C:\OSGeo4W64\apps\Qt5\plugins'
os.environ['PATH'] += r';C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\Qt5\bin'

sys.path.append(r'C:\OSGeo4W64\apps\qgis\python')
sys.path.append(r'C:\OSGeo4W64\apps\qgis\python\plugins')
sys.path.append(r'C:\OSGeo4W64\apps\qgis\python\plugins\processing')

from qgis.core import *
from qgis.gui import *
from qgis.utils import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtXml import *
def read_project():
    QgsApplication.setPrefixPath(r'C:\OSGeo4W64\apps\qgis', True)
    qgs=QgsApplication([], False)
    QgsApplication.initQgis()
    project=QgsProject.instance()
    project.read(r'D:\NTOU\REALTIMEMODEL\COMBINEDMETHOD\test_1.qgz')
    #print(project.fileName())
    project.write(r'D:\NTOU\REALTIMEMODEL\COMBINEDMETHOD\test_4.qgz')
    layers=QgsProject.instance().mapLayers()
    print(layers)
    QgsApplication.exitQgis()
read_project()


texts: Continuous symbology without merging Features?

texts:
I have a feature class with a polygon for each state. In the table there is a field attributed for specific groupings. I plan to symbolize by group.
Here's my question:
Can I make the symbology appear as if the states are merged by group without actually merging the several states into one?
The first image below shows how I would like the layer to look. Notice the continuous outline around several states. The image below that is how it looks now.


texts: Sum Lengths in arcpy.CalculateField_management()

texts:
I am trying to total the lengths of line segments. I know you can see this by right clicking field name and selecting summarize.  How do I pass this value to a field via python.

Here is what I have tried.

expression = "sum(float(!SHAPE.length!))"

arcpy.CalculateField_management(in_table, field_name, expression, "PYTHON_9.3")

The error I receive tells me that the 'float object is not iterable'. Which tells me maybe I should be using a search cursor?

I have also tried this:

    expression = "getSum(float(!SHAPE.length!))"
    codeblock =  """def getSum(length):
        b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'length'))
        return b """
    arcpy.CalculateField_management(in_table, field_name, expression,
        "PYTHON_9.3", codeblock)

But I get global fc not defined.  How do I pass fc to codeblock.

What are my best options for performing this simple task?

--

Update: I found a solution using geometry objects.  Reference here.

geometries = arcpy.CopyFeatures_management(fc, arcpy.Geometry())

# Walk through each geometry, totaling the length
#
length = sum([g.length for g in geometries])

# Execute CalculateField
arcpy.CalculateField_management(in_table, field_name, length, "PYTHON_9.3")


texts:
We've a regular (daily/weekly) provincial mapping process that uses .dbf files created with SAS (software like R, SPSS). An ArcMap document .mxd file (relative path) has map layers (crops) joined to the .dbf file (with columns for different crop yields by township - to get updated township-level crop yields). A Python code (ArcPy Mapping) exports selected crop layers as PDF maps (template with specific formatting, labeling and symbology).

The .atx file created by ArcGIS isn't updating. Is it important that the .atx file to be updated as well? I'm not fully sure if the .dbf file is correctly updating the map. Removing the layer joins and rejoin with the updated .dbf file messes-up the styling and takes lot of time to get the correct styling... Wondering if this is the best practice for regular automated mapping, or please suggest.


texts: Change the color of a feature with PyQGIS?

texts:
I want to iterate through a field and based on the attributes, assign a color to the feature. I can find how to change colors of a layer, but not for a single feature. Code below.

from PyQt5.QtGui import *
from qgis.core import *
import os

path = r"path"

layer = QgsVectorLayer(path, os.path.basename(path), "ogr")
layer.startEditing()

features = layer.getFeatures()

for f in features:

    color = f.attributes()[17]

    if color == 53790:
        iface.mapCanvas().setSelectionColor(color_rgb(030, 210, 000))

    else:
        iface.mapCanvas().setSelectionColor(color_rgb(230,155,240)))

layer.updateFields()


texts: Orientation of a texture image in Cesium?

texts:
Context
I'm trying to apply a texture to an entity in CesiumJS and I cannot figure out how the texture is applied, especially regarding it's orientation relative to the camera view point.
Here are two result examples of a texture image applied to an entity that I have constructed from a Cesium.GeoJsonDataSource.
The camera position and 3D orientation is roughly the same in both cases.
The only difference is in the shape of the polygon.
On the left image the texture is applied on this shape:
  [ 10.746038315853207, 48.314905418639555, 500 ],
  [ 10.747038310965864, 48.315905422444722, 500 ],
  [ 10.747500009924019, 48.315700009648104, 550 ],
  [ 10.746500009923748, 48.314700009648320, 550 ],
  [ 10.746038315853207, 48.314905418639555, 500 ]

and on the right image the texture is applied on this shape (the two lower points in altitude become the two higher and vice-versa):
  [ 10.746038315853207, 48.314905418639555, 550 ],
  [ 10.747038310965864, 48.315905422444722, 550 ],
  [ 10.747500009924019, 48.315700009648104, 500 ],
  [ 10.746500009923748, 48.314700009648320, 500 ],
  [ 10.746038315853207, 48.314905418639555, 550 ]

Notice that only the altitudes are swapped (lower values became higher and vice-versa, for each node, which keep their (lon,lat) values the same.)

The texture is applied as this in both cases:
entity.polygon.material = new Cesium.ImageMaterialProperty({
  image: 'Cesium3DTiles.jpg',
  alpha: 0.5
});

Question
I wonder what exactly defines the orientation of a texture image applied onto an entity in Cesium?
And more importantly, how can I display the texture image in a way which always let the text readable, relative to the (fixed) camera viewpoint orientation?


texts: How to get a smooth transition between startpoint and endpoint of a line in QGIS?

texts: I have a layer with a few lines. They look very smooth in general, but there is a sharp edge at the start/endpoint of the line. Hot to eliminate that and get the blue dotted result line there?


texts: What date was a table loaded into PostGIS

texts:
Is it possible to find out the date a table was loaded into a PostGIS schema using PgAdmin3?

The tables are usually supplied from varying external sources.


texts: Where can I find state borders for Germany?

texts: I'm looking for free state border layers for Germany. Are there any free sources for such data?


texts: How can I set map extent in arcgis silverlight api?

texts:
Simple question but I don't know the answer. I want to set my map extent such that users see the map only in map extent and they don't allow to see greater extent. How can I set the extent map?

Thanks in advance


texts: Accessing certain column of attribute table of shapefile and renaming it using GeoPandas?

texts:
Currently, I am working on converting some R code into python for someone. This person is taking the shapefile and removing all columns except for a select few and renaming them:

ec <- readOGR(".", file) #read a file #identify column
ec.dt<-data.table::as.data.table(ec) #check to see
ec<-ec[,c(5,7,4)] #get the desired columns
names(ec@data)[1] <- "ecs"
names(ec@data)[2] <- "ecd"
names(ec@data)[3] <- "elevation"

and below is my attempt at getting converting the code using geopandas with python:

ec = gpd.read_file(x) # ec 0 <- readOGR(".", file)

for i in range(1, ec.length()): # I'm using 1 here so I don't get the title column out
if (i != 4 | i != 5 | i != 7):
    ec.drop([ec[i]], axis = 1)

#getting the columns of the ec shapefiles and trying to rename them
ec = ec.rename(columns = {ec[1] : 'ecs'}).set_geometry('ecs')
ec = ec.rename(columns = ({ec[2] : 'ecd'}).set_geometry('ecd')
ec = ec.rename(columns = ({ec[3] : 'elevation'}).set_geometry('elevation')

I know I am misusing the rename function, but the main thing I'm concerned about is how I access columns, and How I remove other columns from the attribute table of the shapefile.


texts: Slow connecting to Oracle Spatial database from QGIS client?

texts:
I am having trouble connecting to an Oracle Spatial data with QGIS client. I use QGIS Version 2.2 (Valmiera) to connect to a database schema in Oracle Spatial.
I asked our DBA access to our database stored in Oracle Spatial. He granted me some privileges on some tables to perform Select statements. However, once I set my access I experienced difficulties with slow connection to the Oracle Spatial database. To connect to the schema tables, the connection can last 5-8 minutes. The geometric tables to which I connect have more than 3600 polygons.

Could you confirm me if this is due to a configuration problem or a bad customer optimization QGIS Oracle Spatial.


texts: How to transform the Lambert conformal conic projection to latitude/longitude coordinates (WGS84)?

texts:
I need to convert Lambert conformal conic projection to lat/long coordinates. My coordinate in Lambert is like this: (7678236.84856942, 1280719.40571689) and I expect to have a coordinate like Google numbers (something near to this: 45.4330538,-75.722731 for those numbers).
This page explains "Lambert conformal conic" which used with more details: https://www12.statcan.gc.ca/census-recensement/2016/ref/dict/geo016-eng.cfm
On the Wikipedia page of LCC there is a transformation formula but I don't know what should be my parameters.


texts: Removing 0 values when labelling an integer field

texts:
I am trying to do a simple labelling exercise however I am a bit stuck on how to remove unwanted '0' values.  I have three fields which I would like to display in a stacked label i.e. on three lines.  However the third field has a number of 0 values which I would like to disappear - i.e. instead of having:
   Field One
   Field Two
   0
I would like to have:
   Field One
   Field Two
   Blank

Any ideas welcomed - as you will guess I am fairly new at this so all help appreciated.


texts: How to set the spatial reference to a OGR layer using the Python API?

texts:
I want to create new a Ogr Layer using the Datasource.GetLayer() method:

driver = ogr.Open(input_file).GetDriver()
datasource = driver.Open(input_file, 0)
input_layer = datasource.GetLayer()

If the input datasource does not have a spatial reference (as usually i.e. by GeoJson data) the new layer has SRS = 4326.
If I write the data to a new Postgis table, the table has 4326 as geometry srid:

output_data_source.CopyLayer(input_layer,
                                 table_name,
                                 ['OVERWRITE=YES', 'GEOMETRY_NAME=geom', 'DIM=2', 'FID=id', 'PG_USE_COPY=YES'])

How can I set the layer SRS? Something like:

input_layer.SetSrs(new_srs)

but the API does not offer a such method: (http://gdal.org/python/osgeo.ogr.Layer-class.html).
The command line tool ogr2ogr offers for this purpose the parameters s_srs and t_srs. I.e:

ogr2ogr -t_srs 'EPSG:32632' -f "PostgreSQL" PG:"dbname=test host=localhost" input.geojson


texts: QGIS 2.18 : Choosing path of file for Python init function

texts:
I'm using a custom feature form for QGIS 2.18 (custom .ui file + custom Form.py file containing the Python init function used by the form). I would like to be able to put the .ui file and the Form.py file anywhere I want because the final form will be used by several people and thus should be located in a shared folder, not a user-specific folder. I have been able to do that easily for the .ui, but QGIS is unable to find the Form.py unless I put it in QGIS 2.18 bin folder.

How can I tell QGIS to look for the Form.py in another folder than bin? Here's an abstract from the corresponding XML file:

<editform>C://My_path/mycustom.ui</editform> *<!--This works fine-->*
<editforminit>mycustomForm.mycustomfunction</editforminit>
<editforminitcodesource>1</editforminitcodesource>
<editforminitfilepath>C://My_path/mycustomForm.py</editforminitfilepath> *<!--This does not seem to work: QGIS keeps ignoring the path I provide here-->*
<editforminitcode></editforminitcode>
<featformsuppress>0</featformsuppress>
<annotationform>.</annotationform>
<editorlayout>uifilelayout</editorlayout>


texts: Line segment connectivity analysis in FME

texts:
I have a set of line segments, all of them snapped at the endpoints:

As seen in the above image, the line segments appear in groups (4 in this example).

Question:
I would like to determine which line segments are connected to each other and assign an ID (in this example the values 1, 2, 3 or 4) to each line segment describing which group it belongs to. How can I do this in FME?


texts: Batch converting KMLs to shapefiles in PyQGIS?

texts:
I have a folder full of KML files and I want to create a .shp, .shx, .prj and .dbf files from these KMLs.

How can I accomplish this?

Below is the code that I am working on:

enter code here
import os , glob , qgis

path = r"\KML DUMP"

Location = r"\shapefile"

files = glob.iglob(os.path.join(path,"*.KML"))
num=1

for file in files:
    if os.path.isfile(file):
        layer = QgsVectorLayer(path + file, file, "ogr")

        writer = QgsVectorFileWriter.writeAsVectorFormat(layer, os.path.join(Location,'shape'+str(num)+'.shp'), "utf-8", layer.crs(), "ESRI Shapefile")
        writer = QgsVectorFileWriter.writeAsVectorFormat(layer, os.path.join(Location,'shape'+str(num)+'.shp'), "utf-8", layer.crs(), "ESRI Shx file")
        writer = QgsVectorFileWriter.writeAsVectorFormat(layer, os.path.join(Location,'shape'+str(num)+'.shp'), "utf-8", layer.crs(), "ESRI dbf file")
        writer = QgsVectorFileWriter.writeAsVectorFormat(layer, os.path.join(Location,'shape'+str(num)+'.shp'), "utf-8", layer.crs(), "ESRI prj file")
        num= num+1


texts: Converting csv file with Postcode data into shapefile in ArcGIS Desktop?

texts:
I have Postcode data in a csv file that I need to convert to a shapefile in ArcGIS. I have already imported the csv as a table into ArcMap but I cannot seem to be able to convert into a shapefile.

Can anyone help me?


texts: Downloading elevations in different resolutions using worldwind

texts:
I'm new in NASA worldwind and I want to download elevation with NASA worldwind and then use it offline. I have a bbox as follow:
int minX = 20;
int maxX = 80;
int minY = -80;
int maxY = 80;

I'm using as follow, But I don't get the results I want:
Angle minLat = Angle.fromXY(maxX, minY);
Angle maxLat = Angle.fromXY(minX, maxY);
Angle minLon = Angle.fromXY(minX, minY);
Angle maxLon = Angle.fromXY(maxX, maxY);

Sector sector = new Sector(minLat, maxLat, minLon, maxLon);

ArrayList<LatLon> latlons = new ArrayList();

double[] buffer = new double[]{0.0};

double[] resolutions = new double[]{0.05235987755982988, ...};
double[] elevations = this.elevationModel.getElevations(sector, latlons, resolutions, buffer);

How can I download elevations in a bbox in different resolutions?


texts: Purpose of service definition for ArcGIS Online

texts:
Whenever I upload e.g. a feature layer to AGOL, I see in AGOL the feature layer AND a service definition. I am curious what this service definition is.

You can ask the same thing of the scene layer package whenever you upload a 3D model to AGOL.

When I delete this service definition, does it have consequences like maybe I cannot update my feature layers anymore?


texts: How can I determine which raster attribute covers the highest area of a polygon?

texts:
I'm relatively new to GIS and QGIS but I have a problem that I'm not certain how to solve.  I searched here for relevant information but found none.  (Or, I used incorrect search terms.)  My problem is thus:

I have a raster file of crop data determined from satellite imagery.  Pixel size is 30 meter x 30 meter.

I have a shapefile with over 270,000 polygons of varying sizes.

I can get general 'zonal statistics' through QGIS but these are relatively meaningless: count, mean, and sum don't help me in determining the predominant--by area--crop type within a given polygon.

Ideally, I'd like to be able to determine which crop type covers the highest area in every polygon.  As an example, in the image below, the parcel in the center of the image has at least six crop types within it's boundaries.  However, clearly there is one predominant crop type.  How can I associate that single crop type with that parcel?  Is this possible?

I'm using QGIS version 2.4.0 on Windows 7.

If there is an R solution, I would enjoy hearing that, too.


texts: Get GDAL to convert all four bands to a VRT from a NITF?

texts: So I have a series of four band NITF images (RGB + Near Infrared). I am currently storing them in a VRT with gdal_translate. Unfortunately, gdal_translate keeps interperting the fourth band as an alpha channel which causes it to be rendered incorrectly later on. How can I force gdal_translate NOT to use fourth band as an alpha mask. The NITF does not currently have any masks and I would prefer if the VRT didn't either.I am aware that using photometric=RGB can help when creating Geotiff, but I don't want to rely on this since the NITFS I am using are massive and translating it to GeoTiff for no reason seems like a waste.


texts: Calculating the distance between a set of UTM coordinates

texts:
I would like to calculate the distance between several GPS points, these data are projected into UTM Zone 30.

I am using Postgresql 9.3 but I am happy to see results with any software or website such as Microsoft Excel.

PS: This data is from Madrid (Spain)

Eg:

  442778 (x) 4475112 (y)

 442767(X)     4475268(y)