texts: OpenLayers, problem with WFS service and "outputFormat"

texts:
I have a service and I tried to paint his layer on my map:

http://www.ign.es/wfs-inspire/unidades-administrativas?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&COUNT=1&srsName=EPSG:3857&TYPENAMES=au:AdministrativeBoundary

WFS = new ol.layer.Vector({
    source: new ol.source.Vector({
        format: new ol.format.GeoJSON(),
        url: 'http://www.ign.es/wfs-inspire/unidades-administrativas?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&COUNT=1&srsName=EPSG:3857&TYPENAMES=au:AdministrativeBoundary'
        }),
        stroke: new ol.style.Stroke({
            color: 'rgba(0, 0, 255, 1.0)',
            width: 2
        })
})

¿is it possible? I don't see the geometries in the map. I think the problem is "outputFormat", is not possible get "outputFormat=application/json"


texts:
I have written a script to add, among other stuff, a datetime column.
I have used the arcpy.AddField_managementcommand, but it didn't have a 'Datetime' type, so I used the 'Date' type : arcpy.AddField_management(outZStat,"Datetime", "DATE")
Bellow is a part of the script:

mth = raster[21:23]
dec = raster[30]
tm = 14
s2 =  str(day)
s3 = "/"
s4 = str(mth)
s5 = "/"
s6 = str(yr)
s7 = str(" 14:00")
str_dt = s2 +s3 +s4 +s5 +s6+s7
datet = datetime.strptime(str_dt, "%d/%m/%Y %H:%M")
print datet

I added the print just to be sure about the values of datet, its gives me exactly what I want:

However, in the attribute table, the time is 00:00:00 for all the attributes in the Datetime field:

Screen of the 1st row of my table:

The problem may be coming from the type on the arcpy.AddField_managementbut I don't know how to 'force' the Datetime.

The script:

...    arcpy.AddField_management(outZStat,"Datetime", "DATE")
...     arcpy.AddField_management(outZStat,"Year", "SHORT")
...     arcpy.AddField_management(outZStat,"Month", "SHORT")
...     arcpy.AddField_management(outZStat,"Decade", "SHORT")
...     arcpy.AddField_management(outZStat,"Time", "SHORT")
...
...
...     mylist = []
...     with arcpy.da.SearchCursor(outZStat, '*') as arows:
...         idx = arows.fields.index("OID")
...         for arow in arows:
...             mylist.append(arow[idx])
...     mylist_length = len(mylist)
...     with arcpy.da.UpdateCursor(outZStat, "*") as cursor:
...         i = 0
...         for row in cursor:
...             if i< mylist_length:
...                 if raster[6] == "A":
...                     if raster[30]=="1":
...                         day = 01
...                     elif raster[30]=="2":
...                         day = 11
...                     else:
...                         day = 21
...
...                     yr = raster[16:20]
...                     mth = raster[21:23]
...                     dec = raster[30]
...                     tm = 14
...                     s2 =  str(day)
...                     s3 = "/"
...                     s4 = str(mth)
...                     s5 = "/"
...                     s6 = str(yr)
...                     s7 = str(" 14:00")
...                     str_dt = s2 +s3 +s4 +s5 +s6+s7
...                     datet = datetime.strptime(str_dt, "%d/%m/%Y %H:%M")
...                     print datet
...                 else:
...
...                     if raster[31]=="1":
...                         day = 01
...                     elif raster[31]=="2":
...                         day = 11
...                     else:
...                         day = 21
...                     yr = raster[17:21]
...                     mth = raster[22:24]
...                     dec = raster[31]
...                     tm = 10
...                     s2 =  str(day)
...                     s3 = "/"
...                     s4 = str(mth)
...                     s5 = "/"
...                     s6 = str(yr)
...                     s7 = str(" 10:00")
...                     str_dt = s2 +s3 +s4 +s5 +s6+s7
...                     datet = datetime.strptime(str_dt, "%d/%m/%Y %H:%M")
...                     print datet
...
...                 id = cursor.fields.index("OID")
...                 row = [id, cursor[1],cursor[2],cursor[3],cursor[4],cursor[5],cursor[6],datet,yr,mth,dec,tm]
...                 cursor.updateRow(row)
...                 i = i +1

[EDIT:] What's different in my question, comparing to the question Storing datetime values in Shapefiles?, is that fields in the attribute tables in ArcGis, don't have a "Datetime" type (they have only Date type, in opposition to those in qgis). Ther isn't either the "to_datetime" function in the field calculator of ArcGis.

The easiest method to resolve my problem is to turn the field type of my attribute table to string. That's what I did finally.


texts: How to Open a Table, Convert it to ShapeFile & projecting the data using the X and Y

texts:
it's my first project using ArcObject, i create this interface :
http://i118.photobucket.com/albums/o104/b_sara/Cap2-1.png

i did programme the button "Parcourir" ( browse ) using a commonDialog, it get just the files "*.dbf"

Code:

Private Sub CmdPrc_Click()
On Error GoTo Annuler
With CommonDialog1
    .DialogTitle = "Choisissez une Table"
    .CancelError = True
    .Filter = "Tous (*.dbf)|*.dbf"
    .InitDir = "C:\"
    .ShowOpen
Text1.Text = .fileName

Annuler:

  If Text1.Text = "" Then
    Label1.Caption = "Vous n'avez sélectionné aucun fichier."
  Else
    Label1.Caption = ""
  End If
End With
End Sub

the combobox also works good, but they take there value manually, this is the code :

Code:

Private Sub UserForm_Initialize()

With CmboX
    .AddItem "OID"
    .AddItem "PT"
    .AddItem "PP"
    .AddItem "PI"
    .AddItem "BPLB"
    .AddItem "BPLL"
    .AddItem "RP"
    .AddItem "CO2B"
    .AddItem "CO2L"
    .AddItem "MGOB"
    .AddItem "MGOL"
    .AddItem "X"
    .AddItem "Y"
End With

With CmboY
    .AddItem "OID"
    .AddItem "PT"
    .AddItem "PP"
    .AddItem "PI"
    .AddItem "BPLB"
    .AddItem "BPLL"
    .AddItem "RP"
    .AddItem "CO2B"
    .AddItem "CO2L"
    .AddItem "MGOB"
    .AddItem "MGOL"
    .AddItem "X"
    .AddItem "Y"
End With
CmboX.ListIndex = 11
CmboY.ListIndex = 12
End Sub

now i'm sticked at "Ok" button, and Edit button i don't know how to fix it,

the Button "Ok" should :

Open the Table "*.dbf" , then take the coordinate X and Y, and convert it to a shapefile,  then open all the data with there (X, Y) in ArcMAP

the Button "Edit" should open that window to define a projection and a coordinate system :

that you can get it by adding a table -> click right -> Display XY Data -> click button "Edit"
http://i118.photobucket.com/albums/o104/b_sara/Cap3.png

i need to programme that, that's the point of my training end of study

I need help, please if anyone could help me.


texts: How can I access standard ArcMap cursors?

texts: I'm writing an Add-In for ArcGIS 10 and would like to use the standard mouse cursors ArcMap uses (e.g. the info cursor and the edit cursor). I hope it is possible to just use the right reference in the add-in config file and not copy the cursor image file.


texts: Using QgsMapCanvasTracer/QgsTracer in custom tool

texts:
I've made a custom tool for digitizing polygons in qgis, similar to build in Add Feature tool but with some modifications. I need to integrate tracing into that tool also, but I haven't figured out how.

I know that in the API, there are QgsMapCanvasTracer class and QgsTracer class, but I don't know how to use them in my custom tool.

Can someone give me some hints or examples regarding this topic?


texts: QGIS 3x put apostrophe in the field calculator text

texts:
I want to put the street name in my field calculator.
The problem is, that it contains the apostrophe as per in the image below:

The expression becomes invalid.
Even if I try:
 "Christy's Yard"

or even
 ""Christy's Yard""

regarding to this thread
How to insert a quotation mark through the Field Calculator of attribute table of a Shapefile?
is still wrong.
Is there any way to include the apostrophe inside the field calculator text, which must be quoted?


texts: No expected output when accessing variable from one function and using in another fucntion

texts:
I have a function say selectedfeatures this function would be called when a selection changed event happens in mapcanvas.

self.canvas.selectionChanged.connect(self.selectedfeatures)
QObject.connect(self.dlg.runbutton, SIGNAL("clicked()"), self.mapselection)

def selectedfeatures(self):
    layer = iface.activeLayer()
    idx = layer.fieldNameIndex('name')
    self.feature = layer.selectedFeatures()
    QMessageBox.information(self.dlg, "features were selected:",  str(len(self.feature)) + " features were selected " +"" )

And for that selected features in the above function i want to perform buffer using the below function.I am using the self.feature in mapselection function like below

    def mapselection (self):
        for feature in self.feature:
         mbuf = feature.geometry().buffer(dist, 2)
         iterFeat = layer.getFeatures()
         for f in iterFeat:
             geom2 = f.geometry()
             valTest = QgsGeometry.within(geom2, mbuf)
             if valTest:
                idx = feature.fieldNameIndex('name')  #name of the attribute column with the cities in it
                idx1 = feature.fieldNameIndex('state')
                nearCity = f.attributes()[idx]
                state = f.attributes()[idx1]
                state_and_cities = str(state) + "," + str(nearCity)
                lsNearCities.append(state_and_cities)
                #call the function to write them into a file
            self.writeToFile(lsNearCities, filePath)

The output is not as expected though there are features selected in mapcanvas, it is saying 0 cities were there in the list lsNearCities.I want to know should i want to include any event separately for selection process completed in mapcanvas? If so how should that be done? Please tell me where i am wrong.


texts: Issue on project CRS loading a georeferenced image

texts:
I have a georeferenced image in EPSG 26714. When I load it in Qgis 2.14 the project CRS is set to 4326. I asked for the layer properties and the CRS registered is 26714. When I open the same file in QGIS 2.87 the project is set automatically to 26714. The only way That I found to set the project CRS correctly in 2.14 is by right click on the layer and choose "set project CRS form layer".
I geoference the layer using qgis, and a coordinate example is 545186,2172807 so it is UTM, no confusion on the coordinates. My question is why 2.14 does not recognize the CRS of the georeferenced image and assign it to to project? Why 2.86 does it as it should do it?


texts: Using spyder as Python IDE with ArcGIS Pro?

texts:
I just installed ArcGIS Pro and would like to either import arcpy into anaconda, or use spyder as my IDE in GIS.  I have tried two things:

For ArcGIS Desktop you had to copy the .pth file from GIS to Lib/site-packages in anaconda.  I did that but it didn't work.
I went to this website, https://geonet.esri.com/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro, and I tried to find spyder.exe in my Scripts folder like the link says.  It didn't exist.  So I copied spyder.exe from Anaconda into that location.  Then, when I launched my ide with ide from the command prompt within ArcGIS pro, it launched the default ide and not spyder.


texts: Sorting line features into route order in attribute table using QGIS?

texts:
I have a several line features stored as shapefiles, obviously constructed of several connecting segment.

I wish to export the attribute tables of each feature as a CSV to use in a separate spreadsheet. However, this requires the comprising segments being ordered in the order which they comprise the line (i.e. the bottom left segment first and the top right segment last). Is there an algorithm or tool I could use to achieve this? Ideally it would assign each segment an ID based on its location in the line feature, incrementing from the start of the line (0) to the end.

