texts: Mapbox GL - How to populate custom icons using vector source?

texts:
When reading examples of Mapbox GL using custom markers,  I've seen examples - ie:
https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/
where geojson data is hard coded (geometry) and icons can be custom selected for the map...

In a quick example that I've created :   https://jsfiddle.net/claybox7/cmh3qw22/8/
I'm using a 'vector'  geometry  source saved in mapbox .
When it is run, it will show circles of the provided long/lat from my data source.

How would I create markers  like the  "icon": "monument" ones used in the mapbox gl example above instead of circles to represent my geometry points?


texts: Georeferenced image goes "out of scale" upon reopening in ArcMap

texts:
We have several ArcGIS 10 map documents containing fully georeferenced images (projected UTM 16N). We also digitised them by tracing over features in the image into shapefiles. Everything seems to save correctly.

However, when we re-open the map document in ArcMap, the georeferenced image goes completely off scale. It is still rotated correctly, but sometimes it ends up multiple times bigger (or smaller!) than it should be, and is not at the right place.

We are baffled by this phenomenon. Can anyone help with this?

Thanks.


texts: Sum of classes from ee.Reducer.frequencyHistogram() not matching ee.Reducer.sum() in Earth Engine

texts:
When I calculate the frequencies of each of my classes in a supervised classification I made the sums of these classes so not equal the number provided with the ee.Reducer.sum() value. Why is this?
//Frequencies of Classes
var bir_frequency = svm.reduceRegion({
  reducer:ee.Reducer.frequencyHistogram(),
  geometry:bir,
  scale:1,
  maxPixels: 10e10
});
var bir_dict = ee.Dictionary(bir_frequency.get('classification'));
print(bir_dict, "Pixel Counts for Classes");
//Total
var bir_sum = svm.reduceRegion({
  reducer:ee.Reducer.sum(),
  geometry:bir,
  scale:1,
  maxPixels:10e10
});
print(bir_sum, "Total Pixels");

link to full code: https://code.earthengine.google.com/4d66704fa599ceeedafae24d0a3ccf01
link to bir asset: https://code.earthengine.google.com/?asset=users/anna_odell/bir_Boundary2005
link to points asset: https://code.earthengine.google.com/?asset=users/anna_odell/trainingpoints3


texts: Extracting road data from shapefile using ArcMap

texts:
I have a road network shapefile of a city. I want to extract those roads which have 80ft or more than that width.
Is there any tool in ArcMap to extract the data?


texts: Convert Symbology to Representation in arcpy

texts:
I know in ArcMap 10.6, there is feature called : "Convert Symbology to Representation" which one can execute by right clicking on a feature class  in Table Of Contents.
I like to know how to Convert Symbology to Representation, in a Python script tool using ArcPy library. Basically I like to do it in a script automatically rather than manually.


texts: How to exactly copy one installation to another PC?

texts:
I've installed qgis on one workstation using OSGeo4w.
I've launched the installer from a local folder and I have downloaded source files on a remote mapped drive.
Frequently I relaunch OSGeo4w to update installation.
All works fine!

Now I need to have the same installation (same executable version, same plugin etc) on a laptop.
How can I do that?

Obviously I use the remote folder where I had downloaded source files to install software on the laptop but...: what are the folders that I have to sync from each machine? Where OSGeo4w save it's config? And where are applications config and plug-in?
I don't know if the question is clear but "basically" I need to have two identical installations on two different machine.

Thank you in advance.


texts: Generate arc from projection coordinates

texts:
I have a mind to generate arc from given parameters:

start point coordinates
arcDistance
arcBearing
arcOrigin coordinates.

My concept is, calculate the end point of arc (function geo.sphere.destination from geo-py) and then obtain my arc as an  circular approximation to a curve between two known points.
My arcDistance is in Nautical miles, coordinates in decimal degrees WGS84 -> so I have to convert my distance to meters first and reproject coordinates to EPSG:3857.

It sounds quite obvious, I hope my mistake is easy to detect...

This is the apparent poly, that I have to create by its initial parameters are: segment coordinates and arc parameters.

from geo import sphere
import numpy as np
from numpy import cos, sin, arccos

num = 30    # number of vertices
dist = 16.2*1.852*1000 # conversion from nautical miles to meters
bearing = 20.2
xc, yc = 129.77333, 62.09333    # center coordinates
start_point = (129.97278, 62.345554)

end_point = sphere.destination(start_point, dist, bearing)
start3857 = sphere.from4326_to3857(start_point)
end3857 = sphere.from4326_to3857(end_point)
center3857 = sphere.from4326_to3857((xc, yc))
start_t = inv_parametric_circle(start3857[0], center3857[0], dist)
end_t = inv_parametric_circle(end3857[0], center3857[0], dist)
arc_T = np.linspace(start_t, end_t, num)
X, Y = parametric_circle(arc_T, center3857[0], center3857[1], dist)
print(LineString(list(zip(X, Y))))

It throws an error

  RuntimeWarning: invalid value encountered in arccos

It happens because (x-xc)/R in arccos for end point > 1.

According to the second link, the arc in generated counter-clockwise orientation. But mine is clockwise (it is defined).
Is it the thing? I think it is no sence what comes first in np.linspace(start_t, end_t, num).

When I suppose the end point is (129.9022, 61.8311) (pick from the poly in QGIS) I get the violet arc. Where I am wrong?

ADD initial data

pt1. Latitude, Longitude = 61.8311099249838, 129.902226489833

pt2. Latitude, Longitude = 61.9083321543816, 129.540004313443

pt3. Latitude, Longitude = 62.0066654815873, 129.568337657929

pt4. Latitude, Longitude = 62.0849988070938, 129.685004324387

pt5. arcOriginLocation. Latitude, Longitude = 62.0933321372233, 129.773337650299

Latitude, Longitude = 62.3455543397702, 129.972782111281


texts:
I am a newbie in FME and is trying to accomplish a similar implementation like this: Merging edited data back into ArcSDE master geodatabase?

But we are still in the proof of concept stage.So we are just starting of with 2 non-spatial databases (master and updated) being populated by FME using a single shapefile. Initially both database are equal. Also, we added a FeatureID column using the Counter transformer in FME.

We made a couple of updates to the updated database so that we can try sync up the updates to the master database. We are using this sample as reference: http://fmepedia.safe.com/articles/Samples_and_Demos/Creating-a-Unique-identifier-using-CRCCalculator.

During the population of the master database. We added a "CRC" column which we set as a varchar(100). Before writing to the master database, there is a CRCCalculator added so that we can populate the CRC column.

Syncing process:
- we have 2 readers which is set for the update db and master db.
- the update db will pass through a CRCCalculator first and will then be passed to a FeatureMerger as a supplier.
- the master db will pass through a AttributeRenamer for the CRC column and will then be passed to the same FeatureMerger as the requestor.

CRCCalculator parameters:
- Attributes = all of the columns
- Calculate CRC = Geometry and Attributes
- CRC output attribute = CRC

I have added an inspector in the "Complete" output port of the FeatureMerger and noticed that all of the CRC(from update db) and CRC_Master(from master db) are not equal, even though there are no changes to those rows. So FME is thinking that all of the data have changed.

What am i doing wrong in the syncing process?

Here is a screenshot of how the syncing process looks in FME:

UPDATE
- So i tried to test this again and added another CRCCalculator for the Master database. So now i can see 3 CRC columns in the FeatureMerger results. I noticed that the CRC value that was created in the translation matched and the CRC value that was saved in the Master database did not.

Now im wondering if the CRCCalculator changes something in every translation.

thanks.


texts: OpenLayers: how to access an event attribute value from WMS GetFeatureInfo

texts:
My OpenLayers script tries to get some features values from a WMS (which is a shapefile), to open a page in function of the attribute value returned.

My problem is the following:
- the code returns a GET which contains the html code for displaying a table with each parameter names/values, and the value do really correspond to the clicked polygon. I can print the same values from event.text
- event.features is empty!

Obviously that's not a proxy problem (since I get the values back). How can I fix the code to access the attributes values?

Here is the code:

var extent = new OpenLayers.Bounds(-180,-90,180,90);
var options = {restrictedExtent:extent};
var map = new OpenLayers.Map("map-id", options);
var imagery = new OpenLayers.Layer.WMS(
        "Global Imagery",
        "http://maps.opengeo.org/geowebcache/service/wms",
        {layers: "bluemarble", isBaseLayer:false}
    );

var lmes=new OpenLayers.Layer.WMS(
        "LMEs",
        "http://aaa.bbb.ccc.dd/geoserver/ocean/wms",
        {layers:'ocean:LME66', transparent:true, styles:'LMES_colors'},
        {isBaseLayer:false, opacity:1, singleTile:true, visibility:true}
    );
map.addLayers([lmes, imagery]);
map.zoomToMaxExtent();

function toggleRestrictedExtent() {
      if(map.restrictedExtent == null) {
        map.setOptions({restrictedExtent: extent});
      } else {
        map.setOptions({restrictedExtent: null});
      }
    }
    var info = new OpenLayers.Control.WMSGetFeatureInfo({
       url:'http://aaa.bbb.ccc.ddd/geoserver/ocean/wms',
       title:'identify feature by clicking',
       output:'features',

       eventListeners: {
        getfeatureinfo: function(event) {
          console.log(event);
          console.log(event.features);
          console.log(event.text);
        }
       }
    });

map.addControl(info);
info.activate();


texts: Identifying polygons that intersect with another polygon using ArcGIS Desktop?

texts:
I have two polygon layers, a vegetation layer and a treatment layer. I want to add a field to the attribute layer of the vegetation layer to indicate if any part of the polygon has been treated (overlaps with a treatment layer).

For the above example - I want an attribute table that ends up looking like

I do not want to intersect the two layers - I need to keep the full polygons in the vegetation layer, I just want to know if they've been treated. There are too many polygons to do this manually.


texts: Left click then right click is treated as double click in Mac QGIS Layers

texts:
I am having an issue with QGIS 1.8.0 on my Mac where I left click then right click which gets treated as a double click if the timing is too close together and brings up the Layer Properties box.

This usually happens when I am focused on a different program, left click to gain QGIS' focus and then right click to get a context menu for a layer. This is force of habit I guess.

Is there a way to disable the Layer Properties from appearing with a
double click? I know that you can choose between the Attribute Table
and the Properties Box.
Should this issue be added as a bug report to QGIS?


texts: Having trouble to get a nice plot of a DEM

texts:
With the explanations that I got on this post (Plot a surface with a DEM and mplot3d) I was able to plot a DEM (that I made with QGIS) with matplotlib on Python.

However I am still having trouble to get a nice plot.

Here is the code:

import gdal
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np

# maido is the name of a mountain
# tipe is the name of a french school project

# 1) opening maido geotiff as an array
maido = gdal.Open('dem_maido_tipe.tif')
dem_maido = maido.ReadAsArray()

# 2) transformation of coordinates
columns = maido.RasterXSize
rows = maido.RasterYSize
gt = maido.GetGeoTransform()

x = (columns * gt[1]) + gt[0]
y = (rows * gt[5]) + gt[3]

X = np.arange(gt[0], x, gt[1])
Y = np.arange(gt[3], y, gt[5])