I have calculated the start/end points of each line segment but unfortunately cannot simply sort by these coordinates as the lines do not run in a continuous direction.

Expanded information:
My data is a section of a road network stored as a single polyline. This line is comprised contains a number of features, each with information of their length and average travel time (see picture):

I actually have several lines, each one representing a direction of travel across a route in the road network.

I have exported the line features to a CSV so that I can compare the travel times across the routes with those produced with a traffic model. However, in order to compare like-for-like I need each feature to be in order as they form the line. Currently, each feature in the attribute table corresponds to a random section of the route - I wish to sort these features so that they appear in the order which they form the line.


texts:
I am trying to ST_Dump a geometry_dump column comprised of points and paths in PostGIS 2.0 using

SELECT (ST_Dump(geom)).geom FROM pointdump

However, I get the error message 'function st_dump(geometry_dump) does not exist'

I thought that ST_Dump would dump a geometry_dump column into its constituent parts? Or is there another method I can use? Eventually, I want to draw lines between these points to create rectangles.

This column was created by using this function I discovered online elsewhere and ran on a simple polygon:

CREATE OR REPLACE FUNCTION st_dumppoints_plpgsql(geometry)
  RETURNS SETOF geometry_dump AS
$BODY$DECLARE
 m integer;
 g geometry;
 n integer;
 p geometry_dump%ROWTYPE;
BEGIN
  IF GeometryType($1) LIKE 'MULTI%' THEN
    FOR m IN SELECT generate_series(1, ST_NumGeometries($1)) LOOP
      p.path[1] := m; -- use to store Multipolygon number
      g := ST_Boundary(ST_GeometryN($1, m));
      FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP
        p.path[2] := n; -- use to store Point number
        p.geom := ST_PointN(g, n);
        RETURN NEXT p;
      END LOOP;
    END LOOP;
  ELSE -- It is not a MULTI- geometry
    g := ST_Boundary($1);
    FOR n IN SELECT generate_series(1, ST_NumPoints(g) - 1) LOOP
      p.path[1] := n; -- use to store Point number
      p.geom := ST_PointN(g, n);
      RETURN NEXT p;
    END LOOP;
  END IF;
  RETURN;
END;$BODY$
  LANGUAGE 'plpgsql' IMMUTABLE STRICT
  COST 100
  ROWS 1000;


texts: nextFeature method for FeatureIterator object in QGIS 3 seemingly not working?

texts:
How do we get the next feature from a QgsFeatureIterator object in QGIS 3? I tried the following with no success:

l = QgsProject.instance().mapLayersByName('Dissolved')[0]
f = l.getFeatures()
f = f.nextFeature()

The error returned by the .nextFeature call above is as follows:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
TypeError: nextFeature(self, f: QgsFeature): not enough arguments

What am I doing wrong? How come the iterator nextFeature method is asking me for arguments?


texts: I would like to ask if there is a way in FME to set the Feature types to read parameter, from values in microsoft access table. I have a model that translates .dgn files and  then appends them to a SQL table to use in ArcMap, but the model at this moment is hard-coded to  specific level numbers, and it needs to be able to change these levels according to access tables that are provided by the engineers.


texts: Change coordinate system using SQL or Javascript

texts:
Is there any built in function in SQL Server 2008 R2 which can transform the cordinates from 102100 to 4269 coordinate system something equivalent to ST_Transform from postgres.
If there is algorithm to transform coordinates then that can also help or the Javascript library then that could also help.


texts: Taking a long time to load tables from Oracle to QGIS

texts:
My workplace has an Oracle database with a very large number of spatial tables.
Therefore, it takes a long time to load the Oracle connection in QGIS.
Does anyone know how this could be speed up?


texts:
I am creating a code that aggregates neighbouring polygons if they have similar value on the field 'DN' and if they are closer than 50 m.Then I want to iterate this 3 times.

I could already get the smale ID to the polygons with this restrictions.

for i in range (3):
for feature in GFW_catch.getFeatures():
    geom = feature.geometry()
    ll = []
    for feature_n in GFW_catch.getFeatures():
        geom_n = feature_n.geometry()
        euclidean = QgsGeometry.distance(geom, geom_n)
        if abs(feature ["DN"] - feature_n ["DN"]) <= 2:
            if euclidean < 50 and feature.geometry().area() < feature_n.geometry().area():
                ll.append((feature_n.geometry().area(),feature_n ["ID"]))
    if len (ll):
        feature ["ID"] = max(ll)[1]
    GFW_catch.updateFeature(feature)
processing.runalg('saga:polygondissolve', GFW_catch,"ID", False, '2018-11-15-GFW_AR5_Forest.shp')

Since I did not find a code for promoting to multipars in PyQGIS, I thought about dissolving by ID with SAGA, that creates multiparts by default in the GUI. However, it is not working with the message: Error: Algorithm not found.

in https://qgis-docs.readthedocs.io/en/latest/docs/user_manual/processing_algs/saga/shapes_polygons.html the doccumetation shows this code:

processing.runalg('saga:polygondissolve', polygons, field_1, field_2, field_3, dissolve, dissolved)

any tip?


texts: Why is the scale on my maps a bit too big?

texts:
I saved couple of pdfs when I relized that the scale I set is not the scale that shows, everything is a bit bigger.

I tried to check it not only at the print composer, but in the "work space" and it is wrong there too. The project is in WGS 84 / Pseudo Mercator, and I wanted to export some google satellite images, its CRS is also WGS 84 / Pseudo Mercator.

I tried to open it with a project in WGS 84, layer set in WGS 84, but then the scale shows something like  1:119 946 154 when it should be around 1:2000... what to do?! I am pretty new to qgis (and gis, in general), please help me figure this out.


texts: Return A Path from multiple point in Geomesa

texts:
I am trying to visualise the historic of a vehicle in a specific area , I am writing now a query to get all points off a this vehicle in this area with this :

    FeatureStore feature = (FeatureStore) dataStore.getFeatureSource("testone");
    SimpleFeatureSource source=dataStore.getFeatureSource("testone");
    SimpleFeatureCollection collection=source.getFeatures(CQL.toFilter("vehicleId = my_Id and DWITHIN(geom,myPointofInterest,200,meters)"));
    System.out.println(collection.size());
        while(iterator.hasNext()){
            // Here i will create the Polyline
            System.out.println(iterator.next());

        }

is there a function in geomesa that aggregate points into one Polyline so i can do it in geomesa not in my server ?
and for the visualisation , a vehicle can enter this area and leave it and re enter again , do you have any idea how can I detect this multiple Path ?


texts: Implementing PostGIS query using sf in R to make ST_Intersection faster

texts:
I'm trying to implement this query that speeds up st_intersections by using faster functions, namely ST_Contains and ST_Within, to do ST_Intersection only where absolutely necessary, from PostGIS to R

SELECT CASE
   WHEN ST_Contains(a.geom, b.geom)
     THEN b.geom
   WHEN ST_Within(a.geom, b.geom)
     THEN a.geom
   ELSE ST_Intersection(a.geom, b.geom)
   END ...
FROM a JOIN b
ON ST_Intersects(a.geom, b.geom)

what I have so far:

library(sf)
library(dplyr)
library(raster)

# anp_fed = raster::getData(country = "MEX", level = 1) %>% st_as_sf() %>% filter(NAME_1 == "Veracruz")
# veg     = read_sf("usv250ks4gw.shp")
     # downloadable from http://www.conabio.gob.mx/informacion/gis/maps/geo/usv250ks4gw.zip

contienen  <- st_contains(anp_fed, veg, sparse = T)
contenidas <- st_within(anp_fed, veg, sparse = T)

contienen_list <- c()
for(i in 1:dim(contienen)[1]) {
  contienen_list <- c(contienen[[i]], contienen_list)
}
contienen_list <- sort(contienen_list)

contenidas_list <- c()
t_contenidas <- t(contenidas)
for(j in 1:dim(t_contenidas)[1]) {
  contenidas_list <- c(t_contenidas[[j]], contenidas_list)
}
contenidas_list <- sort(contenidas_list)

all_in_one <- rbind(st_join(anp_fed[contenidas_list,], veg),
      st_join(veg[contienen_list,], anp_fed) %>% as.data.frame() %>%
        dplyr::select(names(anp_fed)[-length(names(anp_fed))], names(veg)) %>% st_as_sf(),
      st_intersection(anp_fed[ifelse(length(contenidas_list) == 0, 1:dim(anp_fed)[1], -contenidas_list),],
                      veg[-contienen_list,])
      )

# system.time(source("postgis_to_sf.R"))     =  491 s
# system.time(st_intersection(anp_fed, veg)) =  666 s

I'm trying to do this without calling rpostgis because I want to do it directly on files in my system without having to put them into Postgresql; I think there's a lot of space for improvement, maybe there's a more straightforward way of translating sgbp to a vector to filter sf objects, and also the re-ordering of columns of the second st_join() call, transforming to data.frame; I'm trying to make a more concise code; note also the evaluation for empty sf objects needed (it should be done in every object, if it is to become a function)

Execution with st_intersection() takes 666 s, while the optimized version takes 491 s, almost 3 mins less.


texts: Fixing geometry validity errors in QGIS 2?

texts:
I am working on ownership data at a US county level. I have one shapefile per county that contains thousands of tax parcels. I need to dissolve the polygons representing parcels owned by the same individual. When the shapefile is not clean, the "Dissolve" tool in QGIS doesn't seem to work, it freezes. I have to fix the geometry validity issues first using the "Check Geometry Validity" tool. However, I have sometimes hundreds of errors. It takes a lot of time to fix them manually. Is there any other strategies that could save me some time?

I am using QGIS 2.4.0.


texts: Why does QGIS Simplify Geometries delete entire polygons?

texts:
I am reducing the size of a world timezone shapefile,

http://efele.net/maps/tz/world/tz_world_mp.zip

But at a 0.01 tolerance, entire countries disappear

Anybody know a way round this?

QGIS shows the same error simplifying naturalearthdatamaps also; simplify with 0.01 tolerance and Italy disappears


texts: I'm interested in finding GIS data for ports in California. I have a point layer but I'm hoping to find polygons for each port. Surprisingly this is proving to be more difficult than first expected.


texts: How to compare EVI values with NDVI values?

texts: I have been doing NDVI (Landsat 4-5) analysis for my research area for some time now. I recently decided to try out EVI (MODIS). But the EVI values I get are a bit different from NDVI. For example maximum NDVI values reach upto 0.9 but maximum EVI values only reach 0.6. I read that EVI does not get saturated in dense biomass regions like NDVI does so maybe that is a reason for lower maximum EVI values? In any case, is there some conversion factor or some other way to compare the two values for the same region? For example if I say NDVI in a park changed from 0.3 to 0.6 in 5 years, the changes in EVI for the same park ofcourse wont be within the same range. This is a great confusion for the people who await my results as they only understand NDVI values and would think NDVI of 0.6 is equal to EVI of 0.6.


texts: How do I access stroke color and width of a simple marker with python in QGIS?

texts:
I'm trying to set up style properties of a vector layer using python. I was able to modify the marker properties but I cannot modify those of Simple Marker, like width or color.
Here is my code :

  layer=iface.activeLayer()

  # Marker

  single_symbol_renderer=layer.renderer()
  symbol=single_symbol_renderer.symbol()
  symbol.setColor(QColor.fromRgb(255,255,1))
  symbol.setSize(4)

  # Simple Marker

  marker_symb = QgsSimpleMarkerSymbolLayer()
  marker_symb.setStrokeColor(QColor(255,255,1))
  marker_symb.setStrokeWidth(0.9)
  layer.subSymbol(marker_symb)
  layer.triggerRepaint()

Please can you help me ?


texts:
I am trying to create a bikeability index for some local roads. I have four inputs: traffic volume, speed limit, shoulder width, and slope. Each raster input has been re-classed to 6 classes. When I run a Weighted Overlay, my raster output contains  that make the analysis useless. I assume this is because my volume, speed limit, and shoulder width do not have the same spatial extent as the slope (rasterized polylines vs continuous raster), and when I run the overlay with just the first three inputs I get a useful output. I can I solve this and utilize the continuous slope later in my analysis?

I am using arcmap 10.3.1


texts:
Is there a way to remove this numbers associated with vertical segments in histograms in QGIS?

I am using 2.18.


texts: Can ArcGIS layer be shown on Google Earth?

texts:
If we have a table in SQL Server which was used as layer in ArcGIS. Can the same thing be done in Google Earth?

I mean does Google Earth support adding custom layers? If so how?


texts:
I am new to this and still trying to learn.  I have a bunch of VBA code that I am trying to convert to C# and even the most basic things are hanging me up.

Currently I am trying to build a button that pans the display Left when pressed.

The original VBA code that I have looks as follows:

Sub pan_left()
On Error GoTo Errhandler

   Dim pMxDocument As IMxDocument
   Dim pactiveview As IActiveView
   Dim penv As IEnvelope
   Dim pxmax, pxmin, pymax, pymin As Double
   Dim nxmax, nxmin, nymax, nymin As Double
   Dim width, height As Double

   Set pMxDocument = ThisDocument
   Set pactiveview = pMxDocument.FocusMap
   Set penv = pactiveview.Extent

   pxmax = penv.XMax
   pxmin = penv.XMin
   pymax = penv.YMax
   pymin = penv.YMin

   width = pxmax - pxmin
   height = pymax - pymin
   nxmax = pxmax + (width / 1.08)
   nxmin = pxmin + (width / 1.08)
   nymax = pymax
   nymin = pymin

   penv.XMax = nxmax
   penv.XMin = nxmin
   penv.YMax = nymax
   penv.YMin = nymin

   pactiveview.Extent = penv
   pactiveview.Refresh

ThisDocument.fTimer
Exit Sub
Errhandler:
On Error Resume Next

End Sub

I have been trying to write it using the Desk top Addins.  I have found some code on ESRI's website found here: Pan Left (Not sure if I am even on the right track.)

Currently my code looks as follows:

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.ADF.CATIDs;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Framework;

namespace NAIP_QQv1

{

    [ClassInterface(ClassInterfaceType.None)]

    [Guid("593EDF4F-D1FE-4a8d-8076-C3B583C37F6B")]

    public class PanDown : ICommand

    {
    #region COM Registration Function(s)
    [ComRegisterFunction()]
    [ComVisible(false)]
    static void RegisterFunction(Type registerType)
    {
        // Required for ArcGIS Component Category Registrar support
        ArcGISCategoryRegistration(registerType);

        //
        // TODO: Add any COM registration code here
        //
    }

    [ComUnregisterFunction()]
    [ComVisible(false)]
    static void UnregisterFunction(Type registerType)
    {
        // Required for ArcGIS Component Category Registrar support
        ArcGISCategoryUnregistration(registerType);

        //
        // TODO: Add any COM unregistration code here
        //
    }

    #region ArcGIS Component Category Registrar generated code
    /// <summary>
    /// Required method for ArcGIS Component Category registration -
    /// Do not modify the contents of this method with the code editor.
    /// </summary>
    private static void ArcGISCategoryRegistration(Type registerType)
    {
        string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
        ControlsCommands.Register(regKey);

    }
    /// <summary>
    /// Required method for ArcGIS Component Category unregistration -
    /// Do not modify the contents of this method with the code editor.
    /// </summary>
    private static void ArcGISCategoryUnregistration(Type registerType)
    {
        string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
        ControlsCommands.Unregister(regKey);

    }

    #endregion
    #endregion

    [DllImport("user32.dll")]
    static extern IntPtr SetFocus(IntPtr hWnd);

    private System.Drawing.Bitmap m_bitmap;
    private IntPtr m_hBitmap;
    private IHookHelper m_pHookHelper;

    public class Pan_Left : ESRI.ArcGIS.Desktop.AddIns.Button
    {

        public Pan_Left()
        {
            //m_pHookHelper = new HookHelperClass ();

        }

        protected override void OnClick()
        {//Get the active view
            IActiveView pActiveView = m_pHookHelper.ActiveView;

            //Get the extent
            IEnvelope pEnvelope = (IEnvelope)pActiveView.Extent;

        }

        protected override void OnUpdate()
        {
        }
        }
    }
}


texts: How to make Openstreet Map transparent now;

texts: I have a detailed DTM of my region and i want to overlay Openstreet Map with transparency. Is this possible and how; I work with Openlayer3


texts: Nearest intersections outside the polygon in ArcGIS for Desktop?

texts:
I have two layers, a street network and a polygon, and I want to find the nearest street intersection points just outside the boundary of the polygon. For example some area is closed by police and I want to find all the intersections where they have to divert traffic.

Is there any easy solution in ArcGIS 10.2, please?

The result should be a point layer of the nearest intersections outside of the polygon.


texts: How to attribute street name to its adjacent sidewalk

texts:
I have two shapefiles one with street  centrelines and the othe With sidewalk asset information.The sidewalks were digitized continuously around the block unlike the streets. I tried to do a  one to one spatial join within 8metres (measured the distance between street centreline and sidewalk) however the distances vary at different locations.How do I attribute the street name to the adjacent sidewalk.

I have attached the result of the spatial join using closest

however the results are not correct ...the street name is woodside blvd but the adjacent sidewalk get the attribute name woodside close and woodside circle.


texts: QGIS Vertex Tool not working on some layers

texts:
I am making a map in QGIS 3.16.
I have made a custom function with the function editor.
I have used the function in the styles of 5 layers of my map.
When I start QGIS all layers load correctly with correct calculations of my function.
But Vertex Tool is working normally on the the 5th layer and on all the layers not using my function.
If I remove my function from the style of any of the 4 layers, the Vertex Tool starts working correctly.
I have also made a test layer.  This layer works as the 4 layers.
I have tried hard to find the reason, why the 5th layer is an exception. But I can't find any essential difference between the style of this layer and the other 4 styles.
See my example in "QGIS : On layers using my custom function and also having a Rule (Filter) the Vertex Tool is not working"


texts: How can I add image (e.g. North Arrow) in mapfish layout print with geoserver?

texts: I want add north arrow in the map printing using in mapfish with geoserver.


texts: Move Incorrectly Placed Address Points to Correct Parcel

texts:
I'm currently in the process of cleaning up a municipality's address point data. I'm working with two data sets: address points and parcel polygons. Both the address point data and the parcel polygons have a parcel ID which allows for a spatial join and a way to verify where an address is supposed to be.

There are about 50,000 geocoded address points in my dataset. An overwhelming majority of these points fall within their corresponding parcel (aka they are spatially correct).

The problem I have is that many address points were not geocoded correctly and do not fall within their corresponding parcels. Oftentimes an address point is many parcels away from the parcel it should exist in.

Is there a a process within ArcMap (or ArcPy) that would allow me to move address points that aren't within their correct parcel polygon to where they should be? Essentially, I want to identify all of the address points that do not exist within their proper parcel (using the Parcel ID) and then redistribute those points into the parcel using the matching Parcel ID.


texts: Google Earth Engine exported tif file is unprojected (or strange coordinate system?)

texts:
Just starting to learn Google Earth Engine. Sorry if this is covered elsewhere but I couldn't find a tutorial or post about it.

I'm doing a pretty simple image export, but when I load the TIFF into QGIS later (to add state boundaries, etc) it seems to have an incorrect coordinate system and doesn't match up with other shapefiles.

Here's the code:

var cdl = ee.Image('USDA/NASS/CDL/2017').select('cropland')

var crops = ee.List([1,4,5,7,9,10, 31, 33, 36, 45, 63, 64, 86, 241])

var mask = ee.Image(cdl)
  .eq(1)
var masked = ee.Image(cdl)
  .updateMask(cdl.eq(1))

// Map.addLayer(filtered)
Map.addLayer(mask, {}, 'mask')
Map.addLayer(masked, {}, 'masked')

var remapped = cdl.remap({
  from: crops,
  to: ee.List.repeat(1, crops.size()),
  defaultValue: 0
})

Map.addLayer(remapped, {}, 'remapped')

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: masked,
  description: 'corn-test',
  scale: 1000,
  maxPixels: 99999999
});

It's worked with another dataset so not sure why this one is off.

Here's a screenshot of what the tif looks like in QGIS next to an actual shapefile from the Census:

CRS for the corn tif:

USER:100025 - * Generated CRS (+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs) - Projected

CRS for the census shapefile:

EPSG:4269 - NAD83 - Geographic

I've tried to re-project the tif and it always seems to disappear (nothing happens when I "zoom to layer")


texts: Is distance between lines of latitude same on ellipsoid?

texts:
Is the distance between lines of latitude the same for an ellipsoid?

I know they are the same for a spheroid and intuitively, I would say it is the same for an ellipsoid but I could not figure out how to calculate this.


texts:
I have come across a northing and easting type of system that I can not identify or convert. It seems like UTM but is not. This is an example of a coordinate that I have:

N4738272.047
E712167.899

The corresponding lat and lon would be 42.767626, -78.406808. This is a known position but I have several positions that I am trying to convert.


texts: QChainage doesn't place points evenly along dissolved lines

texts: I am trying to add mile markers to interstate centerline data.  I've tried both the native dissolve tool (which freezes QGis) and SAGA line dissolve to create one continuous line.  When I run the QChainage tool it seems to read the nodes (breaks) in the original data as still being there.  I am not sure if this is a dissolve issue or QChainage issue but I haven't found a solution or work around for this.  It seems the dissolve tools don't actually create a continuous feature.


texts: Clip Categorized Polygon with another Polygon

texts:
I have created a contoured polygon layer from a set of csv points.

My polygon layer looks like this:

The issue is that over the water I don't actually have data, that area is being filled in by the contour plugin.

I have two options the way I see it:

Create contours that do not interpolate over missing stretches of data; OR
Clip this contour layer with a polygon so it only displays my actual dataset.

Below you can see my contour layer with the 'mask' of where my data should actually exist:

I have tried clipping, using the intersect tool, using the digitize tool etc. to just clip this layer, but I'm obviously doing something wrong.  More times than not the tools just take one of the categories from the contour layer and ignoring the other two.  Like this:

I have tried saving all my layers as new shapefiles in the same CRS.  I have also gone through and checked the geometry for errors and fized them where applicable.

Any thought on how I can accomplish what I'm trying to do?


texts: Draw horizontal or vertical lines in QGIS?