# 3) creation of a simple grid without interpolation
X, Y = np.meshgrid(X, Y)

# 4) plot the raster
fig, axes = plt.subplots(subplot_kw={'projection': '3d'})
axes.plot_surface(X, Y, dem_maido, rstride=1, cstride=1, cmap=cm.coolwarm,linewidth=0, antialiased=False)

Here is what I get:

Here is the GeoTiff file that I used (it is uploaded on my own google account don't worry):
https://drive.google.com/open?id=0B7P95aWmH4DUQk9SbzhNUVNINGs

I am getting huge negative values and I don't know why.

EDIT: I deleted the negative values in the last row and the last column

print "\n------------------\n"
print dem_maido

dem_maido = np.delete(dem_maido, len(dem_maido)-1, axis = 0)
X = np.delete(X, len(X)-1, axis = 0)
Y = np.delete(Y, len(Y)-1, axis = 0)

print "\n------------------\n"
print dem_maido

dem_maido = np.delete(dem_maido, len(dem_maido[0])-1, axis = 1)
X = np.delete(X, len(X[0])-1, axis = 1)
Y = np.delete(Y, len(Y[0])-1, axis = 1)

print "\n------------------\n"
print dem_maido


texts: Looking to run QGIS basics course, are there any legal requirements?

texts:
I've been asked by several people to run a QGIS basics course as there is a real demand for some of our subcontractors to be able to manipulate their own data but at a very simple level.
My question is, where QGIS is open source software, are there any requirements for the course to be verified or certified? If so, what is the process?


texts: Two shapefiles (polygon) with same reference system have different extent

texts:
I have two similar geodatabase feature class (polygons) layers provided by two different sources in the WGS 1984 system and they have the same angular area (decimal degree). While projecting in World-cylindrical equal area (the projection system I need) they are different by more than 5 sq km.

What is the reason?

I need both of them to have the same area in sq km or ha or miles etc.

I am working in ArcGIS 10.3.1


texts: precision of positionalongline and/or SpatialJoin

texts:
I've been using positionAlongLine to create points that are supposed to line up with the lines from which they are derived.

When I tried to use SpatialJoin_analysis with the match_argument set to "INTERSECT" , I'm not getting all of my points represented in the output point set. After zooming in ridiculously far on an example of one of my errant positionAlongLine-generated points and the original linework, I can see that the point is 0.000025 meters away from the line that it is based on.

I really just want my SpatialJoin_analysis to work with "INTERSECT".   I've tried specifying a search_radius of 1 with no improvement in results. Short of continuing to use "CLOSEST" as a workaround, which is a bit cheesy, I'm wondering if there is a way to improve the precision of the coordinates I get with positionAlongLine or the NumPyArrayToFeatureClass I use to bring the coords back into ArcGIS to create the points featureclass. I'm also happy to do something to make the SpatialJoin_analysis handle the gap, too.

---Update 1---

Tried @radouxju's suggestion. Can't seem to get NumpyArrayToFeatureClass to create anything w/in a FD. Results just appear at top of fgdb (w/no warnings, which seems odd). Copying the source FC to the top of the fgdb and then doing the analysis doesn't remove the shift.

Going to isolate the point geometry in my numpy array to see if that's the source of the error.

Guessing the solution will not be to fix this, but to improve the SpatialJoin....

---Update 2---

Checked the coordinates in my numpy array and they do fall on top of the line (at least as close as I can visually verify), but NumpyArrayToFeatureClass is not honoring the full precision (dropping decimal places) in the points of the featureclass it creates.


texts: Adding print function to GeoExt MapPanel?

texts:
I´m trying to add a print function to my GeoExt MapPanel, using the following code:

bbar: ["->", {
                    text: "Print...",
                    handler: function() {
                        var printDialog = new Ext.Window({
                                items: [new GeoExt.PrintMapPanel({
                                    sourceMap: mapPanel,
                                    printProvider: new GeoExt.data.PrintProvider({
                                        method: "GET",
                                        url: "/geoserver/pdf",

                                        listeners: {
                                        "loadcapabilities": function() {
                                        var printPage = new GeoExt.data.PrintPage();
                                            printPage.fit(mapPanel, true);
                                            printProvider.print(mapPanel, printPage);
                                        }
                                        },
                                            customParams: {
                                                mapTitle: "LVR WebGIS",
                                                comment: "created with GeoExt"
                                            }
                                    })
                                })],
                                bbar: [{
                                    text: "Create PDF",
                                    handler: function() {
                                        printDialog.items.get(0).print();
                                    }
                                }]
                        });
                    printDialog.show();
                    }
                }]

Using this code, I get the firebug error message

this.printProvider.layout is null

in line 240 of the PrintMapPanel.js

239  adjustSize: function(width, height) {
240  var printSize = this.printProvider.layout.get("size");
241  var ratio = printSize.width / printSize.height;

when trying to print the MapPanel.

Do I have to add a size/layout definition somewhere in the code or in the config.yaml of the print provider?


texts: Can a model or python script prompt the user to select a feature?

texts:
I'm trying to create a tool in python where a user splits a road (a polyline feature of shapefile) and the tool automatically recalculates the road ranges depending on where it was split. I know how to have a tool access information from features selected before the tool is run, but I'm wondering, is it possible for a python script or arcMap model to prompt the user to select a feature? This functionality could make my solution to this problem much simpler.

EDIT: I didn't know that python addins existed! My foray into addins is proving to be the correct path for this venture.


texts:
I need to locate the WMS (not WMTS) for the following ESRI Ocean Basemap for use in a WMS only application:

http://goto.arcgisonline.com/maps/Ocean_Basemap

Is this possible?


texts:
I have the following table with distance values (NEAR_DIST) after using the "Near" tool in ArcGIS:

I am looking for a method of getting the following statistical information/statement, for example: "80% of the values from the field "NEAR_DIST" fall inside the range of 40-500, 90% in the range of 30-600,..."

With the normal statistical information i do not get much information, just the sum, min, etc...:

Is there a tool in ArcGIS to achieve that or how would you deal with that?

I would like to remove the "outliers" (for example the 868 and 528 (which are too high, and also the very low records), to get a better frequency distribution (histogramm)...therefore i would like to automatically find the "break values" which i can use to filter my table.

Is there a way in ArcGIS to do this, or any statistically method?


texts:
I try to get data from table use MapBasic:

Dim nCol = "ColumnName"
Fetch First From Untitled
Do While Not EOT(Untitled)
  colValue = Selection.nCol
Note colValue
Fetch Next From Untitled
Loop

Compilation ends success but when i start application in MapInfo get error:

Not defined Selection.nCol

How to work with columns in this case?


texts: How do I export attributes with Python scripting in ArcGIS 10?

texts: How do I export an attribute table to dbf or txt format by use of Python in ArcGIS 10?


texts: Updating SLD in geoserver via REST with image ref

texts:
I've got hundreds of SLDs that I want to update in a geoserver instance.  All good for most of them but those that reference images fail to get updated.

For example:

      <PointSymbolizer>
        <Graphic>
          <ExternalGraphic>
            <OnlineResource xlink:href="symbols/airport.svg"/>
            <Format>image/svg+xml</Format>
          </ExternalGraphic>
          <Size>20</Size>
        </Graphic>
      </PointSymbolizer>

I know that the REST api does not support uploading the images but they already exist.  If I just paste the sld into web page for the style in geoserver it accepts it and all is good.  The problem would appear to be the upload code trying to resolve the link relative to the upload and not the final destination.

The error is

Caused by: java.net.MalformedURLException: no protocol: symbols/airport.svg

Does anyone know a way around this.  Manually updating 100s of styles is simply not an option.


texts: Contour lines from point shape attribute

texts:
I have a point shapefile and one of the attribute refers to the altitude.
Is is possible to obtain a contour lines shapefile in GRASS?


texts: importing fiona before shapely raising geos-related OSError

texts:
I ran into an issue where the order of imports for fiona and shapely caused the following geos error below which happens when i import fiona before shapely.  If I do the reverse all is fine.  Must be something screwy on my system.  Any tips?

>>> import fiona
>>> from shapely.geometry import shape

OSError: Could not find lib geos_c or load any of its variants ['/Library/Frameworks/GEOS.framework/Versions/Current/GEOS', '/opt/local/lib/libgeos_c.dylib'].

shapely.__version__ == 1.5.13

fiona.__version__ == 1.5.1

platform OSX


texts: How to split a network of polylines and then extract vertices without having overlapping lines?

texts:
I tried to split polylines with GRASS or QGIS tools but I obtain always a layer with overlapping lines. I figured it out because I always make a spatial join between the splitted lines and the nodes in order to have a table of edges defined by the min and max nodes.

How to avoid overlapping lines/edges?


texts: Fast location of items via attribute table in QGIS

texts: Is there a way to quickly go straight to an item via the attribute table in QGIS 2.0.1? E.g similar to in ArcMap when you have the table open and double click the record and it zooms to it? I have a layer of ~175 points and I need to check these against the aerial imagery in OpenLayers and possibly insert new points.


texts:
I am trying to create a tool that creates dimension lines but I am getting error.

Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 218, in main
  File "D:\Projects\AutoWellGIS\Python\DimensionClass.py", line 76, in ReturnFirstPoint
    offsetGeom = Polyline(rArray,sr,False,False)
NameError: global name 'arcpy' is not defined

I am importing arcpy and I also tried to extend the arcpy class by passing it to the class like this.

from arcpy.da import SearchCursor
from arcpy import PointGeometry
from arcpy import Polyline
from arcpy import Point
from arcpy import Array
import math
from math import sqrt
import arcpy
class Dimension(SearchCursor,PointGeometry,Polyline,Point,Array):
    def __init__(self):
        self.sr = None
        self.insertfields = []
        self.where = None
def ReturnFirstPoint(self,lyr,where):
    sref = self.sr
    fields = ["SHAPE@"]
    with SearchCursor(lyr.name,fields,where_clause=where,spatial_reference=sref) as sc:
        firstPoint = [row[0].firstPoint for row in sc][0]
        return firstPoint

I tried to look at the Python addin but I do not see how they are implementing arcpy in class structure.

I made a test class and try to implement one class from arcgisscripting and I am now getting error:

Traceback (most recent call last):
  File "d:/Projects/AutoWellGIS/Python/testclass.py", line 13, in <module>
    test = TestArcpy()
  File "d:/Projects/AutoWellGIS/Python/testclass.py", line 8, in __init__
    da.SearchCursor.__init__(self,in_table,field_names)
RuntimeError: cannot open 'D:\Projects\AutoWellGIS\Projects\1911022.gdb\LEASE_ROAD'

Here is the test class I create, I am thinking this is not possible, for me, to extend the arcpy classes. It is looking like too much trouble.

from arcgisscripting import da

class TestArcpy(da.SearchCursor):
    def __init__(self):
        field_names=["NAME","OBJECTID"]
        in_table=r"D:\Projects\AutoWellGIS\Projects\1911022.gdb\LEASE_ROAD"
        da.SearchCursor.__init__(self,in_table,field_names)

test = TestArcpy()


texts:
I have a lot of rasters (almost 4000) wich are representing individual glaciers in the Alps. I would like to select only the rasters located within the french border.

As I have no information in the name of the file, I would like to know how I could select them without checking them one by one.

Is there any way of loading only some rasters based on there coordinates or delete rasters that don't fit a mask ?

I have looked for such a tool in QGIS and R with no sucess.


texts: Offset after projection from WGS84 to ETRS1989

texts:
I'm using ArcMap 10.3, my dataframes coordinate system is "ETRS_1989_UTM_Zone_32N_6Stellen". I have several shapefiles in my project which are using the WGS84 system. When I try to proct them to ETRS1989 the output shapefile has an offset of about 0,16 m compared to the original shape (red is the orginal WGS84 shape, green the ETRS one).

This is what I entered in the projection tool:

What am I doing wrong?


texts: Reprojected raster return only zeros from QGIS raster calculator

texts: I am experiencing an issue when trying to use my reprojected raster in QGIS raster calculator; First, my raster is reprojected from degrees to meters. After that, I want to process the layer by applying calculations on it in QGIS raster calculator. However, the output layer is simply a layer filled with zeroes. Even when I simply multiply the reprojected layer with 1 this is the outcome. Any suggestions on what might be the reason for this?


texts: Is it possible to show all label on a polyline layer with minimum overlaps, by automatic changing of the font size?

texts:
My goal is the following: I would like to show every street name/label, without overlapping (the scale I use is <20000, and it is changing).

The default label is curved, 8p, but if the software can't show an label (because of the street is too short in the actual scale), then the size of label of that street changes to 7p, or to 6p, depend on what is possible to display (I think it depends on the length of the street on the actual scale).
If it is not possible at all to a label in curve, then it is labelled in parallel mode.

Simply:

If it is possible to show, Font size = 8p, Curved label

Else if it is possible to show, Font size = 7p, Curved Label

Else if it is possible to show, Font size = 6p, Curved Label

Else Font size = 6p, Parallel Label

How is it possible in QGIS?

I tried to solve the problem by rule-base labelling, but it does not give a perfect solution, just approximately solution (because it depends on the font style, etc.)

8p, curved, rule:  $length  /@map_scale *1000>= (length( "Name" )*1.6)
7p, curved, rule:  ($length  /@map_scale *1000< (length(  "Name" )*1.6)) and ( $length  /@map_scale *1000>= (length(  "Name" )*1.3))
6p, curved, rule:  ($length  /@map_scale *1000< (length(  "Name" )*1.3)) and ( $length  /@map_scale *1000>= (length(  "Name" )*1.0))
6p, paralel, rule:  $length  /@map_scale *1000< (length(  "Name" )*1.0)


texts: How can I identify gaps in polylines and polylines with more than one end point using ArcGIS 10?

texts:
I have a multipart polyline shapefile containing a large number of lines, some of which are broken by gaps and some of which have more than one start and end (by mistake - see attached). I need to have a multipart shapefile output, which contains only unbroken lines with one start and one end. Is there a way to identify these errors (can't seem to do it with the the topology rules in Arc)?

Once identified they are easy to fix manually.


texts:
The example below is based on Ramiro's code and using his data set  works perfectly :

http://bl.ocks.org/Pabloska/a860115cc78515291688ca4491f3ba09

But for some reasons when I change the json API and the SQL query it doesn't work, nor give a error message. The code below is the same as above but  my carto account :

http://bl.ocks.org/Pabloska/b7a9f6a052d8d7b91c6595cc38086113

Any ideas ?


texts:
I have a csv file with Latitude and Longitude information along with other information such as Street name. I am using as an example a map of a city and I have different points in the whole city's road network. What I am trying to do is to divide the whole network into small road segments of different sizes depending on each street, like a segment can be 200 meters up to 1km. The only geographical data I am having is "Latitude, Longitude, Street, City".
I have found a similar question here using XTools on ArcGis but I am using QGIS. I want to do the same thing. Divide the road network into segments and get a unique ID for each segment with every observation in that segment and its distance.
I tried to do this task using python but it didn't work well, like calculating the haversine distance.
I am new to QGIS and I am using the latest version, 3.14.16-Pi.


texts: QGIS 2.0 Can I get panels to display as tabs

texts:
I recently got myself very confused by getting the "Layers" panel hidden under the "Layer order" panel and then spent hours wondering why I could no longer right click on the layer to get the menu.

I like to have the option of floating or tabbed displays for panels.

Is this possible?  I have searched the manuals and gone through the setting but I may well have missed something.


texts:
How can I properly uninstall the complete opengeo suite in my Ubuntu 12.04? I had installed opengeo suite but it seems there was some error in the PostGIS extension to the Postgres of the OpenGeo suite.

So I need to now reinstall it. What is the best and safe way to uninstall it properly and reinstall a fresh copy?


texts:
I have an image from a Canon SD110 NIR camera, which I can import in RAW (CR2) into QGIS.

However, I am finding it difficult to know which band represents which 'colour' output.

According to the manufacturer it provides 'green, red and nir'.

Do those bands hold true for any software?

Firstly, QGIS loads 4 bands!The fourth band has a load of zeroes (looking at the xml file you can produce) bar one number at the end of the array of values it gives. Can I safely ignore this?

Secondly, so can I assume Band1 is green, Band2, red, and Band 3 the NIR in the same sequence as quoted by the manufacturer?

I know QGIS is not really an appropriate piece of software for this, just playing!


texts:
I have a project and I want to map the effective number of days with snow cover for a year in some mountain area. Until now, I have processed the MOD10A2 (8 days snow cover) product derived from MODIS and I want to count the occurrence of 200 pixel value (this value correspond to the snow extent). I have tried to aggregate raster into the temporal gis offered by GRASS but the results are unsatisfactory. Any ideas?  I can handle ArcInfo, GRASS GIS and R pretty well.

Thanks!


texts: Using Python, how to select points within a certain radius of a certain point?

texts:
I have a spatial table in SQL Server with point features, and connected it to QGIS which neatly shows all points.

Now I want to select points in this table (and show them in the map) within a certain radius from a certain point.

I am building a plugin in QGIS to perform this, based on a postal code api (which gives a point) and a radius.

My question is: how to select these points with Python? With the setSubsetString command? If yes, what should be the filtering criterion string, and if not, how then?

Background

I have already working code to request the postal code api, and centre the map on the resulting point (lon, lat).

The code for the postal code point is:

map_pos = QgsPointXY(lon, lat)

The code for the layer to be queried / filtered is:

pr = QgsProject.instance().mapLayersByName('Project')[0]

The points in this layer are in the geography type field 'Position'.

Then I want to use pr.setSubsetString( 'filterstring') to select the points in this layer that are within a radius of say 1 km around point map_pos.

Which 'filterstring' should I use?


texts: How to prevent ArcCatalog's "create pyramids" popup from appearing every session

texts:
For some reason, my ArcCatalog isn't remembering the setting for "always create pyramids".

I see this dialog whenever I try to preview a raster without pyramids (in a new ArcCatalog session) despite hitting "use my choice and do not show this dialog in the future". The setting lasts for this ArcCatalog session, but is forgotten when I close and restart.

Is there a registry setting or similar to control this?


texts: Creating multiple features in Featureclass using ArcObjects?

texts:
I am tried to create 10 points and store in a featureclass.But it store only one point that is p9. How to store multiple points

code:

          ESRI.ArcGIS.Carto.IFeatureLayer flay = lay as ESRI.ArcGIS.Carto.IFeatureLayer;
            ESRI.ArcGIS.Geodatabase.IFeature fea = flay.FeatureClass.CreateFeature();

            ESRI.ArcGIS.Geometry.IPoint p1 = new ESRI.ArcGIS.Geometry.PointClass();
            p1.PutCoords(0, 0);
            ESRI.ArcGIS.Geometry.IPoint p2 = new ESRI.ArcGIS.Geometry.PointClass();
            p2.PutCoords(10, 10);
            ESRI.ArcGIS.Geometry.IPoint p3 = new ESRI.ArcGIS.Geometry.PointClass();
            p3.PutCoords(20, 20);
            ESRI.ArcGIS.Geometry.IPoint p4 = new ESRI.ArcGIS.Geometry.PointClass();
            p4.PutCoords(30, 30);
            ESRI.ArcGIS.Geometry.IPoint p5 = new ESRI.ArcGIS.Geometry.PointClass();
            p5.PutCoords(40, 40);
            ESRI.ArcGIS.Geometry.IPoint p6 = new ESRI.ArcGIS.Geometry.PointClass();
            p6.PutCoords(50, 50);
            ESRI.ArcGIS.Geometry.IPoint p7 = new ESRI.ArcGIS.Geometry.PointClass();
            p7.PutCoords(60, 60);
            ESRI.ArcGIS.Geometry.IPoint p8 = new ESRI.ArcGIS.Geometry.PointClass();
            p8.PutCoords(70, 70);
            ESRI.ArcGIS.Geometry.IPoint p9 = new ESRI.ArcGIS.Geometry.PointClass();
            p9.PutCoords(80, 80);

            fea.Shape = p1;
            fea.Store();
            fea.Shape = p2;
            fea.Store();
            fea.Shape = p3;
            fea.Store();
            fea.Shape = p4;
            fea.Store();
            fea.Shape = p5;
            fea.Store();
            fea.Shape = p6;
            fea.Store();
            fea.Shape = p7;
            fea.Store();
            fea.Shape = p8;
            fea.Store();
            fea.Shape = p9;
            fea.Store();


texts: Converting points with Easting and Northing to polygons of GB OS Grid references?

texts:
Is there a tool or procedure on ArcMap 10.8 (similar to the Tom.bio plugin in QGIS) that allows the conversion of points with easting, northing and grid reference info into polygons of GB OS Grid references?
The points represent the locations of thousands of buildings and houses.
The tool/procedure should allow the conversion of points into different grid reference squares depending on the grid reference of the point (e.g. a point with NT36 should create a 10km square, a point with NT24B a 2km square, etc.).


texts:
my plugin, developed in VS2008 for Windows runs in my testenvironment, the startimage of QGIS shows the developermeeting in Essen with the version number 2.1 alpha.
On a other system I have installed a QGIS Version 2.0.1, the plugin dll is in the right directory (c:\osgeo4w\apps\qgis\plugins) but i can't get it, not even in the invalids.
I'm searching for a way deploying my plugin by copying in a installed 'official' version of qgis. I'm not able to make an own install-package for qgis with my plugin and also that isn't it what my boss wants :-)
Pleas give me some supprort.
Thanks a lot.

EDIT:

I just want to update my plugin to QGis 2.0 (Dufour). But I don't know how to do that. I got the actual sources from git, added my plugin-code, compiled it in Visual Studio 2010, put the plugin-dll in the right directory. But it isn't in the plugin-list. I put the plugin-dll in a QGis 2.1-plugin-directory and it works fine. What do I wrong? I spent a lot of time and it is so frustrating. Everywhere in the forum the people say , developer should update their plugins to the new API. But how to do that?


texts: KML to SHP with elevation not equal to Z value

texts:
Can I convert a Google Earth KML file to a shapefile with the elevation coordinates not as Z values?

I can add a vector layer using a KML file and then save it as a shapefile but apparently the elevations as saved as Z values which I cannot have in the application into which I need to import the resulting shapefile.

Thanks


texts: Loop NDVI calculations for hyperspectral datacubes in R

texts:
I am writing a script for the processing of different hyperspectral datacubes. The datacubes contain flight lines that I've recorded with a UAV. In total there are 10 flight lines that need to be processed and mosaiced. The files are in .bsq format and contain 101 bands:

    class       : RasterBrick
dimensions  : 1293, 749, 968457, 101  (nrow, ncol, ncell, nlayers)
resolution  : 0.25, 0.25  (x, y)
extent      : 651041.9, 651229.1, 5687300, 5687623  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=31 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : \HyperspectralDatacube_FlightLine02_PixelSize=0.25m_DSM=Photogrammetric.bsq
names       : X450.00000.Nanometers, X455.00000.Nanometers, X460.00000.Nanometers, X465.00000.Nanometers, X470.00000.Nanometers, ...

I load all 10 hyperspectral rasters using lapply and brick to load all 101 layers:

# Load hyperspectral datacubes
files <- list.files(path=".", pattern = ".bsq$")
r <- lapply(files, brick)

Then I want to calculate vegetation indices for these hyperspectral rasters and mosaic the results.

# Create NDVI function
NDVI <- function(R,NIR)
{
  (NIR-R)/(NIR+R)
}

# Calculate NDVI
ndvi1 <- NDVI(raster(r[[1]], layer=41),(raster(r[[1]], layer=61)))
ndvi2 <- NDVI(raster(r[[2]], layer=41),(raster(r[[2]], layer=61)))
.......

# Mosaic rasters
mndvi <- mosaic(ndvi1,ndvi2, .... fun=mean, tolerance=0.05)

How can I create a loop for the NDVI calculations? Instead of writing the code line by line like the example above. I'm fairly new to R and I dont quite understand yet how I can write this loop with the variable rasters and layers for each calculation. The results need to be mosaiced like the example above.


texts: Cannot fortify rworldmap's default world map with a region argument

texts:
I'm using the default world map from rworldmaps as a background layer for a bunch of plots done with ggplot2.  In order to do this I have to "fortify" the object returned by getMap() - this converts it to a format ggplot understands.

Given

> library(maptools)
> library(rworldmap)
> library(ggplot2)

and the 'rgeos' package also installed, this works, but gives me a message which makes it sound like I really ought to specify the "region=" argument:

> world <- fortify(getMap())
Regions defined for each Polygons

I want the background layer to show country borders, so I think I ought to specify region="ADMIN", but this fails:

> world <- fortify(getMap(), region="ADMIN")
Error: IllegalArgumentException: Points of LinearRing do not form
a closed linestring

I get the same error message for other plausible region= settings (NAME, ISO_A2, REGION, continent, etc).

What is going on and what is the correct way to do what I want?


texts: How to dynamically connect Excel data sources to MapInfo?

texts: How to connect Excel(2010) with Mapinfo(10.0)? I saw that Excel can be connected using Excel as Data Source but my Data Source is already MS-SQL. Actually I would like to reflect any changes in excel to mapinfo and MS-SQL database.


texts: Unable to create macro in QGIS for open shapefile on QGIS start-up

texts:
I want to a load shapefile on QGIS start-up but when I add it I'm asked to save before I can add it.

I used following code for this:

      c=''
      b=os.path.dirname(os.path.abspath
      (inspect.getfile(inspect.currentframe())))
      c=os.path.abspath(os.path.join(b, os.pardir))
      c=c+"/C_final.shp"
      layer=self.iface.addVectorLayer(c,"Country_map","ogr")

If I create macro then I am unable to find the path for shapefile. I want to make it path independent. If I add this shapefile and select the option project on launch and make it default project then it become path dependent.

How could I make it a path independent and open it on QGIS start-up?


texts:
I'm working on a hostile environment. Power outages, despite our efforts to minimize them, are often here.

Yesterday we had a power outage and we had 2 ArcSDE databases working. I have two sets of connections, that are essencially equal. The only difference is the instance that the database points to.

Now, after the power outage, all connections we had pointing to our main server gets a bad login user and we cannot connect.

I can connect trought oracle using that password. So, the database is fine. My guess that the problem is the service (when I direct connect it works fine too). I need to fix the service.

Any ideas on how to do that WITHOUT running another post install?

The host OS is sadly a Windows 7 Ultimate machine. I'm in the amazon forest, so please, be kind :P

Solution found: deleted service. Recreated one tru command line, but it did not start. Deleted that one too and created one tru post-install. Seems to work.

Thanks


texts: Merge Error 000594 in ArcMap - falls outside of output geometry domains

texts:
I'm trying to merge together 5 different point feature classes into one using the Merge tool in ArcGIS desktop 10.  It successfully merges 3 of them but not the other 2.  It comes back with an error 000594: Input feature1: falls outside of output geometry domains. These 2 feature classes are furthermost away, but still close to other feature classes.

How do I extent out the output geometry domain?  I'm not seeing anything like that in the environment settings.


texts:
I have created a 1:many relation in QGIS 2.10.1 with Project Properties>Relations.  When I select a map feature with the Identify Features tool, a Feature Attributes window (widget?) appears.

How do I export the contents of that window to a new table?

Let me show an example:  I have created a 1:many relation.  I then identified a polygon feature (#1).  On the resulting output window, I click the button (#2), to format it's contents as a table.

I want to copy the contents of that window to the QGIS Layers list as a .dbf attribute table, but I don't know how.


texts:
If degrees is zero, how should Degree Minute Second notation reflect the positive/negative hemisphere?  What is the appropriate behavior when degree is zero? Basically this is a Signed Zero problem.  https://en.wikipedia.org/wiki/Signed_zero

We have a software system in C/Python that converts GPS NMEA coordinates to DMS (degree (integer), minute (integer), second (float)).  Normally hemisphere would be indicted by a positive or negative degree.

Given, for example, the University of Reading.

$GPGGA,100612,5126.48,N,00056.51,W,1,9,0.9,54.9,M,47.0,M,,*54

Decimal Degrees is 51.441400, -0.941800.  DMS is 51°26'29.040000"N, 0°56'30.480000"W

Converting to integer, integer, float, we get:

longitude degree=0 minute=56 second=30.479999999999734

We lose hemisphere because no signed zero.

Is it appropriate to use negative minutes when degree is zero? Continuing, is it appropriate to use negative seconds if both degree and minute are zero?

For example: longitude degree=0 minute=-56 second=30.479999999999734

Using negative minutes, negative seconds (fixing the bug) would allow us to preserve backwards compatibility with existing code. Adding a "hemisphere" is an option but would imply dropping sign entirely which might cause backwards compatibility problems.


texts: How to count number of selected features?

texts: I have performed a selection by expression (Attribute table) on a layer that contains thousands of features. I would like to know the number of features in this selection.


texts: Rasterio reprojection, changing pixel size: results in crazy pixel values

texts:
I'm trying to project a geotiff with 789x789m pixel size to 100mx100m using another geotiff as a template. Everything seems to work except that the output pixel values, shown when I open the file in QGIS, are 1.79769e+308 to -1.79769e+308 (inputs are between 890-1776). I'm not changing the CRS...and the dimensions, origin, pixel size and extent of the output file look right. What am I doing wrong? I'm very much a Python beginner so it's probably very simple.
from natsort import natsorted
import os
import rasterio
from rasterio.warp import calculate_default_transform, reproject, Resampling

template = file_dir+'/NG_boundary.tif'

list_test_files=[]
names_test=[]
dst_crs = 'EPSG:32554'

for root, dirs, files in os.walk(file_dir+"/test"):
    for file in files:
        if file.endswith('.tif') and "boundary" not in file and "projected" not in file:
            list_test_files.append(file_dir+"/test/"+file)
            name = file.replace(".tif", "")
            names_test.append(name)
            names_test = natsorted(names_test, key=lambda y: y.lower())
            with rasterio.open(template) as src:
                transform, width, height = calculate_default_transform(
                    src.crs, dst_crs, src.width, src.height, *src.bounds)
                kwargs = src.meta.copy()
                kwargs.update({
                    'crs': dst_crs,
                    'transform': transform,
                    'width': width,
                    'height': height
                })
                print('source', src.profile)
                with rasterio.open(file_dir + '/test/%s_projected.tif' % name, 'w', **kwargs) as dst:
                    for i in range(1, dst.count + 1):
                        reproject(
                            source=rasterio.band(dst, i),
                            destination=rasterio.band(dst, i),
                            src_transform=src.transform,
                            src_crs=src.crs,
                            dst_transform=transform,
                            dst_crs=dst_crs,
                            resampling=Resampling.nearest)
                    print('output', dst.profile)
                print(names_test)


texts:
Is it possible to open Sentinel-1 products using ENVI 5.3?

GeoTiff Sentinel-1 images can be opened independently but I can't open the product (from its xml file) using ENVI. I mean, is SARscape necessary to open Sentinel-1 products? or is ENVI enough for that.

I guess that for the calibration and other specific operations, SARscape could become a necessity.


texts: Perform "Add Join" on multiple tables ArcMap or R

texts:
The operation I want to perform is the Add join in ArcMap 10.0. It works perfectly when done with one file but I need to do it with a few hundreds tables.

What I have is ONE shapefile with divisions, and multiple tables for different years/species. For each table I want to add join to the shapefile and save the result.

I am trying to use model builder and the problem I have is that in the "layer name or table view" input it doesn't let me pick a shapefile unless it's loaded in the workspace. Also when I use the "copy features" to save the result of the add join to disk, it messes up the column names of the new shapefile. I also don't want to use the Join Field because it doesn't have the option Keep All that Add Join has.

Does anybody have a solution for this? I can try in Python or R if it's needed. I am adding links to the two files
table
shapefile
Thanks


texts: ModelBuilder Tool produces different results when using Run Button and running as a tool

texts:
I found out that I can run a tool I created in ModelBuilder by clicking the run button after clicking to edit the tool. However, it doesn't produce the same results if I run the tool after clicking on it using the ArcCatalog window.

This doesn't work:

But this does:

Correct Output:

Incorrect Output:

Does anyone know why this may be happening?


texts: Subset ('get') ee.List using multiple indices in Google Earth Engine

texts:
I need to split a long, flattened list of coordinates by even indices (longitude) and odd indices (latitude). Here's an example list:

var roi = ee.Geometry.Polygon(
    [[[24.331249999999955, 1.0646598040515236],
      [24.331249999999955, -13.828337374026978],
      [44.018749999999955, -13.828337374026978],
      [44.018749999999955, 1.0646598040515236]]], null, false);
var flatList = roi.coordinates().flatten()

In Python it works great using flatList[::2] for even indices and flatList[1::2] for odd indices. In normal Google Earth Engine I'm trying the following to first create lists of indices:

// Even indices
var even = ee.List.sequence(0, flatList.size().subtract(1), 2)
// Odd indices
var odd = ee.List.sequence(1, flatList.size().subtract(1), 2)

No problems there, but it then seems bizarrely difficult to subset my list using my  lists of indices. I'm trying this:

// Even indices (longitude)
var lons = even.map(function(i){return(flatList.get(i))});
// Odd indices (latitude)
var lats = odd.map(function(i){return(flatList.get(i))});

For long lists of coordinates (i.e. large FeatureCollections) this is very slow. I'm assuming it's because of the call to map? But I don't see any alternatives in the documentation.

For background, the reason I am doing this is to create a minimum bounding box from potentially complex FeatureCollections. The FeatureCollections are species range maps, which may contain many geometries of different types and thus requires me to completely flatten the coordinates to be able to extract the minimum and maximum latitudes and longitudes.


texts: How to optimize the process of entering attribute information while digitizing in ArcMap

texts:
I've somehow found myself digitizing a bunch of points from a scan, and the process is quite painful in ArcMap:

Click on the featureclass name in the Create Features tool
Move the mouse over the scanned image, then click on the point to be digitized
Move the mouse to the Attributes section, click on the field to give it focus, and enter the value
Goto 1

This involves a lot of repetition, switching between keyboard and mouse, and constant moving and clicking around the screen.

A more optimized pattern would be to click on each point, and pop up a dialog with the Elevation field already focussed, so I could simply enter the value, then hit Enter to dismiss the dialog and continue adding new points.

Is this easily possible without laborious ArcObjects coding? Are there any plugins to ArcMap which help to speed up data entry?


texts: How to reproject spatial files in the GDAL shell?

texts:
I have multiple spatial files that need to be reprojected for GCS WGS84.

How do I reproject in the GDAL shell?

Which command should I use ?


texts: How can I convert points in EPSG:2956 to EPSG:4326 with pyproj?


texts: Intersect multilinestring (A) with multilinestring (B) retaining linear sequencing in resultset?

texts:
I have a PostGIS table testtin2 which is a sort of pseudo TIN consisting of a single multilinestring geometry, which I am intersecting with another table align, also a multilinestring, to generate a set of coordinates along an alignment (or alignments) via the following query...

SELECT ST_X(q1.int_pnt), ST_Y(q1.int_pnt), ST_Z(q1.int_pnt)
FROM
(SELECT ST_Intersection(align.geom, testtin2.geom) as int_pnt
FROM align INNER JOIN testtin2 ON ST_Intersects(align.geom, testtin2.geom)
WHERE ST_isvalid(align.geom)='t' AND ST_isvalid(testtin2.geom)='t') As q1;

Which works fine except for the fact that the resulting output is seemingly in a 'random' order. Is there a way this query might be modified or re-written such that the coordinates come out in the correct linear sequence along the alignment linestring(s) from the align table?

I need this to happen so that the drafting software I am passing the coordinates to will join the dots up in the correct order.

Thanks in advance.


texts: Imported DXF has no position attribute using QGIS

texts:
I am using QGIS 3.10.8 and still getting my head around QGIS.
I'm trying to import some route data from dxf into my QGIS project. when I import and set the CRS correctly it is in the correct place, but the attribute table has no position information.
I have tried saving as DXF 2013 as well as 2018. I have imported using the project - import/export - import layers from DWG/dxf I have dragged and dropped onto the workspace, I have created a new vector layer and loaded the DXF.
Is there a fundamental step I am missing?
Will I have to digitise the line?
If there is no position information in the attribute table, how is it getting positioned in the correct place?


texts: adding a Layerdefiniton file in QGIS 2.99

texts: Wouldn't it be better to add the possibility of adding a Layerdefiniton file into a QGIS-map to the new Data Source Manager?


texts: Spatially joining large raster to polygon shapefile

texts:
I have a large raster file with elevation data. From this raster, I would like to infer the average ruggedness for different geographic zones (like countries). I have the "countries shapefile" as a separate polygon shapefile.

I was able to get a raster file with a ruggedness measure.

However, this raster is still very large. It is therefore not possible to convert it to a shapefile to do a spatial join of the two shapefiles.

Since I do not need very precise data, is it possible to either:

convert my raster to a shapefile with an output that has larger cells than the default (I did not find this option)
directly spatially join the raster to the polygon shapefile

Do you have any advice?

I use ArcGis10, Gdal, and Qgis 1.8


texts: Calculating distance to nearest coastline with ArcMap

texts:
I am using ArcMap to calculate the distance from a list of coordinates to the nearest coastline. I downloaded the shapefile of coastlines from https://www.ngdc.noaa.gov/mgg/shorelines/ and converted the polygons into polylines. So, I have 2 shapeline files on ArcMap - one consists of the world coastline and another a list of coordinates. I also ensured that the linear unit of my input (i.e. list of coordinates) is in metres (but not other units like degrees). Basically, I followed the instructions in a previous thread, using the NEAR tool: Calculating distance to nearest coastline from site locations?

My results are shown here:

However, the result is distorted as their distances all roughly equal to 569,736 metres with the same NEAR_FID. I cannot figure out what went wrong as I double checked every step.


texts: Error with ArcGIS js API Create web map by ID sample

texts:
I have been trying to use the updated ArcGIS API for Javascript, with ArcGIS Online.  I have been testing with the sample code found on the "Create web map by ID" page:

http://developers.arcgis.com/en/javascript/jssamples/ags_createwebmapid.html

If I download that and try to run it in Firefox, without making any changes, then the map does not show up and I get the following error reported in Firebug:

Error: Unable to load the base map layer
[Break On This Error]

...);}},_getKind:function(_2ff){var _300=this._trackManager;if(_300){return _300.is...

utils.js (line 19)

The sample runs fine on the http://developers.arcgis.com/ site, I'm not sure why it would be failing for me.  I am not accessing the web through a proxy.

Thanks.


texts: Arcpy SelectByAttributes and Show Selection

texts:
I understand that in order to do a SelectByAttribute in Python, you need to first convert the shapefile to a feature layer using the MakeFeatureLayer_management function, and run the SelectByAttribute on that feature layer. My question is, is there a way to show your selection on the original shapefile? I don't want to create a new output and add it to the map document. I just want to run the script and have the selection shown on the map.

What I have. I want the selection to be shown on my FIELD shapefile.

shape = "FIELD"
arcpy.MakeFeatureLayer_management(shape, "shape_lyr")
arcpy.SelectLayerByAttribute_management("shape_lyr","NEW_SELECTION",""""TYPE" = 'HIGH'""")


texts: How can I use shift or ctrl key without openlayers 3?

texts:
I want to verify if Shift or Ctrl key is pressed to make my own multiselection.

I use a digitizer to draw polygon, rectangle, etc... to make selection from geometry on server-side (with mapguide api).

My problem is when I want to make a multiselection, I need to press Shift or Ctrl key and draw my rectangle for example. After I send to the server my rectangle geometry and that I'm in multiselection because of Ctrl or shift key pressed.

But when I press shift and I want to draw, I see my pointer of drawing but on first click, my draw stop.

And when I press Ctrl and I want to draw, I see my pointer of drawing too but when I click, nothing happend.

I have disable map interactions :

me._map = new ol.Map({
interactions: ol.interaction.defaults({
  doubleClickZoom: false,
  shiftDragZoom: false,
  altShiftDragRotate: false,
  keyboard: false,
  pinchRotate: false,
  pinchZoom: false,

}),
controls: [],
layers: [layer],
target: me._options.target,
view: new ol.View(options)
});

I want to do this since I'm drawing with my digitizer:

on(document, "keydown", function (event)
    {
      if (event.keyCode == keys.SHIFT || event.keycode == keys.CTRL)
        me._isShiftDown = true;
    });
    on(document, "keyup", function (event)
    {
      if (event.keyCode == keys.SHIFT || event.keycode == keys.CTRL)
        me._isShiftDown = false;
    });
    window.onblur = function ()
    {
      me._isShiftDown = false;
    };


texts: How to use InsertCursor to add points to a point feature class?

texts:
I am struggling with a very simple task of inserting "SHAPE@XY" into a point feature class.
Following is what I have:

xy = [(361087.15436001675, 198747.07296730898), (361530.56426259346, 198976.62248019245),
      (361692.3015462744, 197815.78617074457), (361845.0959187896, 198297.07296730898),
      (362135.3345548634, 197552.7531621556)]

fc = "C:/temp/xy.shp"
cursor = arcpy.da.InsertCursor(fc, ["SHAPE@XY"])
for row in xy:
    cursor.insertRow(row)

del cursor

it throws back error:

TypeError: sequence size must match size of the row

I used field calculator to add x and y field into the same shapefile form where I retrieved these points, and it works fine to add above set of co-ordinates to a multiline feature class, but above set of lines fail. Any suggestions?


texts:
I have connected a geodatabse that was created by ArcGIS. My geometry type is PG_GEOMETRY. I can connect the database in QGIS and add a feature table as a layer. When I create new spatial data in this layer via QGIS, a data form appears. The form contains a text box for OBJECTID. But I can not know the next id. If I do not fill the OBJECTID box, it gives an error.

How can I set the next serial of the OBJECTID?


texts: Details of new SoilGrid data on GEE unclear

texts: I am processing the new 250m resolution, 6 depths (0-5cm, 5-15cm...) data of the ISRIC Soil Grids on GEE, for my region of interest. Currently only the mean prediction is available on GEE for different soil properties. However, I am unclear whether this is what is called 'Latest' data which is continously changing based on new data or the'Snapshot' data which is for July 2016 and Sept 2019? If it is the 'Snapshot' data, which is it July 2016 or Sept 2019?


texts:
I want to integrate the NTv2_SN.gsb grid in QGIS. I have a dataset in CRS EPSG:31469 and want to transform into CRS EPSG:25833. Therefore I want to integrate the NTv2_SN.gsb into QGIS. But I have some problems.

I put the file NTv2_SN.gsb in the folder C:\Program Files\QGIS 3.4\share\proj
start in QGIS the DB Manager and connect to database C:\Program Files\QGIS 3.4\apps\qgis-ltr\resources\srs.db
then I update the table tbl_srs with the following SQL statement:

UPDATE tbl_srs
SET parameters ='+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam +nadgrids=NTv2_SN.gsb +units=m +no_defs'
WHERE auth_id = 31469

after that I add in the table tbl_datum_transform the values with this SQL statement:

  INSERT INTO tbl_datum_transform
  VALUES (99999, 100099, 31469, 25833, 9615, 'NTv2_SN.gsb', NULL, NULL, NULL, NULL, NULL, NULL, 'amtliche Gitterdatei von Sachsen', 'Für Genauigkeitsanforderungen im cm Bereich', 1, 0, NULL)

the SQL statements work and the values are updated
the I go the settings => options => CRS => ask for datum transformation if several are available
but if I want to transform a dataset with the CRS EPSG:31469 to CRS EPSG:25833 I can not see my own transformation

Where is my fault? Or does anyone know a good tutorial for the grid integration in QGIS?


texts: Tilted TIFF images, how to make them look exact?

texts:
I've two TIFF layers in my QGIS project. My plan is to find differences and mark them with some attributes. The tiffs are from two different sources. If you notice the GIF file, you can see one of them is tilted. I don't know how to solve this issue. I tried with different projections but no use.

I'm new to QGIS.


texts: Having multiple (seperate) Attachment Tables related to one feature class

texts:
Is it possible to have multiple attachment tables related to one feature class?

The purpose is to only show specific attachments at certain times. We are trying to only show pertinent attached files/docs/PDFs to multiple viewers.  So Sales People would only be able to see attachments related to sales, and Drafting would only see attachments related to their department.

Some of our features can have over ten attachments, but when we publish a map they don't want to see all of the related attachments.


texts: I'd need to convert some point data in Kavrayskiy Coordinate System (old USSR one) into something more useful, e.g. WGS84 or just LatLon (geographical coordinates). Could anyone please help with coordinate conversion parameters to use, e.g.in Bluemarble Geographic Calculator?


texts: Optimal site allocation with accumulated cost and total number of sites minimisation

texts:
I am looking to define and solve the following GIS-based optimal location allocation problem. I have:

A raster layer with the population living in each cell
A friction layer (used to calculate accumulated cost, i.e. travel time, to a set of point features using for instance the SAGA accumulated cost tool or similar algorithms)

I would like to identify the optimal location (coordinates) of those point features, such that each population cell (i.e. cell of a raster layer) is at a maximum travel time of 60 minutes to the nearest site. We wish to do so by minimising the number of those point features.

I accept solutions in QGIS, PyQGIS, Python, and R. If it is not possible to achieve this with any of those tools, I can also consider other solutions, e.g. ArcGIS or other software.


texts:
I'm using ArcGIS 10.3 for Desktop.

I have two point datasets:

The first point file contains bus delay events (e.g., due to traffic, signal delay, passenger on/offs etc.) along a number of routes and during different times of day. Each delay event has a "Run_ID" attributed to it, which corresponds to the bus run (e.g., Route 28A  northbound, run # 55 on July 25, 2015).
The second point file contains the bus locations collected at 1 second intervals for each bus run in the system corresponding to a "Run_ID".

My objective is to roughly approximate time associated with each delay point in the first dataset. To do this, I've figured I can use a the Spatial Join tool in ArcMap to count the number of bus GPS points that fall within a certain radius of the delay point. The count of these points would translate into the number of seconds (since the GPS points are taken every second). I can do this in isolation with one single run (i.e. unique Run_ID), but I have a massive dataset with delay points and bus locations corresponding to thousands of Run_IDs.

Is there a way to do a spatial join with a conditional statement at the outset?


texts:
I tried to clip using a loaded shapefile. It enables me to download but crushes at few seconds not completing the downloading task.

var clipToCol = function(image){
  return image.clip(export_geometry_2);
};

var dataset = ee.ImageCollection("WorldPop/GP/100m/pop").map(clipToCol)
                .filterDate('2017');
var worldPop = dataset.select('population');

var populationVis = {
  min: 0.0,
  max: 50.0,
  palette: ['24126c', '1fff4f', 'd4ff50'],
};

Map.addLayer(worldPop, populationVis, 'Population');

var export_geometry_2 = ee.FeatureCollection("users/gabiklm01/polyMosaic");

Export.image.toDrive({
image: dataset.select('population'),
description: 'worldPop',
scale: 100,
region: export_geometry_2
})


texts: What's the use of the table extended_geometry_columns in PostGIS

texts:
Sometimes my PostGIS database creates a extended_geometry_columns table. After some search i've not found what is the use of this table.

I'm using PostgreSQL 8.4 and PostGIS 1.3.3

This is the definition of the table

CREATE TABLE extended_geometry_columns (
    f_table_schema character varying(265) NOT NULL,
    f_table_name character varying(256) NOT NULL,
    x_min double precision,
    y_min double precision,
    x_max double precision,
    y_max double precision,
    CONSTRAINT extended_geometry_columns_pkey PRIMARY KEY (f_table_schema, f_table_name)

);

AFAIK the only tools that are connecting to the database are pgadmin3/psql,  gvSIG, and some custom python scripts (that i'm sure not create the table).

Thanks


texts: Use model input to amend SQL Query in QGIS Modeler

texts:
Is there a way I can use a model input in QGIS modeler to amend the parameters of a SQL query.
For example I want a model input (string) to allow me to pick the name of someone I am searching for in a database. In the example below the name is 'Tim'

I know I can change between a 'value', 'pre calculated value', 'model input' and 'algorithm output' but none of these seem to allow me to change a specific parameter within the script.


texts: PostGIS ST_Area causing error when used with "use_spheroid=false" setting, succeeds with spheroid

texts:
I am running into an issue with using the PostGIS ST_Area function against a dataset loaded with osm2pgsql.
Setup:
PostgreSQL 11.2/PostGIS 2.5.1
osm2pgsql 0.96
When I attempt to run the ST_Area function against polygons stored in WGS1984 lat/long using Geometry(!) storage (so not the default Web Mercator mostly used in conjunction with osm2pgsql, but using the EPSG 4236, and also not using PostGIS Geography geometry storage), the following command fails:
ST_Area(way::geography,false)
with the error depicted below

This option should use the faster calculation mode based on a sphere instead of spheroid.
However, if I switch to using
ST_Area(way::geography,true)
which is also the default and uses a spheroid for the calculation instead of a simple sphere, it succeeds. I suspect this may be a bug I need to report, but does anyone else have remarks about why using a sphere might cause a failure versus a spheroid not?
EDIT :

I have needed to make a major correction to this question, as I accidentally mixed up the spheroid and sphere options. Instead of failing with spheroid, it fails with sphere ("use_spheroid=false"). I have now edited both title and post to reflect this.
user30184 is right that this dataset, which is the Geofabrik "Oceania" extract, borders the dateline. However, the objects in OSM are cut up along the dateline, but I do see a number of them lying against the dateline. These may cause the issue with the sphere based calculation, although i am still trying to wrap my head around why. It is hard to visualize this.
Correcting winding order (if even needed because I suspect osm2pgsql already properly takes care of this) and testing for validity using a command like:

CASE WHEN ST_IsValid(ST_ForcePolygonCW(way)) THEN ST_Area(ST_ForcePolygonCW(way)::geography,true) ELSE NULL END AS area_calc
did not solve this issue.
Also replacing it with CCW instead of CW (I read somewhere that sometimes CCW is used for decimal degrees data), did not solve the issue. In both cases the errors remained the same as displayed in the image, so the faster sphere based calculation failed.


texts: Automation of Land Use composition in ArcGIS

texts:
I am using ArcGIS 10.1 and I have two shapefiles I'd like to process:

A Polygon shapefile with 1000 features representing lakes covering a specific area, and;
A Polygon shapefile with the Land Use features for the specific area.

I would like to Buffer the Lake Shapefile to 10km and somehow determine the composition of land uses from the Land Use shapefile by their area within the buffer.

The final product would be an excel file or the buffer shapefile with a table where each row represents the 1000 lakes with columns for the differing land uses and the area value associated.

I know this can be done with the Buffer tool and then the Clip tool, but this process can be tedious even if automated with python. The result would be 1000 shapefiles with the areas for each land use, when I would like it all organized into one file.

Are there any recommendations on how I can go about this task? Maybe a third-party tool I'm not aware of.


texts: Appending linear ring to multipolygons in OpenLayers

texts:
I am trying to append linear ring to multipolygon.
When I try to do same for polygon it works.

case 'Polygon':

linearRing=new ol.geom.LinearRing(...);

select.getFeatures().getArray()[0].getGeometry().appendLinearRing(linearRing);

case 'MultiPolygon':

linearRing=new ol.geom.LinearRing(...);
select.getFeatures().getArray()[0].getGeometry().getPolygon(0).appendLinearRing(linearRing);

it's not throwing error, but still coordinates of created linearRing are not appended to selected feature..


texts: How to convert a GeoSeries to a GeoDataFrame with Geopandas

texts:
I'm new in GeoPandas and I try to create my first script.
I successfully opened a shapefile and made a union of all entity and an envelope.
As it said in GeoPandas doc, after these 2 geometric manipulations it returns GeoSeries.
But how can I convert my GeoSeries to a GeoDataFrame to finally export it to a shapefile ?
I try this on point shapefile but my GeoDataFrame is empty...
import sys
import geopandas as gpd

shp = (sys.argv[1])

gdf = gpd.read_file(shp)

union = gdf.unary_union

env = union.envelope

envgdf = gpd.GeoDataFrame()

envgdf['geometry'] = env
envgdf.geometry.name

print("\nGeoDataFrame :\n", envgdf)

Returns :
GeoDataFrame :
Empty GeoDataFrame
Columns: [geometry]
Index: []


texts: Error installing addons in GRASS 7.0.2: File is not a zip file?

texts:
When I attempt to install an addon in GRASS Setting->Install Extension from Addons and select the addon i want from the list (r.stream.order) i get the following error: "ERROR: File is not a zip file: http://wingrass.fsv.cvut.cz/grass70/addons/grass-7.0.2/r.stream.order.zip"

I get a similar error no matter what addon I attempt to install.

Is there a way to download the zip files and install locally? If so where should I download these?  When I follow the addon links and locate the the location of this addon online, it does not contain any zip files.  (https://svn.osgeo.org/grass/grass-addons/grass7/raster/r.stream.order/)

What are the correct steps in successfully installing an addon?


texts: Exporting spatialite view to shapefile from QGIS modifies original data types?

texts:
We have a spatialite .sqlite database where we have views which are nicely rendered by QGis, with all the symbols and everything!

There are integer fields on the view which are based on fields of the sqlite database which are also integers, however, when I try to export to a shapefile, using right-click 'Save As', the shapefile created has converted some of the fields on strings.

I double checked the view, casting explicitly the fields as integers (they are on the right side of the field on the attribute table :-) ) and still the shapefile converts this fields on strings.

I also tried directly on spatialite_gui, right click on the geom field, and exporting to shapefile with the same results.

I tried to downloading the ogr2gui but not option for exporting views, only tables.

Does someone how to force the shapefile to get a specific data type?

I am using QGIS 2.2.


texts: Export central coordinates of current map in print layout

texts:
I am trying to export the centrum coordinates of the current map in the print layout, and show the coordinates as a text element.

I have succeeded to print the centrum coordinates of a geometry in the in the map when using the atlas tool, i.e. x( @atlas_geometry ), and  y( @atlas_geometry ). The result shows like the image below.

But I would like to print the center coordinates of the current map, without having to use the atlas tool. I guess I will have to change the @atlas_geometry to something similar to map_get(), but I can't get it to work. Any ideas how I can solve this?


texts: ArcGIS GP Tool as sd file with multiple scripts

texts: Is it possible to add multiple script files containing other python classes, config etc, and even .sde connection files  when publishing service definition from arcmap? I do not have access to the arcgis server directories.


texts: Running PostgreSQL after installing pgRouting?

texts:
I have PostgreSQL 9.3 installed on the server. It worked just fine. I also had a webservice which connected to a database. That also worked like a charm. Later, I decided to install and use pgRouting. I followed the steps provided here.

After, I copied and pasted the bin, lib and share folders as well as two text files for pgRouting in the following path: C:\Program Files\PostgreSQL\9.3

When I open up pgAdmin III and explore my db, I received the following two errors:

ERROR: column "spclocation" does not exist
LINE1: SELECT ts.oid, spcname, spclocation, spcoptions, pg_get_user...

and

ERROR: could not load library "C:/Program Files/Boundless/OpenGeo/bin/../pgsql/lib/postgis-2.1.dll": %1 is not a valid Win32 application

and when I open my tables, no data exist in it. I am new to PostgreSQL, please help me out! Have I lost all of my data? Unfortunately I do not have a backup! :(

**** update on the progress of work:

So, What I have done so far is that I copied the data directory of PostgreSQL 9.3, un-installed PostgreSQL and all of its dependencies, restarted the server (I am using windows server 2013, 64 bit), and installed PostgreSQL from scratch. It went well, but at last for installing PostGIS it gave following error again:

ERROR: could not load library "C:/Program Files/Boundless/OpenGeo/bin/../pgsql/lib/postgis-2.1.dll": %1 is not a valid Win32 application

So I decided to uninstall OpenGeo Suite as well (from Boundless) and after that tried installing PostGIS again, this time it gave me the following errors:

  psql: could not connect to server: Connection refused
  (0x0000274D/10061)    Is the server running on host "localhost" (::1)
  and accepting     TCP/IP connections on port 5432? could not connect to
  server: Connection refused (0x0000274D/10061)     Is the server running
  on host "localhost" (127.0.0.1) and accepting     TCP/IP connections on
  port 5432?


texts: Creating new layer out of shapefile after selecting attributes using QGIS?

texts:
I'm currently writing my Thesis about QGIS where it is my task to create a map of Austrias motorways (roads with the type A and B3**). I am working with a shapefile where all roads are so I selected the ones I need by looking for attributes. Now my problem is that I cannot save them as a new layer. As it comes to saving it the following message shows up:

"Export in Vektordatei schlug fehl. Fehler: Layererzeugung schlug fehl (OGR-Fehler: Failed to open Shapefile `Autobahn_Test1.shp'.)"

This pretty much says that the export to a vector-format has failed.

Error: Generating a layer has failed (OGR-error).

What else can I try to make this work?


texts: Creating tiling scheme to get multiple extents before gridding elevation data

texts: Looking to create 1 degree by 1 degree tiles with pixel overlap to get extents before I start gridding. So basically I would like to have a shapefile of the tiling scheme with extents before having the grid. Just want a more automated processes than doing this "by hand".


texts: How to set Zero values to NULL using QGIS pycalc?

texts:
I'm using QGIS 2.4 pyclac and windows 7 OS. I have columns that should show NULL value but instead of that they show Zero (0) value, I need those fields to be NULL. This far I have seen a script that will solve my problem:

TIPO_USO is a string of characters, but VOL_COMER is double, so I need to pass it to NULL as the first field. I'll use the next script, using PyCalc:

Then I get this message:

Field code block does not return 'value' variable! Please declare this variable in your code!

Now I don't know what to do because I don't work with python but I'm sure this will solve my question, I hope :D


texts:
When contributing to OpenStreetMap one can set a general ("default") name as well as further language specific names (e.g. name:de).

Example:

name Joe's Guesthouse
name:en Joe's Guesthouse
name:de Joe's Gasthof

as well as

int_name Joe's Guesthouse

Is it mandatory to set the general name key, or can I avoid using the name key, and just use the language specific name:xx keys instead?

For foreign speakers, one could only set the int_name instead of name:en.

I am confused about the the explanation on key:name description.


texts: Tuning Geoserver datastore with gsconfig

texts:
I'm trying to create a datastore in Geoserver with gsconfig and it works, up to a point where i want to enable for instance "Expose primary keys" or "Support on the fly geometry simplification" tags on the datastore.
Any suggestions?


texts:
I am trying to integrate BIM and GIS. I have IFC file, I try to import the file into CityEngine, but I failed to do so, because its say that my ifc. Files does not have a projection. I try to select projection in the list, but when I click OK button, the dialog still remains the same. Before this, I had opened the if file in ArcMap, the 3D building is appearing, but the only problem is the building is too big and isn't located at the same place. I have tried many ways to include changing the projection, but it seems doesnt not solve the problem.

Can anybody help me?


texts: How to change the type of a column of an attribute table in QGIS?

texts: So I want to change one of the columns in my table from string to real. How am I supposed to do that?


texts: WhiteboxTools returns nan rasters when lee filtering large radarsat images

texts:
I am attempting to run the following code from WhiteboxTools:

.\whitebox_tools.exe --run="LeeFilter" --input='imagery_HV_orig.tif' --output='imagery_HV_filtr.tif' --filterx=5 --filtery=5 --sigma=10.0 -m=5.0 -v

I am using the MDA sample radarsat-2 imagery (Wide_2_HH_HV_SGX).  The images are about 288 MB each and I am processing the files one at a time.

The resulting rasters produced by the script are all nan values.  I am able to successfully run the same script using smaller subsets of data.  Does the Lee filter have a maximum file size?

I am running windows 7

EDIT: The metadata get all screwed up as well:


texts: How to get the raster values of a point using Django's ORM (equivalent to ST_Value in PostGIS)?

texts:
I am working on a Django project that uses Django ORM to export raster data into PostGIS database. Here is the Django model:
from django.contrib.gis.db import models
class RasterWithName(models.Model):
    rast = models.RasterField()
    name = models.TextField()

Currently, in the database, I have 3 rows of data. The picture below shows this:

Then, I go to Django's shell using python manage.py shell. What should I write (other than RasterWithName.objects.raw() in the shell to perform a query on the rasters and get raster values for, let's say, a point with the location of (lat=10, lon=10) in a list ?
I could not find an equivalent for ST_Value in GeoDjango.


texts:
I've a problem in printing which i see the same problem in Print-Page example and Print-Preview example of GeoExt-2.
https://geoext.github.io/geoext2/examples/printpage/print-page.html
https://geoext.github.io/geoext2/examples/printpreview/print-preview.html
 Problem: The extent of map in printed pdf is larger than extent of map which is viewed by user. The user sees a map extent and after printing, receives a map with larger extent.
I didn't paste my code, because i noticed the same problem in those examples of GeoExt. (Other 2 examples of printing - i.e. Print-form and Print-Extent does not show this problem). So, it's maybe my misunderstanding of GeoExt?
Would you confirm this problem or propose any workaround?


texts: PostGIS functions for generating centerline from polygon

texts:
I want to create a centerline from a polygon and I have tried using both ST_StraightSkeleton and ST_ApproximateMedialAxis functions in PostGIS.
It gives an error with a message

straight skeleton of Polygon with touching interior rings is not implemented

and in other instances

CGAL failed to create straightSkeleton

I have tried alternative answers on this platform generating similar errors.
Here is the code
'''
SELECT
    ogc_fid,
    subtype,
    subtypecod,
    ST_ApproximateMedialAxis(geom) as geom
FROM
    sometable
'''

Is there a proper way to go about this issue?
Sample data <https://www.filehosting.org/file/details/896986/Polygon_5.zip>


texts: From ESRI:103300 to EPSG:4326 in SQL Server

texts:
This question is more or less a sequel to Performance of joining tables on a geometry column with SQL Server

As explained in the above link, I have a shapefile that I upload to my SQL Server DB using the Shape2Sql.exe tool. Then, I'm checking whether my sets of coordinates are located inside one of the polygons given by the shapefile.

The situation has however slightly changed because I now take into account the remarks I got, which still gives this:

CREATE TABLE dbo.myTable1 (
       FULL_ADDRESS varchar(120) NULL,
       LONGITUDE varchar(50) NULL,
       LATITUDE varchar(50) NULL
                           )

CREATE TABLE dbo.myTable2 (
       POLYGON_NAME nvarchar(255) NULL,
       geom geometry NULL
                           )

But I then do this:

ALTER TABLE myTable1
ADD CONSTRAINT pk_myTable1 PRIMARY KEY CLUSTERED (FULL_ADDRESS);

ALTER TABLE myTable1
ADD geom geometry;

UPDATE myTable1
SET geom=geometry::STGeomFromWKB((geography::Point(LATITUDE, LONGITUDE, 4326)).STAsBinary(), 4326);

CREATE SPATIAL INDEX table_gist ON myTable1(geom)
    WITH (BOUNDING_BOX = (minLong, minLat, maxLong, maxLat)) ON [PRIMARY];
CREATE SPATIAL INDEX table_gist_2 ON myTable2(geom)
    WITH (BOUNDING_BOX = (minLong, minLat, maxLong, maxLat)) ON [PRIMARY];

After that, I can join my tables with some pretty good performance:

SELECT DISTINCT
      mt1.FULL_ADDRESS
    , mt1.LONGITUDE
    , mt1.LATITUDE
    , mt2.POLYGON_NAME
INTO #TEMP_TABLE
FROM myTable1 mt1
LEFT JOIN myTable2 mt2
  ON mt2.geom.STIntersects(mt1.geom) = 1

With my first shapefile, it was perfectly working. Then I had to play with another file and it all of a sudden stopped being fun. I couldn't find any set of coordinates intersecting my polygons. I eventually ended up locating the problem: while my first shapefile was encoded in EPSG:4326, the second one uses ESRI:103300.

Therefore, instead of having those nice coordinates that I'm used to...

... I now get those weird ones:

It surprised me because, when using my Shape2Sql.exe tool, I always check the 'Set SRID 4326' option. I also tried the following line of code:

UPDATE myTable2 SET geom.STSrid=4326;

But it doesn't work either. That doesn't change anything to my polygons.

I'd like to find a trick so that my query can find in which polygons my points are located, like it used to do.

EDIT: As suggested in the comments, I gave a try at the ogr2ogr solution with the following command that was inspired by the Is it possible to reproject spatial data using SQL Server? topic:

C:\OSGeo4W64\bin\ogr2ogr.exe ^
 -f "MSSQLSpatial"^
 "MSSQL:server=DestServerName;database=DestDbName;trusted_connection=yes"^
 "MSSQL:server=SourceServerName;database=SourceDbName;trusted_connection=yes"^
 -sql "SELECT [POLYGON_NAME], [geom].STAsText() geom FROM [SourceDbName].[dbo].[myTable2]"^
 -nln "myTable2"^
 -overwrite^
 -s_srs ESRI:103300^
 -t_srs EPSG:4326

But I now have this error message:

  ERROR 1: Failed to process SRS definition: ESRI:103300

EDIT2: This version however seems to work:

C:\OSGeo4W64\bin\ogr2ogr.exe ^
 -f "MSSQLSpatial"^
 "MSSQL:server=DestServerName;database=DestDbName;trusted_connection=yes"^
 "MSSQL:server=SourceServerName;database=SourceDbName;trusted_connection=yes"^
 -sql "SELECT [POLYGON_NAME], [geom].STAsText() geom FROM [SourceDbName].[dbo].[myTable2]"^
 -nln "myTable2"^
 -overwrite^
 -s_srs http://spatialreference.org/ref/esri/103300/^
 -t_srs http://spatialreference.org/ref/epsg/4326/

I then did this (I followed the same instructions):

ALTER TABLE myTable2
ADD geom2 geometry;

UPDATE myTable2
SET geom2 = geometry::STGeomFromText(geom, 103300);

But it gives me this:

  Implicit conversion from data type geometry to nvarchar is not
  allowed. Use the CONVERT function to run this query.


texts: projection change to create buffer in QGIS

texts:
I am about to become desperate... I like to create buffer around several points - if possible - with a declaration of the size in km of these buffers. Just to show you what I am working with:

My problem seems to be the projection of my data. Its in the WGS84 projection and my background map is in the RGF93 / Lambert-93 projection (I dont know why that works together). With the WGS84 projection the distances will be shown in degrees, so i tried to change the projection of the background map, the projection of the data or both together but I dont find any other projection where they fit together.

Do you have any suggestions how to create these buffers with a clearly shown distance?


texts: Digitization tool not showing split in QGIS

texts: I have a line shapefile and a polygon shapefile (boundary+map). I want to split the polygon with the line (making my map have two distinct areas) . I used the digitization tool and no errors appear but the polygon is not split. I have already successfully done this with a different line file. Suggestions?


texts: Change python + ogr2ogr.exe to python + ogr

texts:
I have written several complicated python scripts that end up using ogr2ogr to load or translate data. I have been converting these scripts to standalone exe files meaning the team do not require Python installed and some of the additional modules I use in other parts of the code.

However, I always end up using a subprocess and calling shp2pgsql.exe or ogr2ogr.exe, like this

load_ogr = """ogr2ogr --config PG_USE_COPY YES -a_srs "EPSG:27700" -skipfailures -gt 65536 -f PGDump /vsistdout/ %s -lco GEOMETRY_NAME=geom -lco SCHEMA=data -lco CREATE_SCHEMA=OFF -lco CREATE_TABLE=OFF -lco SPATIAL_INDEX=OFF -nln %s | psql -d multi -U postgres -f -"""%(shapefilename,tablename)

run = subprocess.Popen(load_ogr, shell=True)

run.communicate()

Which iterates through a file list and loads the data in.

However, I can not bundle this code effectively into a standalone exe because it calls ogr2ogr found via it being installed on the host machine and found in the PATH

How can I change this to use the python ogr bindings (ogr.py)?

I have found very little code examples or tutorials on how to use the python ogr version, so any pointers to good resources would be very useful too


texts:
i created some number entry in QGIS modeler

I created them specifically for them to be decimal numbers and not integer.

But when i try my model, when i put a decimal number like 0.255 the value on the screen stays at 0. So it doesn't want to have decimal but just integer.

Do someone has an idea ?


texts: Import XML workspace into enterprise geodatabase with different spatial reference system

texts:
An XML document with the schema definition of a geodatabase (ESRI Format) is available to be restored in another server (UPDM definition 2018).
The definition was created with the spatial reference 102968 (NAD_1983_2011_Michigan_GeoRef_Meters). I t is required to apply this schema to a brand new geodatabase but using the spatial reference WGS84.
The tool Import XML workspace does not have the option to change the spatial reference.
This document is a one-line xml with a huge amount of data. It is quite cumbersome to change the spatial reference, moreover if you do not have the knowledge of the xml schema.
Is there a way to automatically change the spatial reference either in the XML or in the import process?


texts: Can I no longer see my view counts in the new dashboard?

texts: The inset graphic shows the relative up and down of each day's views, but I can't see any numbers. I'd love to continue tracking my monthly stats.


texts: Any freely available vector data in cylindrical projection?

texts:
I'm trying to develop an application in PHP to plot various points in Europe from a database, and serve them dynamically on a map.

I think this should be relatively straightforward when using a map in the cylindrical projection - but I just cannot find one.

I only require country borders, and pretty low level of detail. The smallest section of the map to be displayed at one time is likely to be the UK, and the largest output size is probably around 1280 x 1024px.

Does anyone know of a freely available (or paid, if free isn't an option) vector?

Many thanks,

Jack


texts: Attempting to convert from GML to GeoJSON produces garbage

texts:
The file seems to convert without error, however when I attempt to display it on anything or any map, the coordinates are always rendered as a straight line across the top of the projection. I am not certain if the problem is my map or the conversion suite.

The data I am trying to convert is from StatsCan, which can be found here:

http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-i-eng.cfm?year=15

I'm starting to think they did something screwy with the format - this doesn't work (either from gml or shp), but I can follow the same process with other files and get it to work.


texts: Merging lines after using split lines at points in ArcGIS Desktop?

texts:
I have a big hydrologic network that I split using the split lines at points tool with a file of points placed along the lines every 100 meters. But when I do that I have a big amount of smaller lines that appeared (and not just because some lines have their last segment thats too short to be separated in 100m segments). I'm not quite sure why they appear but I was wondering if there was a way to select the smaller lines (say the one smaller than 20m) and merge them to the closest adjacent big segment of line.

Do you know if there is a way to do that ?

I was told to use "eliminate" with the line option but I dont see it on the tool's window (see picture).

What can I do to have that option ?


texts: How to split polygon with multiple points in QGIS?

texts:
I am working on spliting a polygon which includes multiple points.

I tried it manually but due to the large dataset it is very time consuming.

Are there any automated tools or plugins to do that?

I wanted to split polygon which includes the point (Multiple Location).

The final output will be a polygon for each point.


texts:
I need to to in the field calculator the following calc: toint(Field1 / 25.0) but i need to round the result to no decimal places but upwards. Exmaples:

If 17/25 result should 1.
If 25/25 result should 1.
If 26/25 result should 2.
If 51/25 result should 3.
...
I guess i need to use round function but it is not giving the results i am expecting.


texts: Create points equally spaced along an area in QGIS

texts:
What's the best way to create points equally spaced in QGIS using a specific area?

For example, I want to create points spaced 1 meter in both X and Y direction.

The Image below describes better what I want:


texts:
I am trying to overlay a geoserver map with projection EPSG:3021 with Google Streets and OpenStreetmap. Does anyone know why I keep getting to null island? (its supposed to be over the city of Lund, Sweden) And also why the Google street map does not show?

<script>
//Defining projections
    var geographic = new OpenLayers.Projection("EPSG:3021");
    var mercator = new OpenLayers.Projection("EPSG:900913");

 //Defining bounds
    var world = new OpenLayers.Bounds(13.12, 55.67, 13.27, 55.74).transform(
        geographic, mercator

    );
//Defining map center
    var lund_center = new OpenLayers.LonLat(13.19, 55.71).transform(
        geographic, mercator
    );

    var options = {
        projection: mercator,
        displayProjection: geographic,
        units: "m",
        maxExtent: world,
        maxResolution: 156543.0399,

    };
//Defining main variables
    var map = new OpenLayers.Map("map", options, { controls: [] });
    var osm = new OpenLayers.Layer.OSM();
    map.addLayer(osm);
    var gmap = new OpenLayers.Layer.Google("Google Streets");
map.addLayer(gmap);

//List of layers
    var lund = new OpenLayers.Layer.WMS(
        "Stadsdelar",
        "http://localhost:8080/geoserver/wms",
        {layers: "lundpr:Stadsdelar",
        transparent: true}
    );
    map.addLayer(lund);
    ///////////////////////////////////////
    var vagar = new OpenLayers.Layer.WMS(
        "vagar_alla",
        "http://localhost:8080/geoserver/wms",
        {
            layers: "lundpr:vagar_alla",
            transparent: "true",
            format: "image/png"
        },
        {isBaseLayer: false, visibility: true}
    );
         map.addLayer(vagar);
    ///////////////////////////////////////

//Map center and zoom
    map.setCenter(lund_center, 14);

//List of controls
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.addControl(new OpenLayers.Control.KeyboardDefaults());
    map.addControl(new new OpenLayers.Control.Navigation());

//Coordinates of mouse position
    map.addControl(new OpenLayers.Control.MousePosition());
</script>


texts: Loading .shp file into QGIS gives error message

texts:
When I add vector layer I select the .shp file and nothing happens
When I add vector layer and I select the folder it gives error message "not a valid or recognized data source"
The pop up box queries for a directory not a folder - does this create an issue?


texts: QGIS as OGC Data Server only returns white box

texts:
I just setup my QGIS Server as a OGC Data Server following: Installation on Debian-based systems.

When I try to access it and retrieve my QGIS project using the following link http://localhost:8080/qgisserver?SERVICE=WMS&REQUEST=GetMap&MAP=/projects/example/world3.qgs&LAYERS=countries&WIDTH=400&HEIGHT=200&CRS=EPSG:4326, I just receive a 400x200 white box. Any idea what could cause this?

This log was created for the request: https://pastebin.com/h9sTycg2

A GetCapabilities request to the following link

http://localhost:8080/qgisserver?SERVICE=WMS&REQUEST=GetCapabilities&MAP=/projects/example/world3.qgs

produces the following output: https://pastebin.com/iqGDFhxU

I tried to setup the server 3 times now following the documentation and I always end up with the QGIS server only returning white boxes instead of the map.


texts: Python pyModis installation give error on windows 10 using pip install pyModis

texts:
I am using windows 10 operating system on my HP i7 machine with Python 2.7 installed. For windows, it is possible to install pyModis using pip by writing the following syntax in Windows PowerShell:

pip install pyModis

But it give me error like:

  Failed building wheel for GDAL Failed to build GDAL Installing collected packages: GDAL   Running setup.py install for GDAL
Complete output from command c:\python2.7\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\oaamer\\ap

  pdata\local\temp\pip-build-j1djwe\GDAL\setup.py';exec(compile(getattr(tokenize,
  'open', open)(file).read().repl ace('\r\n', '\n'), file,
  'exec'))" install --record
  c:\users\oaamer\appdata\local\temp\pip-njzqtm-record\install-rec
  ord.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      running build_ext
      building 'osgeo._gdal' extension
      C:\Users\oaamer\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD / W3 /GS- /DNDEBUG
  -I../../port -I../../gcore -I../../alg -I../../ogr/ -Ic:\python2.7\include -Ic:\python2.7\PC -Ic:\pytho n2.7\lib\site-packages\numpy-1.9.2-py2.7-win32.egg\numpy\core\include
  /Tpextensions/gdal_wrap.cpp /Fobuild\temp.win32-2.
  7\Release\extensions/gdal_wrap.obj
      gdal_wrap.cpp
      C:\Users\oaamer\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception
  handler used, but unwind semantics are not enabled. Specify /EHsc
      extensions/gdal_wrap.cpp(2859) : fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or director y
      error: command 'C:\Users\oaamer\AppData\Local\Programs\Common\Microsoft\Visual
  C++ for Python\9.0\VC\Bin\ \cl.exe' failed with exit status 2

how to fix that error i have tried so many times to fix read different blogs but did not find the possible solution as windows does not provide friendly environment.


texts: Copying attachments to new feature class

texts:
I'm trying to bring attachments from a feature class to a new feature class (using all the same attributes). My problem with the old feature class is I've had to reorder the fields. I have figured out how to reorder my fields list (used a "ReorderFields" python script). I then loaded the old feature class into the new one. Problem I am running into is the GlobalID is different from the old feature class to the new and the attachments on the old feature class run on those GlobalIDs...

Does anyone know how to fix this?

Maybe reorder my original feature class without having to recreate a whole new one?

Or bring over the GlobalIDs to the new one so it can connect that way?