texts:
I create a new shapefile layer as a line. Then I activated editing mode and want to draw vertical or horizontal lines with add feature but holding shift does not allow to draw a horizontal or vertical line (I used QGIS 2.14.4).

How can I draw horizontal or vertical lines as a shapefile?


texts:
I was able to create a Postgresql database and then I executed,

createlang plpgsql geospecies
psql -d geospecies -f postgis.sql
psql -d geospecies -f spatial_ref_sys.sql

So now can I directly import the shapefiles? Would this be the right command,

ogr2ogr -f PostgreSQL PG:"host=server_ip user=username dbname=dbname password=password" yourshapefile.shp;

I am not sure how to structure the database, would it not need a table? I will eventually need to add a bunch load of shapefiles and so is there a command to do that?


texts: Merging raster fail: only one raster in output?

texts:
I am trying to merge two rasters (.tif) in QGIS (Raster > Miscellaneous > Merge), but only one of the rasters is kept in the output.

I need a 3rd rasters with the sum of the values from both input rasters.

So to 'Place each input into a separate band' is not an option. The rasters overlap completely and have the same resolution. The values of each cell are 0 or 1. The third raster should have values of:

Zero, when a cell from both rasters have a value of zero
One, when one cell has value 1 in one raster and 0 in the other
Two, when a cell from bothe rasters have a value of 1

When I try to merge as described above, the resulting raster is exactly the same to one of the preceding rasters.

I've already tried the to re-saved my .tifs but with a lower resolution (as suggested here) with no success.
I'm running QGIS 3.0.1 in Windows 10.


texts: Skip making Vector-Tiles for higher Zoom (18+)

texts:
I made the switch from raster to Vector Tiles for my maps sometime last year and so far I've been really satisfied with my decision. I have been making tiles from zoom 1 to 21 and it's been a real struggle trying to tile large areas till zoom 21.

I realized that since vector tiles contain just the vector data they are essentially the same for higher zoom levels, just of a smaller extent, so I could skip making the tiles and simply reload the previous zoom level's tiles. I tested it out by limiting my max zoom to 17 and viewing the map at zoom 21 (zoom 17 tiles reloaded at zoom 21) and couldn't find a difference in the rendered map (the missing labels can be handled in my renderer).

This is the original zoom 21( with zoom 21 tiles):

And this is the zoom 21 with zoom 17 tiles reloaded:

Can I skip making tiles for zoom 18+ and use the zoom 17 tiles till zoom 21 without any problems?

I am using TileStache to make my vector tiles (for Pakistan only, not globally) and it stops simplifying geometries from zoom 16


texts:
I am considering purchasing ArcGIS Online for a group of users who currently use about 5% of ArcGIS capabilities (ArcMap, simple map creation and information display) about 80% of the time.  Primary attractive features of ArcGIS Online for them include drag-and-drop addition of layers, the ability to publish and share maps embedded in a browser, avoiding installation of Desktop software, and the ability to publish and use basemaps served from the cloud.

What are the other options and a few pros and cons?


texts:
For my thesis I'm modeling the identification of recreation areas.
Therefore, there has been a survey where people were asked to specify where they recreate. They had to indicate this place on a map and give a radius. Now I have to analyse which areas were most visited, and afterwards use the data to give a weighted rating with the travel distance.

So, I use QGIS to Buffer the data points by using the given radius. Now, I want to calculate for every point in the country how many times it was visited.

Any thoughts how to do this in QGIS?


texts: Debugging Python script tool that contains space in location using PythonWin from ArcCatalog?

texts:
I have created a python script that is on a network drive, and in a folder that has spaces in the location e.g.

\\server\Team name\scripts\myScript.py

I have added the script to a script tool in ArcCatalog,and set up the parameters correctly.
When I try and debug the script (by right-clicking on the script and selecting debug), PythonWin opens as expected, but the script I specified does not open, but a blank file which has the location

\\server\Team

How do I open a script it in a script tool that has spaces in the path?


texts: I have kind of spikes around my 3D model and can't seem to get a clean contour. Anyone knows what I need to change to get?


texts:
I am a developer, but the current context of the question is as a user: I don't want to spend time setting up OpenLayers server, writing code etc. for what I want to do.
Now, what I am trying to do:
I have downloaded a 112MB large KML file that should contain all the public lands in Nova Scotia, Canada from Socrata API: https://data.novascotia.ca/api/geospatial/3nka-59nz?method=export&format=KML
(This can be exported to "Original, KMZ, Shapefile and GeoJSON" as well, if needed).
I tried loading it on Google Earth, and no luck, it hangs pretty much.
The reason I want to load it somehow, is to overlay it over normal satellite map with roads, so that I can pick exact geospatial coordinates, of places in public land, where I could for example camp with RV trailer, as once I have a coordinate, I can keep it in Google Maps, and navigate to it for our vacation plans.
After Refreshing Google Earth, it seems to have managed to open the imported KML project and even render the public land parcels, but it hangs, I cannot even more around/zoom in, it's just stuck in "Working"...
I am looking I guess, for a native application that'd run locally, or any advice you can give please.
The Holy Grail answer I am looking for? Some Android mobile app where I can load the relevant KML data, and would show my location -- whether I am inside the shapes (e.g. public land), or not in real time overlaid over satellite/road view.


texts: Read a shapefile and write an identical one using GeoTools

texts:
Using GeoTools, how should a shapefile be read and written such that it is as identical as possible (idempotent) to the input file, i.e. the schema, projection and any other metadata is unchanged?

My end goal is to read a shapefile and apply some minimal changes to it, but this seems like a good starting point.

I'm not necessarily interested in a working code snippet. A list of things to keep in mind when re-creating a shapefile would be more than enough.


texts:
I have a vectorlayer and want to give the points a svg-symbol. If I give the constructor an absolute path to my svg-file it works fine. Then i put the svg to my ressource file (qrc) and try to load it from there it doesn't work. Maybe I'll have to load the file into a QIcon? But how can I get it then in the layer? I've read something about QSvgCache but I see no way to use it. Can anyone help me?

            //QString name="E:\\Entwicklung\\QGis\\Quantum-GiS\\src\\plugins\\adresssuche\\haus.svg";
            QFile svg(":/adresssucheplugin/haus.svg");
            QString name=svg.fileName()
            qDebug()<<name;
            QgsSvgMarkerSymbolLayerV2* p_svgSymbolLayer(0);
            p_svgSymbolLayer= new QgsSvgMarkerSymbolLayerV2(svg.fileName(), DEFAULT_SVGMARKER_SIZE, DEFAULT_SVGMARKER_ANGLE);


texts: How to migrate spatial tables from MSSQL to PostGIS

texts:
I'd like to migrate my spatial data from MS SQL Server to PostGIS.

Originaly the data was stored with SDE under MS SQL. Then I migrated with an ArcGIS tool.
That created a spatial data column with WKB data.

I've tried to migrate with ogr2ogr. All the data come through correctly except the geometry. I don't know why.

Update:

SDE 10.0
MS SQL Server 2008 R2
ArcGIS 10.2
PostgreSQL 9.3 (with PostGIS)

I've tried to convert the fields with ogr2ogr:

  ogr2ogr --config PGCLIENTCODING ISO-8859-2 -f "PostgreSQL PG: "host=localhost user=postgres dbname=test password=user" -sql "SELECT *, Geometry::STGeomFromWKB([Shape].STAsBinary(),23700).STAsText() AS [geom] FROM [test].[dbo].[BARLANG_PONT]" -nln barlang_pont ODBC:intra -a_srs "EPSG:23700"

With this code the spatial field translated to WKT (varchar) text to the PostGIS. The default spatial is the wkt_geom (geometry) column. I could use the -lco GEOMETRY_NAME=geom code to rename the default spatial but the two columns have different types.


texts: One to Many Relationships concerning Attribute Tables and Domains in ArcMap

texts:
I am drawing in and inventorying signalized intersection assets and when it comes to the conduit and wiring some of the conduits (most) have 2+ cable/wire conduits in them.

For example, the record drawing below shows an HDPE schedule 80 conduit that contains inside 4 cable/wire conduits (9C/14 , 7C/14 , 6-5C/14 , 2-2C/16).
I have created domains for the type of conduit (NEC_Conduit) and quantity of cable/wire conduits (count_Conduit).

My goal is to field calculate the type_Conduit field using the simple expression of type_Conduit = "count_Conduit"& &"NEC_Conduit". The issue is is there is a one to many relationship. The NEC_ and count_ Conduit fields contain more than one record per one line feature and the type_Conduit would have multiple records per feature for some (many) features.

How would I set my domains and tables up to accomplish this (if possible)?

I am not using the tool to grid out areas, I am just making polygons that are based on intersections ID points as my grid feature for the Generate_ID_By_Intersect. So instead of the data residing directly in the features attribute data, I am going to create an ID for each line of conduit and in the related table I will show show the attribute assistant generated ID.

I have yet to get the formula to run correctly.


texts: Creating unique feature layer from existing layer in ArcGIS Online

texts:
In ArcGIS Online, I am creating a new feature layer where I will be hand-tracing features based on an aerial photo. I want to use an existing feature layer with similar data as a base. When I create a copy of the layer in ArcGIS Online (open layer in map > open layer menu > COPY > save copied layer), it creates a dependent copy where any edits to features are transferred back to the original layer.
How do I create a new unique feature layer from the existing data, that I can edit without affecting the original feature layer?


texts: Cannot export raster with qgis2web or qgis2leaf

texts:
I am trying to publish a raster layer with qgis2web, when I set the parameters in the popup qgis2web window, the raster doesn´t show up in the preview window (there is a question mark instead). Then, after exporting/publishing, the folder with index.html file and other folders are created, but there is nothing inside the data folder, and the raster does not show on the index.html page.
A similar thing happens if trying with qgis2leaf.
Any idea of what might been wrong?
The raster is a 3 band composite RGB from Sentinel2 bands, saved as rendered raster, projection EPSG:4326.QGIS Version is 2.18.
Raster link: https://www.dropbox.com/s/l1dvxzq37oe10yp/7%20rendered.tif?dl=0


texts: GeoJSON opening hyperlink to local file in the local application instead of browser

texts:
I have got a GeoJSON file with link to the local file, which works.

How to write hyperlinks to local files in GeoJSON properties?

Continuing the question above I would like to have this link sorted directly to the Windows instead the Google Chrome (or another browser) directory.

I found a couple solutions:

https://en.wikipedia.org/wiki/File_URI_scheme

https://stackoverflow.com/questions/7835836/html-link-to-local-file-and-open-in-local-application

But it hasn't help me so far.

For a convenient purpose, I would like to have a folder window popped up instead of the folder directory in Chrome.

Is it possible?


texts: update query with st_intersects() is not finding results

texts:
So I am trying to identify which items from the requests table fall into some particular district from the district table using postgis. Basically, I am writing an UPDATE query that will take the district number from the district table and put that into the district field of the requests table. Here is the query that I have been using so far, but it does not return any rows.

Note that the requests table usesPOINT geometry while the district table is a MULTIPOLYGON.

 update requests
 set req_district = districts.district
 from districts
 where st_intersects(requests.geom, districts.geom);

Note sure why such a simple query would not work. Am I missing something?


texts: Convert .mdb file shape area and length units to meter with Qgis

texts:
I have a personal geodatabase file (.mdb file), I open it with QGIS Las Palmas on windows 7.
It is displayed perfect, but when I open table attributes for polygons, shape_area and shape_length have an unit that I don't understand, 100% not in meter or km, my crs is WGS84.
How to convert these units in the table to meters?!! in order to save it later as csv?


texts:
I am working with a layer of potential sites for security cameras and I want to create a viewshed from each potential site. I have a point layer of XY data that shows the location of each camera, but no Z data. I want to raise each camera off the ground by 30 feet or so. What's the easiest way to go about doing this? I am working with ArcGIS Pro with an Advanced License with Spatial Analyst add-on.
So far I have tried the "Add Z Information" tool, but so far that has either only filled Z-titled field with null values, or given me an error telling me that "The input feature class must have Z values."


texts:
I am developing GIS Portal using OpenLayers, I use WFS GetFeature to retrieve some data like bellow:

var layer = map.getLayersByName("pf_trecho_at");
var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
var protocol = new OpenLayers.Protocol.WFS.fromWMSLayer(layer[0], {
                    url: "/geoserver/wfs",
                    featurePrefix: 'light',
                    readFormat: new OpenLayers.Format.GeoJSON(),
                    outputFormat: "JSON",
                    extractAttributes: true
                });
control = new OpenLayers.Control.GetFeature({
            protocol: protocol,
            box: true,
            hover: true,
            multipleKey: "shiftKey",
            toggleKey: "ctrlKey"
        });

control.events.register("featureselected", this, function(e) {
            polygonLayer.addFeatures([e.feature]);

            this.displayPopup(e, 'pf_trecho_at');
        });
        control.events.register("featureunselected", this, function(e) {
            polygonLayer.removeFeatures([e.feature]);
        });

map.addLayer(polygonLayer);
map.addControl(control);
control.activate();

My doubt is, the selection control draw a rectangle to select the features, is it possible to draw a circle to select then?


texts: Checking if a geometry is NULL in Oracle Spatial

texts:
I'm working on an exercise in Oracle Spatial. I want to check if two geometries overlap. I need to use SDO_GEOM.SDO_INTERSECTION to do so, and that's my main difficulty (I know how to do it with RELATE or DISTANCE). So, I'm calling the function and it's returning a geometry:

 geomIntersection := SDO_GEOM.SDO_INTERSECTION(geom1,dim,geom2,dim);

How can I check if this geometry is NULL? What does the function return if the two geometries don't have intersection?

EDIT: I'm trying this in SQL Developer 18.2.0.183.

The Oracle version is: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production


texts: Bind GNSS receiver with android app over bluetooth

texts:
I'm looking to integrate a GNSS receiver with a Smartphone app. I've found only GNSS receivers that are meant to communicate only with their mobile interface, they don't provide any documentation for integrating smartphone apps in the workflow of using GNSS receivers.

Any ideas about communicating with existing GNSS receivers? If not, what are the available options ?


texts: Draw a polygon automatically through markers (points) in google maps

texts:
I have a difficult situation, I'm trying to draw a polygon through markers (points), what I need is for the polygon to be drawn automatically after tracing the points.

The problem is that most of the polygons will be irregular, because the points indicate a route through the roads, and the polygon has to draw around those points with 100 meters margin on both sides, and manage to capture the positions Of the bookmarks in a table using javascript.

I put an image referring to what I want to do, the dotted blue line shows the polygon, and the black circles are the points.

I am using javascript and google maps api, I would like to know if what I want to do is possible without using a lot of mathematics and I would need to do it, sorry my English since I do not master it, my language is Spanish.


texts: Converting shapefile to raster using ArcMap?

texts:
How do I convert a shapefile to a raster image using ArcMap 10?

What functions within the conversion toolbox do I use?


texts: How to preserve imported shapefile's original precision decimals in QGIS

texts:
How can I preserve an imported shapefile's original precision decimals in QGIS? Whenever I import an ESRI shapefile into QGIS, it automatically rounds off all fields containing decimals (data type float) into double real number, with 0 precision (only showing the whole number, integer digits, and nothing after the decimal point. I've tried formatting and otherwise changing data type. My only workaround/fix has been to create a new field within QGIS having the correct precision level and then copy the original field's contents into it. But there has to be a way to avoid this.
I am importing the shapefile into QGIS as a vector layer, through the add vector dataset window. I first manipulate the associated DBF file in Stata (import/export DBF file). The fields in question are calculated fields generated in Stata in format float. It doesn't look like the issue is merely one of display. The numbers are rounded to integers when looking through the attribute table, as well as when using the identify features tool. For example, One field in particular has an original possible value range between 0 and 1. Upon import into QGIS everything below 0.5 shows as 0, and everything over 0.5 shows as 1. There is nothing more there.


texts: what I do share data in sqlserver enterprise for server?

texts:
I want to create a web editing services using ArcGIS Server, but the following error occurs when I add an editor task and click on configure. "No Editable layers found".

I am using Microsoft SQL Server Enterprise.
How can I solve this problem?


texts: Limiting raster processing area by geometry

texts:
I have a map with a vector feature dataset of soil types, and a feature dataset of points.

I want to transform the soil dataset to raster, but I only need the results around the points (a buffer with specific distance around all these points) and my area of calculation is huge so processing the whole area takes a lot of time. The normal process that I will have to go through is shown below (left to right). My desired output is the clipped rasterized data on the right side.

Is there any way that instead of using "polygon to raster" for the whole area and then clipping the raster using a buffer around the points, I create the buffer first and then limit the calculations inside the buffer? Calculating the whole area needs a lot of time and creates rasters as huge as 10 GB and I have to do this for many layers.


texts: Converting ArcGIS 10 styles to version 9.3?

texts:
I have a style file (*.style) generated in ArcGIS 10.0.

I need to use symbols from this file on machine with ArcGIS 9.3.

Is there some way to convert style file from format 10.0 to 9.3?


texts: Append georeferenced data from one table to another table in CartoDB

texts:
I have two tables with an identical structure of columns in CartoDB. Both are georeferenced.

I'd like to combine the date of the two tables into one table. In the options menu of CartoDB there is an option 'Append data...', which seems to be not activated.

How to proceed in this case?


texts:
I am trying to run ogr2ogr to convert geojson to FGDB, but running into an interesting edge case. In the below example I have a 'tags' field which is a string list.

{
    "type": "FeatureCollection",
    "features": [{
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [-48.83, -25.47]
        },
        "properties": {
            "a_property": "foo",
            "some_object": {
                "a_property": 1,
                "another_property": 2
            },
            "tags": ["tag01", "tag02", "tag03", "tag04", "tag05", "tag06", "tag07", "tag08", "tag09", "tag10", "tag11", "tag12", "tag13", "tag14", "tag15", "tag16", "tag17", "tag18", "tag19", "tag20"]
        }
    }]
}

Running this command:

ogr2ogr -f FileGDB out.gdb in.json -oo FLATTEN_NESTED_ATTRIBUTES=yes

Will return:

Warning 1: The output driver does not natively support StringList for field tags.
Warning 1: Cannot map OGR field type (StringList)
ERROR 1: Error (-1): Failed converting field type.

Is there any setting which will make ogr2ogr to convert this list to a string? Or something along those lines? Specifically one which does not require knowing the name of the field ahead of time, as it can change. I am hoping to not have to pre-process the json before running through ogr2ogr.

Changing the command to:

ogr2ogr -f FileGDB out.gdb in.json -oo FLATTEN_NESTED_ATTRIBUTES=yes -fieldTypeToString StringList

Is almost what I need actually, but it is truncating the text field to ~80 characters. The field that is actually created in the FGDB is Length 65536 though, so there should be no limit caused by that. Example with 20 tags:

(20:tag01,tag02,tag03,tag04,tag05,tag06,tag07,tag08,tag09,tag10,tag11,...)

Preferred result would be something with all of them in the field such as:

tag01,tag02,tag03,tag04,tag05,tag06,tag07,tag08,tag09,tag10,tag11,tag12,tag13,tag14,tag15,tag16,tag17,tag18,tag19,tag20

I don't care if there are () or a number, or spaces between them even. I just need all of them in the one field.


texts: Troublehsooting QGIS Time Manager in OSX

texts:
Though it worked with a sample .shp layer with 10 points that I fabricated, the plugin isn't working with the larger data set I am trying to use now (a couple thousand points). It correctly identifies the start date, which leads me to believe that there is no issue with the date data. Then again, every point is visible from the start and all the way through the timeline, which rather defeats the purpose of animation.

Thanks for any suggestions on what to do differently / how to fix this


texts: Merge polygon inside SpatialPolygonsDataFrame R

texts:
I have a Formal class SpatiaPolygonsDataFrame that has two polygons inside it, meaning that when I write length(x@polygons) it gives me answer = 2.

How can I merge these two polygons inside the same Formal class SpatiaPolygonsDataFrame?


texts: ArcGIS Portal installation on workgroup machine and AD authentication

texts:
We have typical situation in our new environment:

We have ArcGIS Server10.3.1 in a Domain.
We are setting up ArcGIS Portal 10.3.1 on a DMZ location. As per security they will not add the portal server to the domain, so It remains workgroup.
Server and Portal can communicate with each other through HTTPS.

Can we federate Server with Portal?

Portal need to be authenticated with Active Directory. Is it doable?


texts: topology problem in the python script(arcpy)

texts:
I'm using Python 2.7 and ArcGIS 10.1.
I have one topology problem in my Python script and I don't know how to fix it.
I have one road and I want to select polygons with a query where intersect
with my road(or my road within the polygons).  But my bad road have very small section where intersect with others polygons if I use easy way with a query then
query select all polygons(and polygons where intersect with the small sections), I don't want that I don't need
small road section and I don't want the intersect polygons with this section.
Any idea how to fix that using Python and Arcpy ?


texts: How to handle select query to return numeric value?

texts:
I have the following select Query :

Dim count As Integer
Select count(*) as mycount from some_table into temp_table
Fetch First From temp_table
count = some_table.mycount

But it sends error:

  Expression does not evaluate to string

Now when I saved temp_table to *.tab file it has char column.How to make some_table.mycount a number?

But when the Query is

Select count(*) from some_table into temp_table

It would work but column name is random.


texts:
Using QGIS version 2.18.11
I have an attribute table with a column of over 500K of records that has many missing spellings, abbreviations and erroneous characters that I need cleaned up on a regular basis. I can use regexp in the field calculator but can only run one expression at a time. I need to run approximately 150 expressions.
Like:

regexp_replace("DirtyNames" ,'([-\/~!@#$%^&*{}:"<>?|/.,;=_+]?)', '') and regexp_replace("DirtyNames" ,'TRL', 'TRAIL')

I’m thinking a Python script would likely be the easiest way to do this but don’t know the Python language. The table is “Local_Streets”. The field is “DirtyNames” and the regexp results would go to the “CleanedNames” field.

# Run_Regexp_Statements
####################################
from qgis.utils import iface
from PyQt4.QtCore import QVariant
_DIRTY_FIELD = 'DirtyNames'
_CLEAN_FIELD = 'CleanedNames'
layer = iface.activeLayer()
layer.startEditing()
# Create a field to store the results
layer.dataProvider().addAttributes(
        [QgsField(_CLEAN_FIELD, QVariant.String),
layer.updateFields()

# **WHAT NEEDS TO GO HERE to be able to run the regexp’s ?**
# regexp_replace("DirtyNames" ,'([-\/~!@#$%^&*{}:"<>?|/.,;=_+]?)', '')
# regexp_replace("DirtyNames" ,'TRL', 'TRAIL')

Layer.commitChanges()
print 'Processing complete.'


texts:
I am adding features to a layer that has an extent the size of a state.  Randomly when I add a feature I get an "out of bounds" error.  As you can see in the snapshot below, I have added some lines in yellow.  When I try to add another one in between the yellow lines I get the "out of bounds" error.  Anyone know why i'm getting this random error?

Edit:  Ok, so I used ArcCatalog to re-create my extents.  This did not work either.  I could actually draw a box and a line inside the box would give me an error.  I then created a new MXD and added the layer and it is working fine.  I think there is something wrong with the MXD.  I have been using that same file for years, so I'm going to start working in the new file and see if I get the problem again.


texts:
How do I connect QGIS to an Enterprise geodatabase. I tried connecting it but am getting some error message stating

Error opening connection: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'. [Microsoft][ODBC Driver Manager] Driver's SQLSet ConnectAttr failed QODBC3: Unable to connect

I am getting this error.


texts: High Mountain hillshade is not "natural"

texts:
after generalizing my DHM and extraction of different color-hillshades, I got something like this:

Its not very good, but I used the idea of Imhof generalizing and coloring the hillshade (multishade). Its "digital-round-smooth" like "organic" and not "natural-edged-hard" like I want it to. (Sorry for that kind of english :)

I mean, in natural its a very steep and hard mountain range, and not a hilly "hobbit-land" :)

Do you have any Idea, how to construct it more natural?

Thanks!
Martin


texts: Where is Composition ‣ Paper and Quality panel of QGIS?

texts: A right-click on panel doesn't bring this up and not listed in View/Toolbars or View/Panels ... have a very specific page size so really need to change from default A4.


texts: Not getting output field from Python Toolbox?

texts:
I can't see output field in my simple tool

    def getParameterInfo(self):
    """Define parameter definitions"""

    param0 = arcpy.Parameter(
        name="Input Features",
        displayName="Area",
        direction="Input",
        datatype="DEFeatureClass",
        parameterType="Required")

    param1 = arcpy.Parameter(
        name="Output Features",
        displayName="Output",
        direction="Output",
        datatype="DEFeatureClass",
        parameterType="Derived")

    param1.parameterDependencies = [param0.name]
    param1.schema.clone = True

    parameters = [param0, param1]

    return parameters

I doesn't pass rest of code (toolbox object ...) because I didn't inject there any changes.

What can cause this problem? I used *.pyt.


texts: Google Earth Engine Reprojection to non-EPSG defined CRS

texts: Is it possible to reproject an image in earth engine to non-EPSG defined coordinates? In particular either Goode Homosline (SR-ORG:7619) or Mollweide (ESRI:54009). Passing either to .reproject() returns an error stating that the CRS cannot be parsed.


texts: Problems in Adding AIMS WFS Layers in Openlayers 3.10

texts:
I'm working with AIMS(Autodesk Infrasture Map Studio) and openlayers 3, I have a WFS layers in AIMS Server that i want to display using OL3. it doesn't show any errors, the map appears but the layers does not show. it works with wms ol3, but not wfs.
I'm using latest version of openlayers 3.10.1 and examples of wfs layers http://openlayers.org/en/v3.10.1/examples/vector-wfs.html

Please can anyone help me to fix that? This is my code :

 var vectorSource = new ol.source.Vector({
   format: new ol.format.WFS({
     featureNS: "http://fdo.osgeo.org/schemas/feature/ns224280581",
     featureType: "BRGYBOUNDARY"
   }),
   url: function(extent,resolution, projection) {
   return 'http://192.168.7.7/mapserver2014/mapagent/mapagent.fcgi?service=WFS&version=1.1.0&request=GetFeature&typename=ns224280581:BRGYBOUNDARY&maxFeatures=1000&outputFormat=GML3&srsname=EPSG:4326&bbox=' + extent.join(',') + ',EPSG:3857';
 },
  strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
  maxZoom: 19
  }))
 });
var vector = new ol.layer.Vector({
 source: vectorSource,
  style: new ol.style.Style({
   stroke: new ol.style.Stroke({
   color: 'rgba(0, 0, 255, 1.0)',
   width: 2
  })
    })
 });

  var raster = new ol.layer.Tile({
  source: new ol.source.OSM
 });

  var map = new ol.Map({
   layers: [raster, vector],
   target: document.getElementById('map'),
    view: new ol.View({
     center: ol.proj.transform([120.604169, 15.480071], 'EPSG:4326','EPSG:3857'),
maxZoom: 19,
zoom: 12
  })
});

AIMS WFS Layers
http://192.168.7.7/mapserver2014/mapagent/mapagent.fcgi?service=WFS&version=1.1.0&request=GetFeature&typename=ns224280581:BRGYBOUNDARY&maxFeatures=1000&outputFormat=GML3&srsname=EPSG:4326


texts: How can I get ArcGIS Server to give a GML GetFeatureInfo response?

texts: Although I have read the following document (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005300000228000000) I am still totally unsure about how to enable a gml GetFeatureInfo response from ArcGIS Server 10.0 . Is this something on the client-side that needs to be implemented or something in my GetCapabilities Document?


texts: Earth Engine, how to convert 0 pixel values to transparent or nodata?

texts:
I'm using the following snippet to convert canny edges to black and white to highlight boundaries. However, I want to fill the black area with transparent or NODATA, is there a way to do this in EE?
var final_stacked_canny = ee.Algorithms.CannyEdgeDetector({
  image: final_stacked, threshold: 0.7
}).multiply(255);

var perimeterPixelsCanny = final_stacked_canny.select(1).neq(final_stacked_canny.select(0)).rename('perimeter')
Map.addLayer(perimeterPixelsCanny, {}, "Canny On CCCI + GOSAVI + EVI", false)


texts: Finding the minimum and maximum distance between an observer and a lat/lon bounding box

texts: I have three points in geographic coordinates (latitude, longitude, altitude). One of the points represents an observer, above the Earth. The other two points define a bounding box. I'd like a somewhat efficient way to determine the minimum and maximum straight-line distance between the observer and the edges of the bounding box. I'm concerned with performance over accuracy, so I'm okay with using the spherical model of the Earth for speed gains. Please see the image for a stunning rendition of the aforementioned scenario.


texts: Python add-in won't buffer from output layer

texts:
I have a simple add-in script for Arcmap 10.1 to create a toolbar, select a layer from a drop down list of the current layers in the project, buffer that layer four-miles, then use the resulting four-mile buffer output as an input for a six-mile outside buffer. I have a work flow where I repeatedly need to create a four-mile buffer with a six-mile outside buffer surrounding this. Everything functions up to and including the four-mile buffer layer creation, but I get no six-mile outside buffer being created. I have been working with ESRI support but having trouble resolving this. Any ideas?

import arcpy
import pythonaddins
import os

class ComboBoxClass1(object):
    """Implementation for DataRequestBuffer_addin.combobox (ComboBox)"""
    def __init__(self):
        self.editable = True
        self.enabled = True
        self.dropdownWidth = 'WWWWWWWWWWWWWWWWWWWW'
        self.width = 'WWWWWWWWWWWWWWWWWWWW'
    def onSelChange(self, selection):
        arcpy.env.overwriteOutput = True
        # When a new layer is selected, create a 4 mile buffer around that layer then create a 6 mile buffer surrounding the outside of the 4 mile buffer.
        layer = arcpy.mapping.ListLayers(self.mxd, selection)[0]
        outPath = os.path.dirname(layer.dataSource)
        print outPath

        # Buffer 4 miles
        print 'Buffering %s with 4 mile buffer' % layer
        arcpy.Buffer_analysis(layer, outPath + os.sep + str(layer) + "_4milebuff", "4 Miles", "FULL", "ROUND", "ALL", "")
        buff6 = outPath + os.sep + str(layer) + "_4milebuff"
        # Buffer 6 miles surrounding outside of 4 mile buffer
        print 'Buffering %s with 6 mile outside buffer' % buff6
        arcpy.Buffer_analysis(buff6, outPath + os.sep + str(layer) + "_6milebuffoutside", "6 Miles", "OUTSIDE_ONLY", "ROUND", "ALL", "")
        arcpy.RefreshActiveView()

    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
      # When the combo box has focus, update the combo box with the list of layer names.
        if focused:
                self.mxd = arcpy.mapping.MapDocument('current')
                layers = arcpy.mapping.ListLayers(self.mxd)
                self.items = []
                for layer in layers:
                        self.items.append(layer.name)

    def onEnter(self):
        pass
    def refresh(self):
        pass


texts: How to specify the data to be inserted in the ArcGIS Server REST API's Append function?

texts:
I have a feature layer that is hosted in ArcGIS Server 10.71 and I would like to insert new data into this layer using the ArcGIS Server REST API's Append function.
As shown by the appendUploadFormat parameter, this function supports a variety of formats including shapefile, geodatabase, Excel, etc.
However, I can't see where to actually upload the input dataset - eg there is no "file upload" capability offered by this function.
The appendSourceInfo parameter mentions a sourceUrl sub-parameter, which looks promising as it implies that I can upload the file then reference it by location. But the sourceUrl parameter is not documented in depth, and the appendSourceInfo parameter itself is listed as "only needed when appending data from Excel or CSV".
As an example, how do I tell the Append function where to find an input shapefile that I wish to append to the target feature layer?


texts: how to properly assemble tile requested from WMTS server?

texts:
I am using python and owslib to request a WMTS server for tiles in a given region using EPSG:4326 CRS.

I assemble the tiles with PIL by simply pasting them next to each other.

The image I got seems to have projection problem. Especially when I compare it with the same region I got from a WMS server with the same CRS.

The first image is the WMTS built by rendering tiles:
Don't mind the black border. Also the scale is wrong here. Each layer shows the same distorsion. The band is centered on (48.387943, -4.398273) with a zoom level is 17.

The second image is WMS built:
The bounding box of the band is (-4.404831817347805, 48.37895984341859, -4.391714182652194, 48.39692615658141)

What am I doing wrong ? Is there something else to do that simply pasting the tiles ?

The server is https://tile.geobretagne.fr/gwc02/service/wmts
. There is a WMS server at the same address https://tile.geobretagne.fr/gwc02/service/wms


texts:
I work in an Architecture Analytics firm where all our internal representation of floorplans is based on shapely. We have some open spaces (typically kitchen/living room, but also office space) that we need to split  into different functional spaces.

Whenever this split relies on one single line, shapely.ops.split does the job, but whenever we have inner disconnected walls (a "floating kitchen" or a fireplace) and we need to draw multiple split lines, this function stops working because each split line does not completely isolate two areas (you can "go around"), and the split function only takes one split line at a time.

Is there a way to provide either multiple lines or a split line made of multiple segments?


texts: Extracting the least area image around a Shapely polygon, with rotation allowed

texts:
I have a Shapely polygon

polygon_geom = shapely.wkt.loads(feat['wkt'])

such as:

I can map it onto an image

polygon_pts = np.array(list(polygon_geom.exterior.coords))
plt.imshow(img_array_pre)
plt.plot(polygon_pts[:,0], polygon_pts[:,1])

A naive extraction of the image under the polygon looks like this:

I really want to get the least area extraction of the image under the polygon, with rotation allowed.  The result would look like this:

Is there an operation in Shapely or CV2 or skimage or similar Python package which does this?

This image is from the xView2 challenge.  The xView image set contains 162787 building annotations expressed as polygons.  The side length of a square bounding box enclosing these polygons is distributed as follows:

The distribution shows a long tail of large area chips, which incorporate multiple buildings in most cases.  90 out of 162,787 chips, or about 0.05%, are in the long tail.  The objective here is to minimize the tail, or in other words to reduce the number of chips containing multiple buildings, by reorienting the bounding box.  This tail may or may not be material for machine learning purposes, but it seems better to minimize it if possible.


texts: Why shouldn't data be loaded into enterprise geodatabase logged in with sde user?

texts:
I've read somewhere that it is not good practice to load data into an enterprise geodatabase using the sde user.

I was wondering what the reason for this is?


texts: Remove fields / colums with zero "0" values in shapefile

texts:
I'm working on different project each day. At the end I would like to delete the fields that have zero "0" values in. The fields with the zero's will differ from project to project. So the model should look thru each field and if the field has zero's it must delete the field. In the attached image example I would like to delete DOL_J1 and GYPSUM_1. Because of the amount of project I would like to build a model to automate this.

Will this be possible with ModelBuilder or do I need to use Python? I'm not that familiar with Python and would prefer ModelBuilder.

I have an ArcMap license


texts: gxp_googlegeocoder add to default geoexplorer viewer

texts: I have an opengeo 4.1 running on my webserver (windows). I use the default geoexplorer viewer to share my maps and I am very happy with all the default functions, however I would like to add  the geocoder function as well.  I don't want to build an own custom viewer, because I don't have that knowledge, but I would like to add the geocoder to the default geoexplorer viewer. Is anybody can provide me a solution?


texts: Python Script calling custom model failing during model execution

texts:
I have a python script that calls a model I built in model builder. If I run the model by itself it runs perfectly. If I call the model in the python script, the model errors in various locations. Python is definitely calling the model and running some portions of it.

for GDBThatOverLaps in GDBWithDataOnInstallation:
        addMessage("Appending data from " + GDBThatOverLaps)
        inputWaterArea = GDBThatOverLaps + "\\" + WA
        inputWaterbody = GDBThatOverLaps + "\\" + WB
        arcpy.AddToolbox(r"E:\Scripts_Calculations_and_Tools\RTAM_Tools_Models.tbx")
        arcpy.appendNHD2_rtamModels(installationBoundary, ie, inputWaterArea, targetWaterArea)
        arcpy.appendNHD2_rtamModels(installationBoundary, ie, inputWaterbody, targetWaterbody)

The model is called appendNHD2 and it is found in rtamModels toolbox which is properly imported using the add toolbox method of the arcpy module.

I have checked that all of my variables are proper paths and reference valid data.

Has anyone encountered, and overcome calling a model in python and it erroring?


texts:
I must mention first of all that I am very new to this area... I am developing a GIS application. I created a simple map using geoserver with openlayers, it is all working through apache tomcat - and is connected to postgis/postgresql database. When I click on a point (the points represent weather stations - and stored in database) it is set to display the tablewith all the data like: fid, station_name etc. What I want to do is - to store station_name(I clicked on) in a variable and use for my needs. In this case I was trying to break response.responseText in parts, and get it from there but it never worked... response.responseText - returns all the information and creates the tables. I need to only get ONE value from database. Any ideas!? Any help greatly appriciated!!!

Here is the code:
In this part it is set to read a click and make a response:

map.events.register('click', map, function (e) {

                document.getElementById('nodelist').innerHTML = "Loading... please wait...";
                var params = {
                    REQUEST: "GetFeatureInfo",
                    EXCEPTIONS: "application/vnd.ogc.se_xml",
                    BBOX: map.getExtent().toBBOX(),
                    SERVICE: "WMS",
                    INFO_FORMAT: 'text/html',
                    QUERY_LAYERS: map.layers[0].params.LAYERS,
                    FEATURE_COUNT: 50,
                    Layers: 'map_with_stations',
                    WIDTH: map.size.w,
                    HEIGHT: map.size.h,
                    format: format,
                    styles: map.layers[0].params.STYLES,
                    srs: map.layers[0].params.SRS};

                // handle the wms 1.3 vs wms 1.1 madness
                if(map.layers[0].params.VERSION == "1.3.0") {
                    params.version = "1.3.0";
                    params.j = parseInt(e.xy.x);
                    params.i = parseInt(e.xy.y);
                } else {
                    params.version = "1.1.1";
                    params.x = parseInt(e.xy.x);
                    params.y = parseInt(e.xy.y);
                }

                // merge filters
                if(map.layers[0].params.CQL_FILTER != null) {
                    params.cql_filter = map.layers[0].params.CQL_FILTER;
                }
                if(map.layers[0].params.FILTER != null) {
                    params.filter = map.layers[0].params.FILTER;
                }
                if(map.layers[0].params.FEATUREID) {
                    params.featureid = map.layers[0].params.FEATUREID;
                }
                OpenLayers.loadURL("http://localhost:82/geoserver/wms", params, this, setHTML, setHTML);
                OpenLayers.Event.stop(e);
            });
        }

        // sets the HTML provided into the nodelist element
        function setHTML(response){

            document.getElementById('nodelist').innerHTML = response.responseText;

        };


texts:
I'm using QGIS 2.18.10. I want to open the following WFS into QGIS:

http://www.geoportal.lt/inspire-services/rest/services/INSPIRE/Transport_networks_CommonTransportElements/MapServer/exts/InspireFeatureDownload/service

Found on: https://www.europeandataportal.eu/data/en/dataset/464351d4-ca15-4e7a-8f00-61287a47f38b/resource/2089fa44-17cf-49f4-97bf-0710a9d241fc

I downloaded and installed the ArcGIS REST API Connector, but I don't know what kind of information they want in the box 'Filter'.

As it's a WFS I tried to open the file with the regular 'Add WFS Layer' in the layer toolbox, but I get an error: unexpected end of file.

I found a lot of data like this (REST Service), but I'm wondering what's going wrong. Or what I'm doing wrong.


texts: Is there a way to save reclassed intervals done on-the-fly as a layer without use of the reclass tool? I lost the reclass intervals I've created on-the-fly.


texts: I have a large polygon shapefile with lots of features from a model output, I need to remove anomalous features which are joined by a single vertex and part of a cluster of two. (example highlighted below)


texts: Exporting LST median values of a time series in Google EE to CSV file

texts:
I'm new to Google EE and I'm still figuring out how this works.

I want to export into a table the median values of LST from a shapefile for three years. I can do it for one year but If I set the time series more than a year the column with the median values in the exported CSV disappear.

Can you check if I'm missing something?

/* 1- Select Inputs */
var district = 'name of the district' ;
var folder = "path to the folder";
var mod11a1 = ee.ImageCollection("MODIS/006/MOD11A1");

/* 2- Input Region */
var aoi = ee.FeatureCollection('path to the shapefile')
  .filter(ee.Filter.eq('NAME', district));

var mod11a1 = ee.ImageCollection("MODIS/006/MOD11A1")
  .filter(ee.Filter.date('2018-01-01','2019-12-31'));
  //.filter(ee.Filter.date('2019-01-01','2019-01-31'));

/* 3- Filter Image collections */
var lst = mod11a1.select('LST_Day_1km');

var imageCollection = lst.map(function(image){
  var result = image.reduceRegion({
    reducer: ee.Reducer.median(),
    geometry:aoi,
    scale: 1000,
    maxPixels: 1e13
  });
  return ee.Image(image.setMulti(result));
});

/* 4 - Export  */
Export.table.toDrive({
  collection: imageCollection,
  description: district,
  folder: folder,
  fileFormat: 'CSV'
});


texts: GIS software that can work only on Ubuntu Terminal?

texts:
Recently, I tried to open a QGIS project on Ubuntu, but I can only use Ubuntu's terminal for that which gives me the following error:

    QGIS starting in non-interactive mode not supported.
You are seeing this message most likely because you have no DISPLAY environment variable set.

So I understand QGIS can't be used without a graphic device.

Is there any (Open Source) GIS software that allows you to work only through Ubuntu's terminal or at least one that lets you open projects only using Ubuntu's terminal (where the project could have been made through a graphic device)?


texts: How to split a polygon into multiples sections in QGIS?

texts:
I am working on QGIS latest version 2.12.3.

I am digitizing a polygon. It represents a riparian buffer of a river. The polygon made a continuous « loop » with a widht of 50 meters. I want to split my polygon into 8 sections that can be dealt with seperatly.

My problem is that i am unable to split to polygon. When i am using the « splitting » tool in advenced digitizing menu, the polygon does not split. It says « Invalid Geometry ». Therefore, the poylgon doesn't split. It suprise me because the same request use to work in others circumstances.

Do you have any clues on the matters ?


texts: RAM overflow with new Distance tools: Optimal Path as Line

texts:
I have set up a workflow for least-cost path analysis using the legacy Distance tools of the Spatial Analyst. Trying to convert this into the new toolsets now, the new tool Distance Accumulation produces reasonable outputs and I can clearly see a difference from the legacy tools. However, the final step using Optimal Path as Line is using RAM cumulatively and after a couple of minutes, I am out of memory (32 GB...). I have tried to reduce the workload by just calculating one path, but that also fails due to "insufficient" memory.
Additionally, The output of Distance Accumulation produces a backlink raster with values 0-360 (degrees), whereas Optimal Path as Line demands 8-bit input (0-255). I rescaled it to get the tool moving in the first place.
These new tools feel pretty "alpha", hope someone can share some experiences and workarounds.
Just for some more context, I have a workflow using the legacy tools which processes 1200 lines between 35 nodes in about 4 hours time and there are no memory issues.
Using ArcGIS Pro 2.7.


texts:
I have a world map. I need random point geometry. So, how can I randomly generate point coordinates? Any programming language. Also, I am using SRID 4326.

Any programming language.


texts: Transform rectangle from decimal degrees to Cartesian coordinates

texts:
I'm trying to achieve the following:

Given four coordinates (lat, lng) decimal degrees and a query coordinate within the formed shape, how can I transform these coordinates into Cartesian space where ideally, one of the corner points is the origin and the top right is (100, 100) and they form a rectangle? Also, how would I then get the coordinates of the query point?
I've found various programming language specific libraries that do transformations like these in Cartesian space between two shapes, but I'd be interested in a method to determine this without any specific programming language libraries that also takes the fact into account that I'm starting in decimal degrees.
Any hints?


texts: Getting subset of pixels of raster using ArcPy without Advanced license?

texts:
I am looking for a good solution to get a particular subset of raster pixels.
For example:

I have raster 5x5
I need to clip:

--column = 1

--row between 1 and 5

What will be the best method?

I was trying to get results using NumPy array by slicing it and exporting it back to raster.

I am wondering if there is much better way of doing it.

Here is my code. The problem is - I cannot export my numpy array slice  to raster, because it is a 1 dimentional array.

    import arcpy, numpy
    arcpy.env.overwriteOutput = True

    raster_path = r'D:\raster.tif'
    raster = arcpy.Raster(raster_path)
    lowerLeft = arcpy.Point(raster.extent.XMin, raster.extent.YMin)

    raster_numpy = arcpy.RasterToNumPyArray(friction_raster_buffered_path, lowerLeft)
    x_length = raster_numpy.shape[0]
    print raster_numpy [0,1:x_length-1]
    arcpy.NumPyArrayToRaster(raster_numpy [0,1:x_length-1], lowerLeft, raster.meanCellHeight).save(r'd:\rstrLC.tif')

Error: ValueError: Argument in_array: A two or three dimensional NumPy array is required.


texts: How to draw parallel or curved labels for OSM data in QGIS?

texts:
I'm trying to recreate a Google style map using OpenStreetMap data and QGIS. I've been following underdarks many wonderful guides but am getting stuck at the labels. The OSM data was taken from geofabrik and imported into a postgreSQL/postgis database using osm2pgsql. When I try to label the roads it seems to place them as points and does not give the option for parallel or curved labeling. You can see the result below.

When I click on the advanced tab for labeling all I see are the data defined placement options and no check box for curved or parallel labeling. I'm new to QGIS so I hope I'm missing something really simple.


texts:
I am using autocad for students 2017; I have tried to use the compiled command, but it has not worked. Also, I have tried the command, Mapimport and AutoCad doesn't even found it.

How can I import a shapefile into AutoCad in order to get some measurements I'm interested with?


texts: Efficient raster sampling of billions of polygons (bounding boxes)

texts:
How can a raster be computed efficiently (in Python), given a set consisting of billions of bounding boxes (read sequentially from a file), and given that the raster values for each cell should give the number of overlapping bounding boxes?

For a 4000 * 4000 raster

I've timed numpy matrix creation:

$ python -m timeit 'import numpy' 'a = numpy.zeros(shape=(4000,4000))'
10 loops, best of 3: 51.7 msec per loop

Standard python matrix creation:

$ python -m timeit 'a = 4000*[0]' 'for i in range(4000):' ' a[i]=4000*[0]'
10 loops, best of 3: 218 msec per loop

So numpy is faster, but still 50 msec per loop, with one billion iterations, yields running time equal to about a year (0.05msec * 1000000000 / 60 / 60 / 24 / 365 = 1.5 years)

So it's not an option to sample each polygon. What is a typical approach for this problem?


texts: Generating random points within series of polygons according to density using R

texts:
I have a city that is made up of a number of wards, each with an unequal population. I would like to generate a set of "random" points within the city, but the randomness is influenced by the population size, eg wards with greater populations are likley to have more points within them. Here is some mock code:

library(rgdal)
library(sp)

remove(list = ls())

square <- rbind(c(0,10,10,0,0,0,10,10),
            c(10,20,20,10,0,0,10,10),
            c(0,10,10,0,10,10,20,20),
            c(10,20,20,10,10,10,20,20),
            c(20,40,40,20,0,0,40,40))
ID <- c("A","B","C","D","E")

polys.sp <- SpatialPolygons(list(
  Polygons(list(Polygon(matrix(square[1, ], ncol=2, byrow=FALSE))), ID[1]),
  Polygons(list(Polygon(matrix(square[2, ], ncol=2, byrow=FALSE))), ID[2]),
  Polygons(list(Polygon(matrix(square[3, ], ncol=2, byrow=FALSE))), ID[3]),
  Polygons(list(Polygon(matrix(square[4, ], ncol=2, byrow=FALSE))), ID[4]),
  Polygons(list(Polygon(matrix(square[5, ], ncol=2, byrow=FALSE))), ID[5])
))

plot(polys.sp)

sample.df <- data.frame(population=c(500,250,100,100,50))
rownames(sample.df) <- ID

polys.spdf <- SpatialPolygonsDataFrame(polys.sp,data=sample.df)

Since ward A is the most populous (50%) it should get roughly half the random points within it. If I have 17 random points to generate, it should have either 8 or 9 points. I have thought about generating eg 17 * (xi/(500+250+100+100+50)) points, where xi is the ward population, in each ward, but due to rounding, this will not allways sum to 17 over the 5 wards. This is important, it must sum to the required number of points.


texts: How to place an numpy array into GeoTIFF image using python-gdal

texts:
I am attempting to export data of varying scales into GeoTIFF images...a new method for me.  The problem I'm running into is when using the GDT_Byte pixel type, data values < 0 and > 256 are not represented (they are black or white), and when I use GDT_Float32 or other pixel types, I get white, or transparent images.  How can I represent a wider range of values?

This example creates an image with values of zero of less being black, and greater then 256 being white.  Alternate pixel types result in transparent images.

from osgeo import gdal, osr, ogr
import numpy as np
#create a bogus grid
mag_grid = np.arange(-500, 500, .1).reshape((100, 100))
lats = np.arange(-10,90,1.)
lons = np.arange(-10,90,1.)

xres = lons[1] - lons[0]
yres = lats[1] - lats[0]
ysize = len(lats)
xsize = len(lons)
ulx = lons[0] - (xres / 2.)
uly = lats[-1] - (yres / 2.)

driver = gdal.GetDriverByName('GTiff')
ds = driver.Create('output.tif',
               xsize, ysize, 1, gdal.GDT_Byte, )
##################################
#pixel type of gdal.GDT_Float32 results in transparent image
##################################

# this assumes the projection is Geographic lat/lon WGS 84
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
ds.SetProjection(srs.ExportToWkt())
gt = [ulx, xres, 0, uly, 0, yres ]
ds.SetGeoTransform(gt)
outband=ds.GetRasterBand(1)
outband.SetStatistics(np.min(mag_grid), np.max(mag_grid), np.average(mag_grid), np.std(mag_grid))
outband.WriteArray(mag_grid)
ds = None


texts: How to split a layer by attributes in Qgis?

texts:
I have one layer with multiples Classes (Casa[550], Stock[10], Estrada[20], etc) and I´d like to have those classes as layers.

E.g: Layer Casa[550], Layer Stock[10], Layer Estrada[20].

Any ideas for a specific plug-in or another solution?

Qgis 2.18


texts: Is there are way to import non-geo JSON files into QGIS?

texts:
Here is a json file containing various attributes relating to countries. However, it does not contain any geographic data.

http://bost.ocks.org/mike/nations/nations.json

I would like to join these attributes with another file that has the geographic data for the countries. But I can't figure out how to get it into QGIS.

Is there a way of loading non-geojson json files into QGIS?


texts: constant deviation projecting lat lon to itm(israel tranverse mercator

texts:
i use two different ways to project lat lon data taken from google earth to ITM (Israel Transverse Mercator) and export the data to arcmap  same ways i try to unproject ITM data and export the data to google earth both ways i get a deviation of about 90 m
 first way: cs2c2  -
  cs2cs +proj=longlat +ellps=WGS84 +datum=WGS84 +to +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.000007 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +units=m file.txt>output.txt
second way: DNRgarmin : i downloaded DNRgarmin open a shp file or a kml file and try to convert it

both ways i get a deviation of about 90m does anyone have an idea wht i am doing wrong?


texts: How do I decide what sort of spatial index to build for a SQL Server table with a Geometry column?

texts:
Let’s say an organization manages a lot of GIS data stored in Sql Server and leverages Esri software. To ensure that users can access the data with reasonable speed, I want to make sure the spatial indices are tuned for performance.

What criteria should I use to configure the parameters of a spatial index for a SQL Server table that has a GEOMETRY column?

I am looking for “rules of thumb” that are widely applicable to many data sets of varying specifications.


texts: Mapserver map file reading WMTS and serving WMS?

texts:
I need to create a Mapserver map file that would read maps from (external) WMTS interface and serve them as WMS.

How should I get started? Could anyone link to useful instructions or give an example?


texts: Help with gap mask filling and Landsat 7 in ArcGIS 10

texts:
I have downloaded images from Landsat 7 ETM+ SLC-off with corresponding gap mask. Which is the best method for using it with ArcGIS 10?

I tried the mask and statistical method described in ArcGIS help but I have some troubles, (after I apply the mask function, the statistical function need the input raster that is somewhere in a temporary file that can't access it.)


texts: PostgreSQL : total length of roads in polygon

texts:
I have 2 tables : wgo (lines) and wbn (polygons)
With this code, I can display the length of each road inside a polygon. If I have a polygon with 2 roads in it, as a result I get 2 rows with the 2 lengths displayed.

But what I really want, is the total length of roads in the polygon, so I want to SUM them up.. How can this be done ?

SELECT wbn_uidn, wgo_uidn, ST_Length(ST_Intersection(wgo_geom,wbn_geom))
FROM wbn, wgo
WHERE ST_Intersects(wgo_geom,wbn_geom)='t'


texts: Python Matplotlib Combine legend from histogram and lines

texts:
I wrote a Python script that uses matplotlib twinx to combine a histogram and some line functions plot as can see in the figure. However I was not capable of combining both legends (nb of points and lines).
How can I do that?
I tryed get_legend_handles_labels() and fig.legend() with no success.

import matplotlib.pyplot as plt
import numpy

numpy.random.seed(19680801)

# example data
mu = 5000  # mean of distribution
sigma = 1500  # standard deviation of distribution
r1 = mu + sigma * numpy.random.randn(437)
sug_spec = numpy.arange(0, 10001, 100)
accuracy = sug_spec/2
precision = sug_spec/3
uncertainty = sug_spec/4

num_bins = 100
bins = numpy.arange(0, 10100, num_bins)

fig, ax = plt.subplots()

ax.set_xlabel('Surface Reflectance Truth')

# Plot lines
color = 'tab:pink'
ax.plot(bins, sug_spec, color=color)
color = 'tab:red'
ax.plot(bins, accuracy, color=color)
color = 'tab:green'
ax.plot(bins, precision, color=color)
color = 'tab:blue'
ax.plot(bins, uncertainty, color=color)

# Instantiate a second axes that shares the same x-axis
ax2 = ax.twinx()

# Order of each plot (Front, Back)
ax.set_zorder(2)
ax2.set_zorder(1)
ax.patch.set_visible(False)

# Remove scientific notation
ax2.ticklabel_format(style='plain')

# the histogram of the data
n, bins, patches = ax2.hist(r1, num_bins, edgecolor="k")

ax.legend(['suggested specs','accuracy','precision','uncertainty'], frameon=False, loc=1)
ax2.legend(['nb of points'], frameon=False, loc=5)

plt.show()


texts: Getting version of connected database using ArcPy?

texts:
I wrote a toolbox script that allows a user to append points from a text file to a feature class. The user picks a text file and a feature class from a database he is connected to, the script then modifies the text file to add some additional parameters, runs arcpy.MakeXYEventLayer_management to create a layer and then arcpy.Append_management to add the data to the selected feature class.
The script works, but I can't control to which version of the database the data is added. It seems to depend on which version of the database the user might be currently connected or was connected the last time the database was used.

Is there a way to display the version of the database that is going to be used or an easy way to allow the user to choose the version?

I could list all versions of the database the user is connected to using arcpy.da.ListVersions and populate another input box with all versions after the feature class has been selected, but what would I have to do to append to the selected version?