texts: Limitations for workspaces in GeoServer?

texts:
I have installed the Geoserver 2.14.2. I need to know whether there is any limitations in terms of the number of workspaces that could be added to a geoserver instance.

If so, what is the constraint limit?


texts: buffering one feature class by different distance, the result is the buffer distance become same 100 feet

texts:
try:
# Import modules
    import arcpy
    from arcpy import env
# Set the workspace
    env.workspace = r"C:\Esripresspython\GISTPython\Data\City of Oleander.gdb"
# Create a variable with the name of the subject feature class
    fcName = "StreetLights"
# The buffer distance is dependent on the type of light
# Check to see what type it is
    typeCursor = arcpy.da.SearchCursor(fcName,["TYPE"])
        for row in typeCursor:
        lightType = row[0]
# TYPE == MV uses a buffer of 125
# TYPE == MVH uses a buffer of 160
# TYPE == SV uses a buffer of 100
# TYPE == SVH uses a buffer of 200
        if lightType == "MV":
            lightBuffDist = 125
        elif lightType == "MVH":
            lightBuffDist = 160
        elif lightType == "SV":
            lightBuffDist = 100
        else:
            lightBuffDist = 200
# perform the buffering
    arcpy.Buffer_analysis(fcName,r"C:\Esripresspython\GISTPython\Data\City of Oleander.gdb\LightBuffer",lightBuffDist)
    print "Done"
except:
    print "the process did not complete."

Buffering the street light by different distance, to determine whether there are any areas of town that do not have adequate nightlight illumination.
this program works but the value of buffer_Distance became 100. I was wondering why this situation happened?


texts: Step-by-step: How do I extract Raster values from Polygon overlay with Q-GIS or R?

texts:
I am writing my master thesis at the moment and am having the exact same problem as user Curley in this question: I first need to overlay a Corine 2006 raster with a polygon layer (2638 polygons). Then I need to extract the proportion (%) for each class within a polygon layer so I get a table like

                1 (e.g. arable land)           2 (e.g. forest)          3 (e.g. water)

Polygon 1      11 %                            0%                       89%
Polygon 2      23 %                            60%                      17%

The statistics plugin Lecos that is being provided crashes my computer despite updating the libraries.

Since I am lacking experience am not yet able to completely reproduce the solution in R. I could follow the example as far as

> c=raster("cumbria.tif") # this is my CORINE land use raster
> summary(spd)
Object of class SpatialPolygonsDataFrame
[...]
> nrow(spd)  # how many polygons:
[1] 2

> ovR = extract(c,spd)
> str(ovR)
List of 2
 $ : num [1:542] 26 26 26 26 26 26 26 26 26 26 ...
 $ : num [1:958] 18 18 18 18 18 18 18 18 18 18 ...

> lapply(ovR,table)
[[1]]

 26  27
287 255

[[2]]

  2  11  18
 67  99 792

but when I try to reproduce Curlew's next step:

...
tab <- apply(ovR,table)
# Calculate percentage of landcover types for each polygon-field.
# landcover is a datastream with the names of every polygon
for(i in 1:length(tab)){
 s <- sum(tab[[i]])
 mat <- as.matrix(tab[[i]])
 landcover[i,paste("X",row.names(mat),sep="")] <- as.numeric(tab[[i]]/s)
}

I'll receive the following Error message:

 [Error] length of 'dimnames' [2] not equal to array extent

So I created the list of tables with lapply. Now I need to attach it to the attribute table of my polygon layer.

The first row of each table in this list contains the landscape classes (their ID) that lie within the polygon. The second row is the number of raster cells of each class within the polygon. It is presence-only, so the tables never show a class with zero cells and have different sizes.

The landscape class ID should now be the header of the new columns I want to attach to the polygon layer.

Then I need to calculate the percentage of the classes for each polygon.

I would be very grateful if you could give me a more detailed step-by-step description of what happened in the final step by Curlew, or maybe provide another solution in R as I will be using it for my data analysis later. Thanks!


texts: Programmatic conversion between GML and GeoJSON

texts:
I am modifying a .Net (C#, MSSQL) system to add some geography that I'd like to display on a leaflet map.

I had originally expected to save GeoJSON directly into text strings in the DB, but after seeing some SQL2008 spatial types, I wonder if I'd be better served by keeping it as WKT or GML so I can run SQL-Spatial queries against it and use C# native objects.

But then, I need to get stuff into GeoJSON or some other leaflet-compatible format.

I realize there are utilities to do the conversion (Convert GML to GeoJSON), but I can't use that on the fly to serve content.

Am I barking up the wrong tree? Any chastisement is welcome. =)


texts: Is there a way to maintain map tips and/or actions in an exported PDF using QGIS?

texts:
I am working on a project that displays the locations of a group's projects in a city. I have it set up now so that map tips shows the name of the project and location when you hover over the point. I am planning to set up actions so that you can click on the point and it will bring you to a web page with information on that project.
Is there a way to maintain these features in a PDF exported map? If not, what is the point of using these features unless my audience is other GIS users?
I am thinking a workaround might be to include the names of each project in another layer with just the labels and export as a GeoPDF with togglable labels but that is not ideal. And with the actions maybe embed the PDF with hyperlinks after QGIS export. Although, these are not ideal options.
What else can I do?


texts: ArcGIS Enterprise Sites 10.8.1: Problem with Layer Description in Feature Service

texts:
I have published a number of Feature Layers (hosted) and want to make them accessible to the web via ArcGIS Enterprise Sites. I published via ArcGIS Pro 2.5.2, the data originally comes out of a SDE database and has been copied to the Datastore during the process.
Obviously, I want to add a nice description to every dataset that explains the data and also supports the search.
While I have been able to get the description to work in the portal (automated with Python) (see below)...

.... this is not the same what I get as description in  ArcGIS Enterprise Sites (see below):

When I click on the Layer in Portal, I see the following:

Obviously Sites shows the description from the layer and not the one in Portal. Is this on purpose?
If yes, how is it possible to change the description?
I have tried that programmatically as below:
search_result = gis.content.search(query=...)
for i in search_result:
   for f in i.layers:
   f.properties.description = i.description

and also:
for i in search_result:
      update_dict = {'Description': i.description}
      subitem = FeatureLayerCollection.fromitem(i)
      subitem.manager.update_definition(update_dict)

This seems to work, but it does not get saved. I have also tried "updateDefinition" via REST, but it did not get saved either. Any idea what I can do to make it work? Making the layer editable does not change anything. However, I can change other settings like the capabilities (Query, Extract) with the same approach as above and it gets saved.
Do I make a mistake somewhere?


texts: Bulk lookup of address census tract and block

texts:
Is there a free or cheap way to code a large number of addresses and return or append the census tract and block data?

There are a number of ways to geocode an address and get the lat long, but I really need to get the census tract and block data.


texts: I want to georeference a *.jpeg object but I cannot even add the data to ArcMap which does not seem to see the files?


texts:
I have a network graph that I need to simplify in the sense of reducing the number of edges. The idea would be to merge nodes that are located close together and remove the connecting short edges.

How could this be achieved in PostGIS or GRASS? Or are there any better approaches to automatically simplify a network like this?

I've already tried ST_SnapToGrid function but I'm not happy with the results (grey = original, black = snapped):


texts:
I have a little situation with my data. I have vectorized a raster layer, and now I have some issues with the geometries, as you can see in the picture. Most of errors I have are like this one. Several polygons intersect themselves only in one point.

I identified them with Vector > Geometry Tools > Check geometry validity. How can I fix them automatically with QGIS?


texts: Invalid fields when using "Use completer" in Layer properties

texts:
I'm using the latest release of QGIS 2.18.9.

I've made a field in a layer without NULL and connected by relation to a fixed list of values from another layer. Then I checked "Use completer" option (you can see it in the picture).

When I make a new object in that layer I always get invalid values just like I would still have null in that field. I can't put any objects in that layer.

When I uncheck "Use completer" in properties I have to use a list of choices in that Field and this way gives no error.

I want to use completer because its a better option when typing geographic names in a field.

Did someone encounter this kind of problem before?


texts:
I have a couple of three-band satellite images that I want to apply an expression to and get a three-band output.

The expression is of a simple form: output_pixel= (input_pixel*d^2)/cos e

After reading the OTB cookbook I believe BandmathX is the application I need.
However i am unsure how to formulate the command to get my expression applied to each pixel in all three bands.

What is the correct command to achieve this?


texts: Performing Distance Calculation using Excel?

texts:
Is there a way (preferably in Excel) to calculate the distance (based on lat, lon) between two lists of points?

My end goal would be, for example, to have a list of Starbucks and a list of McDonald's, and then show the nearest neighbor, if you will.


texts: Single label for multiple features with different values in ArcGIS Desktop?

texts:
I have several sample locations, that have been sampled several times at the same location. I want to label each location with stacked data from each location. So it would hopefully look like this

"Sample Location 1:

Depth 0-6: .314

Depth 6-12: .315

Depth 12-48: .398"

And so on. The problem right now, is that if I try and label them with label expressions, I can stack the fields but not the rows. So I get 5 labels for each location. This is because the depth measurements have their own points. I need the unique values so I cannot dissolve/aggregate the points into mean values, so that eliminates a lot of tools.

I also cannot simply display the different readings in labels located around the point. Because there are so many points, and I need to label all of them, the only way I can think of to label all of them at once is to combine them into single labels for each point and THEN do Maplex operations to get all the labels displayed properly.

I have explored python expressions and I am having a hard time finding something close to what I am doing. This StackOverFlow question has been suggested for me to attempt but it has not worked for me:
Can labels for overlapping points be combined/merged into one label?

When I try the "Update #2" code in that solution it simply says "No Features Found: Could not Verify Expression". I am also not sure that's what I am even looking for because I do not want the sample data averaged or aggregated; I want the unique sample data displayed for each point.

In terms of label expression, I think of pseudocode like this:

def FindLabel ( [SAMPLE], [DEPTH], [READING]):
     print [SAMPLEID]
     for [DEPTH] within [SAMPLEID]:
        return [DEPTH],  [GLNPO_TOTA], [FIELDS_TOT]

Where hopefully it would be possible to have ArcGIS display a sample location, then the depths and values below it, all as one label. That's the idea at least.


texts: How to reproject 500 CSV files efficiently and easily using QGIS?

texts:
I know, my question is similar to some old ones on this site.

I've a lot of CSV files (geo coordinates) to import to qgis (and then to convert them), and the usual way is not the best way to do it (too long).

I have almost 500 CSV files (wgs84 coordinates) and this is what I want to do:

Import all CSV files at once into QGIS
Project them
Export them into CSV files (again) but with different coordinates (convertion to UTM33N)

I'm trying to understand how to use the python console but I'm not moving on :(

Can anyone explain to me how to achieve it step by step?


texts: Are there any Open Source (Also Free) GeoBI solution?

texts:
I am searching for a BI suite with Geo capability.

It should have basic function like showing spatial data from spatial database like postgres/sqlserver etc (Qgis like feature)
It should have dashboard functionality (also in real time).
It Should be able to create thematic map of different kinds (point,region ranges etc)

I want to know this before I start coding on my own?

Solution I have gone throught:

Petaho
Jasper


texts: OpenLayers 3 - different style/marker for each point on a MultiPoint feature

texts:
I have a MultiPoint feature with the following GeoJSON:

{
    "type": "Feature",
    "geometry": {
        "type": "MultiPoint",
        "coordinates": [
            [
                -123,
                58
            ],
            [
                -152.32,
                17.5
            ],
            [
                52.02,
                42.64
            ]
        ]
    }
}

When I draw this on map and apply any icon through a style function, its applied for all points. But I would like to show all the three coordinates above with different icons on map. Is there any way I can add different markers for each coordinates in a Multipoint feature?


texts:
I have a table of points and I'm trying to visualize their distributions.
Each point has a POINT geometry (WGS84) and some numeric attributes: a, b, c.

| id | geom       | a  | b | c |
|-----------------|----|---|---|
| 1  | POINT(...  | 12 | 9 | 2 |
| etc ...                      |

The first thing I tried was to project to an equal area projection (EPSG: 3175), use ST_SnapToGrid and then group on the resulting point geometry.

SELECT
  avg(a), avg(b), avg(c),
  ST_Transform(ST_SnapToGrid(ST_Transform(geom, 3175), 50), 4326) AS bin
FROM points
GROUP BY bin

This groups the points into 50x50 meter bins with their aggregate values which I can import into qgis to play with. I optimized this by adding another column to the points table called bin_id which was a foreign key to a bins table:

| id | geom      |
|----|-----------|
| 1  | POINT(... |

Then I could write queries like this:

SELECT avg_a, avg_b, avg_c, geom
FROM (
  SELECT
    avg(a) AS avg_a,
    avg(b) AS avg_b,
    avg(c) AS avg_c,
    bin_id
  FROM points
  GROUP BY bin_id
) AS tmp
JOIN bins ON tmp.cell_id = bins.id

This all works fine but i want to use Rasters instead. All the examples I've seen show how to import existing rasters or shapefiles into PostGIS. But I need to know how to generate one from data already in PostGIS.

Ideally I want a raster with 3 bands: avg_a, avg_b & avg_c

Can someone point me in the right direction?

EDIT 1: I'm not opposed to doing it outside of the database.
EDIT 2: Seems like I can use the GDAL API to do it.


texts: Displaying QGIS's "Map Tips" in OpenLayers?

texts:
Still a little new to QGIS and Openlayers.  How would you display QGIS's "Map Tips" into OpenLayers? I am currently using QGIS 2.18 and have the latest update in Openlayers. In QGIS, I have created a display in Map Tips showing a county's information when you hover over the county. Now need display the "Map Tips" into openlayers.

Now I know you can create map pop ups in OpenLayers but thinking that involves alot of code and wanted to see if it is possible that we can do it in QGIS.

OpenLayers basically takes images that get render by QGIS and display them in the map. I have applied the "Map Tips" within the outline layer and can display it in QGIS. I assume that with QGIS, it can render and create the image with the "Map Tips" inside an image.  What I need it to do is whenever someone hovers over the county name or the county's area within the map, the "Map Tips" display will pop up and show the user information.  I feel that there has to be a way to display the "Map Tips" in OpenLayers.

Here is part of the code from OpenLayers to pull up that particular layer:

<script>
     var projection = new ol.proj.Projection({
            code: 'EPSG:3857',
            extent: [-11822316, 4304590, -9430259, 6360040]
     });

    var  extent = [-11822316, 4304590, -9430259, 6360040];

 var outline_layer = new ol.layer.Image({
        extent: extent,
        label: 'outline_layer',
        visible: true,
         source: new ol.source.ImageWMS({
                url: '/map/qgis_mapserv.fcgi?MAP=mapping.qgs&',
                crossOrigin: 'anonymous',
                params: {
                    'LAYERS': 'Outlines',
                    'FORMAT': 'image/png'
                },
            serverType: 'qgis',
        })
    });
var map = new ol.Map({
    controls: ol.control.defaults().extend([
     new ol.control.ScaleLine()
]),
    layers: [ background_layer,
        outline_layer],
    target: 'map',
    view: new ol.View({
        projection: projection,
            center: [-10597609, 5335488],
            extent: extent,
            zoom: 1.8
    })
});

var changeLayer = function changeLayer(ev) {
    var val = $(this).val();
    var checked = $(this).is(':checked');
    map.getLayers().forEach(function (layer) {
        if (layer.get('label') === val) {
        layer.setVisible(checked);
        } else {
            layer.setVisible(false);
            outline_layer.setVisible(true);
            jurisdiction_names.setVisible(true);
        }
    });

    $('input:checkbox').not($(this)).each(function () {
        $(this).attr('checked', false);
    });
};

$('input').each(function () {
    $(this).on('change', changeLayer);
});

Is there a way to display QGIS "Map Tips" in OpenLayers?


texts:
I have a database and exporting with pgsql2shp various shapefiles. But when I open the dbf the characters are displayed wrong. Example: BroeksterwÔld and this should be Broeksterwäld.

This probably has to do with encoding. The database is UTF-8. I tried to export the shapefiles as LATIN1, but I can't figure out how to do so.

UPDATE

I solved this problem by adding 'set pgclientencoding=latin1' (without quotes) to the batch script.


texts: Zonal statistics error - Algorithm Zonal Statistics starting... DatasetReadAsArray() got an unexpected keyword argument 'interleave'

texts:
After updating QGIS to 2.18.28 I cannot use Zonal Statistics. As soon as I use it (Raster EPSG 25830 and Polygon 25830), I get the following error message "Algorithm Zonal Statistics starting...

  DatasetReadAsArray() got an unexpected keyword argument 'interleave'
  See log for more details"

Can anyone reproduce this issue?


texts:
I have shapefile that has data about each country like population size, smoking rate and more.
Is there any simple way to display this data as circles on top of each country?
something simmilar to the quantity in arcmap,
like we see these days with the corona maps:

I have tried from the diagrams but seems like it's from there. also Thought to create centroid and then display by size but was wondering if there is easier way.

My end goal : to be able to display quantity data with circles.


texts: Find and Replace ALL function in QGIS field calculator

texts:
We are trying to figure out if there is a way to find and replace a "\n" string with the character "-" (hyphen).

Excel does a great job finding and replacing all, but not sure how to do same function in QGIS.

Note that the attribute table contains about 1000 of these strings so it would have to be a function that would look within the string for the \n characters without having to input the specific string by hand, if that makes sense.


texts: Unable to open GRASS GIS from command line

texts:
I am trying to start GRASS GIS from the command line in ubuntu 14.04 and i keep getting the following error:

user@computer:~$ grass
Cleaning up temporary files...
Traceback (most recent call last):
  File "/usr/bin/grass", line 1973, in <module>
    main()
  File "/usr/bin/grass", line 1854, in main
    clean_temp()
  File "/usr/bin/grass", line 1593, in clean_temp
    call([gpath("etc", "clean_temp")], stdout=nul)
  File "/usr/bin/grass", line 245, in call
    return subprocess.call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

If i open it from the icon it starts normally, but i still want to why this is happening and if there is any solution


texts: Grouping clustered points within 50 meters and export new data Google Maps

texts:
I have tracking device on our company vehicles. It records and track all vehicles movements.

Also for every stops for more than 5 minutes it record the current location Lat, Long as "stop"
the problem is that the even for 1 place (eg. our company) the Lat,Long  of the stop is different because of place of vehicle parking spot changes

Also if there is a car traffic on the road it'll record a lot of locations

Now I have a record of almost 5000 stops locations  that are duplicated but with little difference on lat and long (within 1 year)

This an example of one place (our warehouse)

and this is an example of parking the car around office building

Now that I have clustered the points using Google Maps API, (still I need to modify the cluster to include many near points)

  My Question:

  What I need to do is to clean my data so all clustered points (Lat, Long) with have the same values.

  How can I do that with my large set  of data?

I should have at least about 400 client and company locations that are duplicated in the same location with the same Lat and Long.

Plus random traffic location on the road.

It doesn't matter what programming language or software I use just guide me to the point and I will continue the job.

Actually I have tested QGIS Software before (simple quick use)

this is the main request for my question

My current HTML JS Google maps script:

<!DOCTYPE html>

    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>locations</title>


texts: Georeferencing CAD drawings without preserving aspect ratio

texts:
I have a CAD drawing (DWG) format that I would like to georeference to my basemaps that are projected in UTM coordinates. This drawing is done to scale without any geographic referencing.

In ArcGIS Desktop, the georeferncing toolbar allows for 2 control points in the CAD georeferencing process, so as to preserve the aspect ratio. I would like to introduce skewness because of the projected coordinate system.

Advice required on the spatial alignment of the CAD file to a projected basemap.


texts: QGIS 3.0: Naming layers for saving in GeoPackages programmatically

texts:
I have problems to save a vectorlayer at QGIS 3.0 with his original name in a GeoPackage.

canvas = qgis.utils.iface.mapCanvas()
layer = canvas.currentLayer()
writer = QgsVectorFileWriter.writeAsVectorFormat(layer, "V:/test_layer/test_gpkg", 'utf-8', layer.crs(), "GPKG")

With this code I create a Geopackage with the selected vectorlayer in it. The only Problem is that the saved vectorlayer has the same name as the GeoPackage.

Can somebody help me to save the vectorlayer in a different name than the GeoPackage and maybe how to add other vectorlayers?


texts: Search Cursor to apply summarize statistics to all the row in a column

texts:
I use the following logic in ModelBuilder to get a result as seen below:

A feature class has a Column with the name "Value" which is passed through to the Summary Statistics Tools which calculates the Mean of the Column "Value".

The Get value tool then retrieves this from the summary table created and passes it to the calculate field tool. This one value is then added to all the row in the column named Mean.

arcpy.Statistics_analysis(outPRJ, r"C:/Users/dean/Desktop/Script Dependencies/03_Output/4_Stats/minValue.dbf",
                          [["Value", "MIN"]])

tableMin = r"C:/Users/dean/Desktop/Script Dependencies/03_Output/4_Stats/minValue.dbf"
fieldMin = ["MIN_Value"]
with arcpy.SearchCursor(tableMin, fieldMin) as cursor:
    for row in cursor:
        MinValue = print("MIN_Value: {}")

arcpy.CalculateFields_management(outPRJ, "Min", MinValue, "PYTHON_9.3")

I want to use the same logic in a python script by using a search cursor and tried the code below which gives me an error. The Error received is the following:

Traceback (most recent call last):
  File "D:/Dropbox Data/Dropbox/02_Agrimotion/ZZZ_Scripts/Chem Soil Interpolation - Updated Header Names.py", line 189, in <module>
    with arcpy.SearchCursor(tableMin, fieldMin) as cursor:
AttributeError: __enter__


texts: SSL error on a freshly installed QGIS 2.14.1

texts:
I would like to ask for a help on how to fix the SSL error I'm having on a fresh installed QGIS 2.14.1 version. It seems to me it's the reason why vector, raster, and some other tools won't work when I use it. It crashes my QGIS every time. Can somebody point out how can I possibly fix the problem?

Please see attached images for reference.


texts: reverse geocoding api with no limitation?

texts:
I was wondering for reverse geocoding api, which doesn't apply any per day or monthly limit on the data? Till now all i have got is google api and geonames api.
I need to get postal code from latitude and longitude of location.


texts: Save map canvas as image with Python in QGIS

texts: I'm trying to save the map canvas as an image in Python in QGIS. I've looked in a few places but haven't been able to get something to work. I need a function where I can specify the extent of the map and the image size. Very similar to the "snapshot" command line function that can be used with QGIS. But the problem with the snapshot function is that it has to start QGIS each time and then close it.


texts: How to create linestrings with a definite angle and length, that are fixed to a point

texts:
I want to create linestrings with a definite angle (e.g. 160°) and length (e.g. 2m) that are fixed to a number of points of another linestring. So, I want to use the ST_DumpPoints function to find the points and bind the created linestrings to them.
Is there a way to declare an angle (α) during the linestring creation?
Here is an example picture:

I want to create the blue linestrings.

EDIT

The angle (α2) in the picture isn't really exemplary. But rather an azimuth of 160° (like α1).

UPDATE

The answer from Evil Genius helped me calculating the maximum width of a polygon with a given aspect.


texts: GeoServer different styles for one layer?

texts:
In GeoServer I have a layer created from a database table with the following structure:

  tableX ( id,name,typeid,description,geom )

The geom field is always a polygon. I also have created 3 different styles in GeoServer, basically 3 kind of polygons with different colours.

What I'm trying to do is to serve one WMS layer with different styles, filtering them by typeid field. So, if:

typeid = 1 I use the first style (Green polygon)
typeid = 2 I use the second style (Blue polygon)
typeid = 3 I use the third style (Red polygon)

  Is this possible in GeoServer?


texts: QGIS plugin WORKS under Windows but NOT under Linux. How to get fîle path properly under Linux?

texts:
I am currently working on a QGIS plugin which depits node to node discreet flows. Let' say adaption of Tobler's Flow Mapper to QGIS.

Plugin currently tested and working under Windows. But not under Linux or MacOS X.

As far as I can figure, this is due to a path problem where user chooses the output shapefile location.

Here is what code look likes:

def OutputShp(self):
    dlg = FlowMapperDialog()
    fd = QtGui.QFileDialog(dlg)
    global SaveShpName
    global SaveShpDirectory
    SaveShpName = fd.getSaveFileName(None, 'Shapefile(*.shp)', 'Type output shapefile name', '*.shp')
...
...some code...
...

SaveDirectory = os.path.realpath(SaveShpName)
flowpyv07.shapefilemaker(FlowType,str(SaveDirectory), str(SaveShpName),str(InputMatrixName),str(InputNodesName),str(combotext))

When I run it I get the following error:

Traceback (most recent call last):

File "/home/user/.qgis//python/plugins/FlowMapper/flowmapper.py", line 1346, in run

SaveDirectory = os.path.realpath(SaveShpName)

File "/usr/lib/python2.7/posixpath.py", line 358, in realpath
if isabs(filename):

File "/usr/lib/python2.7/posixpath.py", line 53, in isabs
return s.startswith('/')

AttributeError: 'QString' object has no attribute 'startswith'

Python version:
2.7.3 (default, Aug  1 2012, 05:27:35)
[GCC 4.6.3]

QGIS version:
1.8.0-Lisboa Lisboa, exported

However, if I enter the "SaveDirectory" path manually in the code such as "/home/user/Documents/" it works like charm. Thus I think I cannot get the path correctly. Any suggestion is valuable since users regret if it does not work under Linux.

If needed, full source code and plugin is avaliable from the QGIS repo:
http://plugins.qgis.org/plugins/FlowMapper/


texts:
Is there any way to get the geometry line from google maps where you ask for a route?

I would want to get the blue line in this image, in order to get some of them programatically.

I know that I can get transit information from goole API, but I do not know if there is any way to get the geometry.


texts:
I have a table with two geometry types, one with WGS 87 (4326, polygon) and the other with 5347 (local proyection, planar).  When the table with 5437 is created or updated in QGIS, the trigger should update this row on 4326.

My problem is, when I save the changes I get:

  Postigs error adding spatial object: ERROR:  the column «geom» does not exist.
LINE 1: SELECT (st_dump(st_transform(geom,4326))).geom
                                     ^
QUERY:  SELECT (st_dump(st_transform(geom,4326))).geom
CONTEXT:  function PL/pgSQL varios.simple() line 6

Trigger:

CREATE OR REPLACE FUNCTION varios.simple()
  RETURNS trigger AS
$BODY$
    BEGIN
        IF NEW.id IS NULL THEN
            RAISE EXCEPTION 'id no puede ser null';
        END IF;
        NEW.simple = (st_dump(st_transform(geom,4326))).geom;
        RETURN NEW;
    END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION varios.simple() OWNER TO postgres;
GRANT EXECUTE ON FUNCTION varios.simple() TO public;
GRANT EXECUTE ON FUNCTION varios.simple() TO postgres;

CREATE TRIGGER "simple" BEFORE INSERT OR UPDATE ON capas_gral.asentamientos
    FOR EACH ROW EXECUTE PROCEDURE varios.simple();


texts: Using Rasterio to work with two rasters of different extent and resolution?

texts:
I have two spatial rasters of different extent and different cell size and I want to do a conditional statement with them. I decided to use rasterio for that. I use this code:

with rasterio.open('A.tif') as src:
A = src.read()

with rasterio.open('B.tif') as src:
B = src.read()

C = np.where ((A == 2) & (B == 1), 1, 0)

This is the error message:

  operands could not be broadcast together with shapes (1,982,1042)
  (1,701,851)

What is the method to deal with this?


texts: Extracting multiple Subdataset from hdf files to geotiff format using ArcPy?

texts:
I have 165 hdf files(monthly data) of EVI(Enhanced Vegetation Index) , I need to convert them to a geotiff format. In ArcMap 10.1  I can only extract the data one file at a time.

I have this python code for extracting the data. The problem is it only extracts 11 tiles of one month that covers the study area. Say for example January only.
How do I change it so that it accounts for all 165 files at one go.

import arcpy
from arcpy import env
from arcpy.sa import *

arcpy.env.overwriteOutput = 1
arcpy.CheckOutExtension("Spatial")

inPath='D:/Input/'
outPath='D:/OutPut/'
env.workspace = inPath
arcpy.env.scratchWorkspace = inPath
hdfList = arcpy.ListRasters('*','HDF')

for hdf in hdfList:
    eviName=hdf[8:16] + ".tif"
    print "Subsetting EVI band from ....."+str(hdf)
    data1=arcpy.ExtractSubDataset_management(hdf,outPath + hdf[8:16] + ".tif", "1")
print "Done"


texts: Selecting set number of points within polygon grid cells using QGIS?

texts:
I have a polygon grid with 1 square kilometer area cells, and over it a set of points, like so:

What i need to do is select and extract only a single random point per grid cell.

I could do that manually and it wouldn't take too much time as the area i have to cover is not that big, but is there is another way to do this?


texts:
I recently got a virus in my computer and, after having that fixed, was unable to open my Quantum GIS project.  I received an error message:

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\PROGRA~2\Quantum GIS Lisboa\apps\qgis\bin\qgis.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I then clicked "okay" and it kicked me out of qgis.
I uninstalled qgis and reloaded it (version 1.8.0).  When I tried to open my project, I got the same message.  Then I opened qgis desktop and tried to open the project.  I got a message that said Exception - Bad allocation.

I need help.  I have to recover my project.


texts: Counting sides or edges of polygon using open source GIS?

texts:
I wondered if it is possible to determine the number of sides / edges (not vertices) that a polygon has. Imagine the following case. There is a shapefile with 10 polygons.

Is there any way to determine for each polygon, how many sides there are and then write these into the attribute table?

I would be happy for any solution using open source tools.

In addition, I aim to use that in for describing voronoi polyons.


texts: How to open, modify and save a QGIS project with PYQGIS

texts:
I need to create a stand-alone script for opening a QGIS template project, modify a layer data source, export the Composition and finally save the modified .qgs project into a new file.
So far I have only found some examples for QGIS plugins, but of course they don't work for the stand-alone uses. Can anybody give me some helpful hints? Thanks!


texts: Creating polygon shapefile from bounding box in ogr from osgeo?

texts:
I'm trying to create a polygon shapefile from a bounding box in ogr but it creates an empty shapefile. Here's the code:

from osgeo import ogr

infc = r"C:\Temp\infc.shp"
layer_name = 'outfc_bbx'

driver = ogr.GetDriverByName("ESRI Shapefile")
vector = driver.Open(infc)
in_lyr = vector.GetLayer()

driver = ogr.GetDriverByName('ESRI Shapefile') # will select the driver foir our shp-file creation.
shapeData = driver.CreateDataSource(r"C:\Temp") #so there we will store our data
out_lyr = shapeData.CreateLayer(layer_name, in_lyr.GetSpatialRef(), ogr.wkbPolygon) #this will create a corresponding layer for our data with given spatial information.
out_lyr.CreateFields(in_lyr.schema)
out_defn = out_lyr.GetLayerDefn()
out_feat = ogr.Feature(out_defn)

feature = in_lyr.GetFeature(0)
geom = feature.GetGeometryRef()
geom.GetEnvelope()
(minX, maxX, minY, maxY) = geom.GetEnvelope()
ring = ogr.Geometry(ogr.wkbLinearRing)
ring.AddPoint(minX, minY)
ring.AddPoint(maxX, minY)
ring.AddPoint(maxX, maxY)
ring.AddPoint(minX, maxY)
ring.AddPoint(minX, minY)
polygon_env = ogr.Geometry(ogr.wkbPolygon)
#poly = polygon_env.GetGeometryRef(0)
out_feat.SetGeometry(polygon_env)
out_lyr.CreateFeature(out_feat)


texts: How can I properly add PostGIS data into MapGuide Maestro?

texts:
I am having trouble connecting a PostGIS database to MapGuide Maestro. Actually, I have added the PostGIS data into Maestro, but when I click to validate the layer it shows an error message:

Validating resource: Session:9754d026-d86b-11e1-8000-00270e208411_en_7F0000010AFC0AFB0AFA//259f852d-fc68-4475-9de1-a5e446fb6e82.FeatureSource
Warning - OSGeo.MapGuide.ObjectModels.FeatureSource_1_0_0.FeatureSourceType: Spatial context extent appears to be invalid (or is the default extent returned by FDO provider. Meaning it very likely does not truly represent the extent of your data)
Information - OSGeo.MapGuide.ObjectModels.FeatureSource_1_0_0.FeatureSourceType: No primary key defined for class: public:geography_columns, features will not be selectable and feature joins on this class may produce unexpected results

Can anyone please suggest where I went wrong? Is there any documentation for how to add PostGIS data into MapGuide Maestro?

Also, if I click to see the preview of the layer it gives me an error report of Fusion Error.

I am using PostgreSQL 8.4, PostGIS 1.5, MapGuide 2.2 and MapGuide Maestro 4.01

Thanks in advance..


texts: Creating a single layer of polygons from a point layer

texts:
I have a csv file of lats and lons for points that represent the vertices of parcels of land. I want to create a polygon for each set of specific points within the csv and then create one unified layer of polygons.

I first started separating each set of points in the csv file and created individual point shp files and then used the points2one tool to create the polygons. This works but is unwieldy as I have now approximately 170 individual shp files. And I need to merge the newly created polygons back into one layer (seems a lot of unnecessary work).

My question is is it possible to import the entire csv points file into QGIS, manually select sets of points using the selection tool, and then create a polygon from that selection?

My parcels of land are not contiguous so I'm not sure how to create a single layer from the data.


texts: Using Fiona to Convert file geodatabase to PostgreSQL / PostGIS?

texts: Is there a way to use Fiona instead of OGR to convert a GDB over to postgresql / postgis within Python?  If so, how or where can I look?  I cannot seem to find this within the Fiona site or by simply Googling around.


texts: Joining two tables in CartoDB mysteriously returns no rows

texts:
I have two tables in CartoDB, one with locations and one with related data to those locations. They are related through the common columns "placeid" and "relatedid". Both columns are string, (and definitely there are common entries).

Still, the query "Select * from lugares, related where lugares.placeid = related.relatedid" gives no results.
Where are the possible traps? I managed to make them join correctly when using only small excerpts of the data. Can it be an encoding problem?


texts: Migrating ArcGIS for Desktop script to ArcGIS Pro?

texts:
Recently I've been considering switching my department over to ArcGIS Pro in an effort to stay ahead in the ever-advancing world of GIS software.  Currently we run ArcGIS 10.3, and have many daily workflows automated using ArcPy and the Mapping Module specifically.  My question is...  What effect will switching to ArcGIS Pro have on our existing Python tools?  Will it run without any hitches if I try to run something that uses the ArcPy Mapping Module on an ArcGIS Pro map session?  Also, what are any other known considerations when switching to Pro?

This question came up in my mind when I started looking through the ArcPy reference for ArcGIS Pro and noticed that some basic functions that I use almost daily were not present (or at least that I could find) in the documentation.  For example, AddField_management()  is not in there.  Did I miss something?


texts: NDVI Web services over Victoria australia

texts: Does anyone know of any web services that are available where you can pass...say a WKT polygon or point and return the mean NDVI or NDVI from that point from an array of the most recent NDVI runs?


texts:
I am trying to get a measure of border intensity of different regions in Europe.

Having a relevant shapefile of European countries at the regional level (NUTS2) as well several ones by century for a relatively long period, I would like to get the kilometers of borders within each region, historically.

Is there a way to get this measure with ArcGIS Desktop?

First, I uploaded the shapefile of European countries at the regional level (today) as well as the shapefiles by century (transformed from Polygon to Line). But I don't know how to get the kilometers of lines crossing each region nor the number of line crossing the regions.


texts: What is the 'water retention capacity' tool and how is it used?

texts:
In the latest version of QGIS, I found a geoalgorithim in the processing toolbox that will generate 'water retention capacity.'

I am familiar with DEM-based hydrologic modeling tools in QGIS, but I cannot find any information online regarding the formula for water retention capacity. Additionally, a 'plot holes' file is required along with the DEM and I don't know what that is supposed to represent.


texts:
I am new to GeoTools and I have been reading some examples and  some tutorials.

I am currently implementing a Map where I need to have a sprite moving through coordinates. I found an example right [here][1]

[1]: http://svn.osgeo.org/geotools/tags/2.7.1/demo/example/src/main/java/org/geotools/demo/swing/FlyingSaucer.java [] but it's very old and some methods have changed specifically these ones:

public void onRenderingCompleted() {
    super.onRenderingCompleted();
    System.out.println("hi");
    spriteBackground = null;
    animationTimer.start();
}

This method has changed and doesn't allow me to @Override JMapPane method and it also now requires a parameter. I tried to replace it but it didn't work. Here is my replacement:

public void onRenderingCompleted() {
    super.onRenderingCompleted(null);
    spriteBackground = null;
    animationTimer.start();
}

There are other minor changes as well (MapContext is deprecated so I must use MapContent).

Could someone tell me how to replace those methods to make this tutorial work or post a link here with a recent example?


texts: Converting excel integer date format to datetime using QGIS

texts:
How to convert Microsoft Excel date format to datetime format using QGIS?
In example: 43089 in MS Excel is 2017-12-20.


texts: Joining points and polygons by date in Google Earth Engine

texts:
I am using an aerosol index, which I reduced to a daily mean for 2019:

var airq_19 = ee.ImageCollection('COPERNICUS/S5P/NRTI/L3_AER_AI')
  .select('absorbing_aerosol_index')
  .filterDate('2019-01-01', '2019-12-31');

var days = ee.List.sequence(1, 365);

var composites = ee.ImageCollection.fromImages(days.map(function(d) {
  var filtered = airq_19.filter(ee.Filter.calendarRange({
    start: d,
    field: 'day_of_year'
  }));
  return filtered.mean().set('day', d);
}));

I also have point data that is dated:

var events = ee.FeatureCollection('users/salem043/ACLED16to20Iraq');

To obtain the mean values in the aerosol index, I would normally use a spatial join like  this:

var spatialFilter = ee.Filter.intersects({
  leftField: '.geo',
  rightField: '.geo'
});

var joinAll = ee.Join.saveAll('matched').apply(events, airq_19, spatialFilter);

var outcomes = joinAll.map(function(feature){
  var joinedFeat =  ee.List(feature.get('matched'));
  var polygon = ee.Feature(ee.FeatureCollection(joinedFeat).first());
  return ee.Feature(feature.copyProperties(polygon, properties)).select(properties);
});

How do I adjust the functions above such that the joins match on the basis of geography AND date? Script is here

Feb. 9th update: I reformatted my imported feature collection so I could match days based on a number 1-365 for 2019.

var spatialFilter = ee.Filter.and(
  ee.Filter.intersects({
    leftField: '.geo',
    rightField: '.geo'
  }),
  ee.Filter.equals({
    leftField: 'day',
    rightField: 'day'
  })
);

Now the join recommended below produces a new dataframe, but I am missing one more step to produce the mean aerosol index information as a variable (it's saved as a band for each feature in the new feature collection). Updated code is here.


texts: Different variations of point-to-zone mapping

texts:
I have created a grid of 1Km2 over some census zones. Now, for each cell of the grid, I need to provide some characterization of it: population, socio-econ, etc. coming from the census zones.

So, some cells will be completely inside some census zone, some others will cover two or more zones, etc. (see figure).

How can I interpolate the data from the zones to the grid in the best (mathematical) way?


texts: What is the difference between geodetic datums and geodetic control networks?

texts: I have read that the geodetic horizontal datum is a modified ellipsoid in such local area then the control network is established starting from an origin, but in North America the horizontal control network and NAD83 are same, also the vertical control network in North America and NAVD88 are same


texts: ArcGIS 10 Addin Code Doesn't Execute on Another Computer?

texts:
I've created an ArcGIS 10 Addin that consists of a toolbar containing one button and one tool. The button opens a form, and the tool is disabled until the user enters some information on the form.

This addin works great on my development computer and on other computers in my office. But when I deliver the addin to the client, toolbar is there with the button and tool, but when he clicks the button, nothing happens. Not knowing if this had something to do with the form, I added a third button to the toolbar which displays a simple message when the button in clicked. For the client, a click on this button also results in nothing happening. The addin was created using vb.net and Visual Studio 2010.

I've checked that he has the same ArcGIS 10 service pack installed that I have, and that he has the correct .net framework installed. What else could be missing on his computer?


texts: Adding parameters to category in Python Script Tool?

texts:
There is plenty of documentation on how to add parameters to a category in a Python Toolbox i.e. see the bottom of http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameters_in_a_Python_toolbox/001500000028000000/)

But I haven't found a way to do this for a Python Script Tool. Can this be done?


texts: Converting Coordinates formatted as Lat 4531.38153 Long 12347.2328 to Decimal Degrees?

texts:
I've inherited some 20 year old waypoint data that was taken with a Garmin GPS. I don't recognize the lat/lon coordinates as DMS, decimal minutes, or decimal degrees. Here's one record as an example: Lat 4531.38153 Long 12347.2328. I know the very general location of this record to be Lat 45 degrees, Lon -123 degrees.

Can somebody tell me the format of these coordinates so I can convert to decimal degrees?


texts: How big is the error of relative elevation between two points taken from GPS relative to taken from a topographic survey?

texts:
I am sufficiently familiar with the fact that a GPS is not supposed to be used to measure elevation of a point, since it gives the elevations relative to a reference ellipsoid, not relative to MSL of a geoid for example. That’s why you may get readings tens of meters above or below sea level while at the sea.

However I still couldn’t figure out why the GPS is considered to be equally unreliable as a replacer to a topographic survey. Consider the figure below and the following discussion: Curve $\bar{AB}$ is the reference ellipsoid and line $\bar{AB’}$ is an ideal flat region of earth’s surface. A is where the reference ellipsoid intersects earth’s surface. Assume you wish to know relief between A and B’, those two being close together (e.g. $\bar{AB’}$ = 100 meters). In a conventional topographic survey we would determine the orthometric height of point A (by some method) and then use topography to determine the height of point B’ relative to A. We can disregard the difference between orthometric height and geometric height for the purpose of this discussion. In such topographic survey both points would have zero elevation and relief would be zero because the region is flat. Now if we take the GPS reading of B’ we will have $\Delta h$ as the elevation value. Is the reasoning correct so far? Back to the figure we get:

$$\cos 1 = \frac{R}{R + \Delta h}$$ $$\Delta h=R\bigg( \frac{1}{\cos \theta}-1 \bigg)$$ Applying series expansion to $\frac{1}{\cos \theta}$ we have $$\theta = \frac{S}{R}$$ $$\Delta h = \frac{R\theta ^2}{2}$$ $$\Delta h = \frac{S^2}{2R}$$ For $S=100m$ and $R=6370km$ we have: $$\Delta h=0.8mm$$

Hence if a survey was conducted by means of a GPS rather than conventional toopographic methods, the relief between A and B' would be just 0.8mm. An insignificant value, close to the zero obtained with conventional topography. The quality of the GPS would be reasonable. Of course we would then have to also account for the geoid height and make the propper correction.

Now, I know that there are serious precision limitations to map grade GPS units, but if one uses survey grade gps units (with mm precision) what else would be limiting the use of GPS for topographic survey. I'm sure I missed something probably regarding GPS-satellite-precision issues. Can anyone help please? I am sure this would be a useful answer for other users as well.


texts:
I have a polyline and points layer. The points lie on both sides of the polyline at some distance. I want to calculate the minimum distance between all the individual points and the polyline.
I can do it in ArcGIS by converting the polyline into a route and then locating features along that route.

Is there a way to do it in QGIS?


texts:
I am working on creating a class which will merge several georeferenced rasters into one using different strategies, essentially taking average, max, min where the images are overlapping.

So far I've tried using gdalwarp with --resample parameter set to average.

gdalwarp -srcnodata 0 -r average a.tif b.tif output.tif

But gdalwarp just overlaps the images. I've tried other approaches with gdal_merge.py and gdalbuildvrt but they also simply overlap images, without taking average.

Reading gdal dev list I've seen people taking following approach:

reproject images to same dimensions, filling the rest with no data value
filling no-data values with zeroes
using gdal-calc to take max or average on images

I wanted to try this approach but stumbled on a problem of changing dimensions of image with adding no-data value, i. e. the following command changed the whole image, instead of just inserting extra no-data pixels.

gdalwarp -ts 1591 1859 a.tif r1.tif

So my question are:

Is there any other approach on how this averaging could be done?
Is there any utility, preferably with gdal, that could change dimension of the image by adding no-data value pixels to it?

Note: you can find sample files here https://drive.google.com/drive/folders/1cm8Y4WX03wn4XrNKOifYBhd13GqVNGdb?usp=sharing


texts: Replacing text in label expression of ArcMap?

texts:
I'm trying to replace the text in a field to build a label expression. The field I'm using is called [Organizatio] and it holds the school's name. What I want is to tell ArcMap that when that name includes 'Central School District' - change it to "CSD."

This is what I have. ArcMap says it's valid but it does not make any changes.


texts:
I have a contour map which I have applied a symbology to add arrows pointing 'downslope' (defined by the average of adjacent line segment directions) by editing a linetype and adding markers.

I am now looking at editing the spacing of these markers to suit the map I am looking to produce and have run into a problem where I have lots of small/ short contour 'loops' which are being given their own direction arrow - but these are cluttering up the main topography of the site.

I would like to stop the shorter contours displaying as at the scale I am likely to be working these will not be visible (but their symbology arrows unfortunately are). I have added a length field and extracted the contour lengths, and I would like to filter the displayed features by a length.

Is this possible to achieve, ideally without Python/ PYQGIS as access to this is difficult (IT Policies etc.).

I realise I could copy the layer and manually delete the shorter features but I am after a more flexible solution which I could apply to future situations/ dynamically (i.e. if I decide to alter the cutoff value).

Windows 10, QGIS 3.8.2


texts: How to extract raster information by using point shapefile in r?

texts:
I would like to extract values of multiple Geotiff image by using multiple points shapefile and organize the results in a time series.

I have this:

library(raster); library(rgeos); library(rgdal);library(maptools)
shps <- dir(getwd(), "*.shp")
list.shape<-list()
for (shp in shps){ #Import individual point shape files
  list.shape[[shp]]<- readShapeSpatial(shp)
}
tifPs <- dir(getwd(), "*.tif")

P<-matrix(,nrow=length(tifPs), ncol=length(shps)) #To store each pixel value along the time.
list.tifP<-list(); r.vals <-list()
for (tif in tifPs){#Import G`enter code here`eotiff files.
  list.tifP[[tif]]<- rotate(raster(tif))
  r.vals[[tif]]<- extract(list.tifP[[tif]], list.shape)
}

But when I run it, it shows me this error message: Error in round(y) : non-numeric argument to mathematical function

Any idea of how to do this?

EDIT:

Following the advises in the comment box, I attach my files. What I have to do is to extract the pixel information in each raster image (Geotiff files) by using the attached point shapefile and then put all of those time series in an array.

I tried juts to extract the pixel information but the code failed.


texts: Create a web application with ArcGIS Server

texts:
I have a question about ArcGIS server:

I want to make an application for users who can search for proper houses, like a house-finding engine, and I published my map to ArcGIS Server but how can I link my map to the ArcGIS JavaScript API and how can I write queries for my users?

For example: in my web application, I want the user to choose and select from drop boxes like price, region street or rooms?


texts: Is is possible to extract aspect values from raster based on vector point locations?

texts:
Looking for ideas on a workflow in QGIS:

I have an Aspect raster layer and a point vector layer from the same area. Such point data represents localities of interest for a particular study. Is there any way I can obtain the exact Aspect value at each of those points? I know I could always use the Information tool and click on each point to get that information, but that would imply a lot of manual work and it would be error-prone.

I was looking for a more authomated (and elegant) way of doing it - either using a single tool or a sequence of tools/commands. Can anyone help me with this?


texts: I created a multi-point shapefile and added number text to show as labels around the centroid of each point. Is is possible to rasterize the points and labels? I was thinking I could create a PDF and then georeference it back into QGIS?


texts:
Plugin GDAL didn't work on my qgis 2.18.17. I'm working on linux mint 19

Installed version : Version 3.1.9 (dans /usr/lib/qgis/plugins/libgeorefplugin.so)
How i can change the version of GDAL?


texts: ArcMap 10.8 crashes after using tools from Toolbox

texts:
Total beginner here.
Everytime I use any tool from Toolbox (Merge, Clip, Buffer etc.) ArcMap happens to crash. I work with version 10.8.
As you might guess from my name, my language uses diacritics - I made sure that the all of the folders chosen during the installation process didn't include any in their names, however, I ended up with this destination for my .mxt template...
Could that be the source of the problem?


texts: How can you publish a CSV as feature layer when creating a feature class in ArcGIS online?

texts: According to ESRI's instructions, one is supposed to place a check mark next to a box which states "publish this file as a feature layer."However, this check box does not appear anywhere in the "Item from my computer" box when one initially brings the file into ArcGIS online. How would I locate this check box? Is this ESRI's error or am I overlooking something?


texts: Maintaining list of GIS applications in mobile ecosystem as Github page?

texts:
I recently, read the post Choosing Mobile GIS applications for Android Tablets?

I have seen a Github repository page https://github.com/vhf/free-programming-books used for a similar purpose.

Is there a Github repository page for maintaining a list of GIS in mobile ecosystem (i.e., Android, iOS, Windows Phone, etc.)?


texts: ArcGIS Data Interoperability exports track as flat line?

texts:
I have a mif file that contains a field track full of vertexes. Said file is read and reprojected used EsriReprojector from ETRS89 to WGS84. A simple geometryfilter is appended to redirect resulting data to a file database.

However, when i run the ETL tool, the resulting geometry is a flat line.

It seems the problem is generated by the reprojector. I've tried others, like CSMapReprojector and standard FME Reprojector but none of them work


texts: How to generate all possible routes between two points?

texts:
I have a network dataset in ArcGIS and I need to generate all possible (not only the shortest one) routes between two given points (A, B).

Is it possible to do it with the Network Analyst?

Or with any other software? e.g. pgrouting?


texts: How to serve a GeoJSON file through WMS with MapServer?

texts:
Could you please provide a working example of WMS mapfile with GeoJSON layer for the MapServer?
Mine is not working:
MAP
  EXTENT -120 34 -119 35 # Geographic
  SIZE 800 400

 LAYER
  TYPE polygon
  NAME "cells"
  METADATA
    OWS_TITLE "MetGeoJSON Polygon"
  END
  CONNECTIONTYPE OGR
  CONNECTION "shp/geoJson.json"
  DATA "OGRGeoJSON"
  STATUS default
  PROJECTION
    "init=epsg:4326"
  END
END
END

The error message is:
msDrawMap(): Image handling error. Failed to draw layer named 'cells'. msOGRFileOpen(): OGR error. GetLayer(OGRGeoJSON) failed for OGR connection. Check logs.


texts: Createing polygon layer from point data using QGIS?

texts:
I'm currently using QGIS 1.8.0

I would like to create a polygon layer from a point dataset, where the size of the polygons relates to the resolution of the grid reference.

The ultimate aim would be mapping species density - I have a numerous spreadsheets of species presence at certain locations but with differing resolutions (2km, 1km and 100m). So, I would like polygons of each grid square, so that the number of different species recorded within that square can be counted. I believe this is a similar method to how the NBN Gateway maps using their new interactive map http://www.nbn.org.uk/


texts: Unable to add MrSID extension to GeoServer

texts:
I'm trying to serve some MrSID files with GeoServer following the geoserver.org guide, however, I can't get the MrSID Raster Data Source to show up when attempting to add a new GeoServer Store.

This is what I did from the guide to get started:

Download and Install all OpenGeo 4.8 Components
Stop the Geoserver
Download geoserver-2.8.3-gdal-plugin.zip[1] and extract contents to E:\OpenGeo\jetty\webapps\geoserver\WEB-INF\lib
Download gdal_data.zip[2] and extract contents to E:\GDAL\data
Add System Environment Variable | Variable: GDAL_DATA, Value: E:\GDAL\data
Download gdal-1.9.2-MSVC2010.zip[3] and extract contents to E:\GDAL\bin
Add ;E:\GDAL\bin to the end of my PATH variable
Open command prompt at E:\GDAL\bin and run 'gdalinfo --formats' a list of formats was displayed
cd to E:\GDAL\bin\javainfo and run 'gdalinfo.bat --formats' a list of formats was displayed
Download gdal-19-1600-mrsid.msi[3] Install to C:\Program Files (x86)\GDAL
Add System Environment Variable | Variable: GDAL_DRIVER_PATH, Value: C:\Program Files (x86)\GDAL\gdalplugins
Start GeoServer and check to see if the MrSID option is available (it is not.)

I also found the following in my log file at E:\OpenGeo\jetty\logs\2016_05_13.stderrout.log

May 13, 2016 3:08:18 PM it.geosolutions.imageio.gdalframework.GDALUtilities loadGDAL
WARNING: Failed to load the GDAL native libs. This is not a problem unless you need to use the GDAL plugins: they won't be enabled.
java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path

Download Links:

http://geoserver.org/release/maintain/
http://demo.geo-solutions.it/share/github/imageio-ext/releases/1.1.X/1.1.13/native/gdal/
http://demo.geo-solutions.it/share/github/imageio-ext/releases/1.1.X/1.1.13/native/gdal/windows/MSVC2010/

Can you help getting GeoServer to serve MrSID files?


texts:
using the pyshp library (https://code.google.com/p/pyshp/) I am trying to create a "complex" polgon with one hole inside the main-poly plus one island-poly. It should look like this:

I used the following code from the documentation, only changing the number of points and using anticlockwise rotation for the hole:

import shapefile
w = shapefile.Writer(shapefile.POLYGON)
w.poly(parts=[[[0,50],[50,50],[50,0],[0,0],[0,50],[10,40],[10,10],[30,10],[30,40],[10,40],[70,20],[100,20],[100,0],[70,0],[70,20]]])
w.field('FIRST_FLD','C','40')
w.field('SECOND_FLD','C','40')
w.record('Poly','PolyTest')
w.save('TESTPOLY')

I get this:


texts:
Recently was doing some work on an old layer and found that when I selected one point, or used the identify tool I was returning SEVEN points when it should just be one!
I am currently using an ArcGIS 10.1 and have access to both Editor and Info licenses.

Is there an easy way to delete these duplicates via python, or another tool? The ObjectIDs are different but the values contained in other fields are the same. Therefore I think looking at intersecting geometry would be the best option
There is probably easily over 2000 points with duplicates.

Thanks.


texts: QGIS 2.8 Ubuntu 14.04 installation issues. Terminal command attempts to install 2.10 regardless of repository

texts:
I have switched to a new computer, and need to re-install QGIS 2.8. I imagine some database changes have happened since I last installed it, because now, even though I direct installation to the http://qgis.org/debian-ltr (2.8) repository, it still assumes that sudo apt-get install qgis is meant for 2.10. The 2.10 repository is http://qgis.org/debian. I have installed 2.8 many times before with this same method, so I'm pretty baffled as to what's going on.

Proof of my repository:

I run sudo apt-get install qgis python-qgis and get this error:

The following packages have unmet dependencies:
 python-qgis : Depends: python-qgis-common (= 1:2.8.3+20trusty) but 1:2.10.1+20trusty is to be installed
 qgis : Depends: qgis-providers (= 1:2.8.3+20trusty) but 1:2.10.1+20trusty is to be installed
 Depends: qgis-common (= 1:2.8.3+20trusty) but 1:2.10.1+20trusty is to be installed

I have the 2.8 repository set, but for some reason the install qgis command looks for the 2.10 repository instead. When I set the repository to http://qgis.org/debian, it goes ahead and installs 2.10. What is going on here?


texts:
I want to read a shapefile using pyshp:

sf = shapefile.Reader(('/tmp/India_PCs_Boundary_4_2_19/India_PCs_Boundary.shp'))

but when I look at the result, the polygons look all squishy and distorted; they're supposed to exactly cover India, but they don't.

One theory for what might have happened is that I did not read the .prj file correctly, and the .prj file contained some sort of projection data that would un-distort the polygons.

When I read the pyshp documentation, it says:

  You specify the base filename of the shapefile or the complete filename
  of any of the shapefile component files....
  OR any of the other 5+ formats which are potentially part of a shapefile. The
  library does not care about file extensions.

But it does not mention .prj specifically.

Does pyshp, by default, read .prj files correctly?  If not, is there a way to get it to do so?


texts: Displaying a raster layer (Sentinel-2) MapServer/WMS

texts:
I have a lot of raster data Sentinel-2, I need to display them on the map with MapServer/WMS.

when I saved the data as images through the QGIS, they were displayed correctly, because as much data I can not save all the files. You need to automate this.

There is a commands of GDAL that saves raster data as an image?

Or is it possible to configure the server so that it correctly displays such data?

now the data is displayed like this

In my map file

    LAYER
    NAME ndci2
    TYPE RASTER
    DUMP true
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    DATA '/var/www/html/novndci.tif'
    METADATA
      wms_title 'test'
      wms_abstract 'test'
      "wms_server_version" "1.1.1"
      "wms_srs" "EPSG:4326"
   END
  STATUS ON
    PROCESSING "RESAMPLE=BILINEAR"
    PROCESSING "NODATA=0"
        PROCESSING "SCALE=0,255"
    TRANSPARENCY 100
    OPACITY 100
   END

update: add gdal info

    Size is 3836, 4638
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (571370.000000000000000,6067940.000000000000000)
Pixel Size = (10.000000000000000,-10.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  571370.000, 6067940.000) (Invalid angle,Invalid angle)
Lower Left  (  571370.000, 6021560.000) (Invalid angle,Invalid angle)
Upper Right (  609730.000, 6067940.000) (Invalid angle,Invalid angle)
Lower Right (  609730.000, 6021560.000) (Invalid angle,Invalid angle)
Center      (  590550.000, 6044750.000) (Invalid angle,Invalid angle)
Band 1 Block=3836x1 Type=UInt16, ColorInterp=Gray
  Min=240.000 Max=7668.000
  Minimum=240.000, Maximum=7668.000, Mean=635.443, StdDev=321.799
  NoData Value=0
  Metadata:
    STATISTICS_MAXIMUM=7668
    STATISTICS_MEAN=635.442720376
    STATISTICS_MINIMUM=240
    STATISTICS_STDDEV=321.79868425468

Update#2 add example data

Example data


texts: How to load DEMs from custom source in Maperitive?

texts:
Maperitive has the ability to handle DEM files. I have read that it can handle .hgt files (which is what I have), but how can I load them?

Using set-dem-source complains about some missing xml. Does anyone know what the application expects from me?

The official documentation (http://maperitive.net/docs/Commands/SetDemSource.html) says TODO on the topic of custom dems.

In this forum entry https://forum.openstreetmap.org/viewtopic.php?id=15802 the set-dem-provider command is mentioned, however my version of Maperitive does not have this command.


texts: Making combobox with list of fields (from layer also selected in combobox) in pyQGIS?

texts:
I am new to python and pyqqis.

I do not have the methods defined in initGUI

how do I do?

layers = self.iface.legendInterface().layers()
layer_list = []
for layer in layers:
    layer_list.append(layer.name())
self.dlg.comboBox.addItems(layer_list)

selectedLayerIndex = self.dlg.comboBox.currentIndex()
selectedLayer = layers[selectedLayerIndex]
fields = selectedLayer.pendingFields()
fieldnames = [field.name() for field in fields]
self.dlg.comboBox_2.addItems(fieldnames)

The problem is, that in second combobox there are fields from first on layerlist layer, not the selected one.


texts: ArcGIS Server Map Service - Best Way To Visualize Coincident (Identical) Point Features

texts:
I have an ESRI Map Service serving out several point layers with 10k+ point features.  Because of these high feature counts, I use a dynamic map service where a symbolized image is generated on the server, and then rendered in the map clients (in this case, javascript map).  Using Feature layers is not feasible - as the feature counts 'pop' the browser.

Within these point layers, there can be a single location (coordinate) with many features.  For example, in one layer, 36 features share the same coordinate.  So, in the map, I only see 1 'dot' at this location.  But these 36 features have different attribute properties that control symbolization.  For example, lets say 16 features have status of 'on' (green) and 16 feature have status of 'off' (red).  Right now, you only see the color of the last rendered feature.

Is there some type of magic trick I could use to explode these features out from the common origin?


texts: Post approval for crowdsourced editing of features in ArcGIS Online?

texts:
I'm currently working on a project that involves crowdsourced data collection using ArcGIS Online (Organization version). The only problem I have with ArcGIS Online editing is that when you make a map public, I can't seem to find a way to "safeguard" the edits - any point someone adds to the map (Malicious or good) is there unless I go and manually remove it. Because it is crowd sourced, the general public will most likely not want to install a special app or really do any other work than clicking a link and adding data.

Is there a way to enable post approval? If not, is there a way to sort the points in the attribute table by date created, and then I could check weekly to see what points are added, and remove any bad ones that occurred through the week? I also have ArcGIS 10.2 with advanced license if that matters at all.


texts: QGIS Atlas Composer : Margin around feature not changing

texts:
I try to use an expression to set the margin around a feature in the atlas composer.

In documentation, it's explained that it's better to be a double but a string or integer is accepted as an input.

I use this expression that returns a double:

bounds_height( $geometry )/ bounds_height(  geometry( get_feature( 'allin1', 'id_ws_int', attribute(  @atlas_feature  ,  'id_ws_int' )  ))) *100+100

But nothing changes. Tried with to_string and to_int but same result.

Tested in 2.14.12 and 2.18.4

No bug reported found.


texts:
I am developing an app using OpenTripPlanner.

It creates an OpenLayers map in map.js. I want to access this map in index.html so I can set it's center.

Kindly help me out.


texts: How to remove comma from combined fields which should be null?

texts:
I have Drivers License as one field and State as the other and there are to be combined and formatted as Drivers License, State.  How do I handle records that do not have either a Drivers License or State so that the field does not have a comma populated in it

Example:

  Record One: XXXXXX, ST

  Record Two: ,

  Record Three: XXXXX, ST

  Record Four: ,


texts:
I use the the atlas in QGIS for a while, and I use a variable from the atlas to filter labels, construct geometries, etc. But the atlas variables aren't everywhere in QGIS and I can't make a real filter on a table.
My purpose is to make an atlas with barchart : the atlas coverage filter a layer used for a barchart make with dataplotly. The barchart is included in the atlas by its html. The dataplotly extension seems to have an automatic refresh.

I don't think my explanation is clear.


texts: Geodatabase network dataset error "cannot acquire a lock"

texts: I am trying to create a new network dataset within a feature dataset in a file geodatabase and keep getting the error "could not create network dataset. Cannot acquire a lock. Cannot acquire a lock." Has anyone come across this issue?


texts: Extracting attributes from one layer into another layer's different features using ArcGIS Desktop?

texts:
I am trying to work out how to do something in ArcGIS Desktop 10.6 and just can't find a way. I have a land use map of an area as seen in the first picture. I have this layer in both polygon and raster layers, see layer below. There are 10 classes of land use each has a different colour

I then have a subgrid of around 27,000 squares that I created in fishnet tool, this grid of the area is split into 500m2 squares. as seen below-

I would like to know and create a layer showing- in each of these small squares what is the % of land cover from the land cover layer in each small square?

I would then like to extract the values from each square to a point in the centre. So for example, in one square how much of each land cover type is there in the square.

I would then like to create a layer that tells me, for each square, what is the dominant land cover in that square, so for example if there is 20% grassland and80% forest in that square, it would assign the gridcode of forest to that layer

So I will hopefully end up with a layer of 27,000 rows, each row will have a value for each of the 10 landclass types and then another layer where I have 27,000 rows with one dominant value/land cover assigned


texts: How to select multiple Features from multiple Layers in OpenLayers?

texts:
Is there a way to select multiple features from multiple vector layers by using clickTolerance in click?
I checked the documents of getFeature control and selectFeature control, seems not work in this way.

I know that it is possible to select multiple features by holding down Shift key. That's OK  in a desktop environment, but it's not desirable in mobile/tablets. So I'm looking for a different solution.


texts: QGIS AutoSave Plugins File not Recovering

texts: I have installed the QGIS 3 AutoSave Plugin. It is saving .bak and .bak~ files but when I am trying to recover them by deleting the .bak part from the name, it is just opening the QGIS and not opening the exact project.


texts: Converting 12-hour time to 24-hour time using Field Calculator

texts:
Does anyone know how to convert string time formats in ArcMap v10.2 from 12-hour to 24-hour using a simple query in the Field Calculator? i.e. NO Python, NO editing in Excel, NO changing my Windows PC settings, etc...

This is a successful calculation I used (which I found on a discontinued forum) to convert my dates from MM/DD/YYYY to YYYY/MM/DD:

year([DateFld]) & "/" & Month([DateFld]) & "/" & Day([DateFld])

Perhaps there is some sort of modification that I could make to the above calculation that would change my times to 24-hour?  I've searched for an answer everywhere and played around with it without any luck, but I would like for the times to be in h:mm:ss format.

Forgot to mention that this is a regular shapefile, not part of a GDB.


texts: Export to PDF every parcel in layer, maybe with bookmarks?

texts:
How to create bookmarks in ArcMap, for example I have a shapefile with parcels (300 parcels) and I want to export to PDF every parcel in a page.

Can I do this with bookmarks or if not how?


texts: How do I load geopackage (https://www.geopackage.org/) in Matlab. I am trying to replace the shapefiles with geopackage due to several limitations inherent in shapefile.


texts:
I originally asked this on Stack Overflow, but here was suggested as a better location.

Where could I get a shapefile (or even better an R spatial polygon data frame) of the boundary of England, where London is a boundary and the London area is not part of the shape (essentially a really really weird doughnut...see below) or is there a way to create it myself (using GIS excluded!)?


texts: How to query overpass turbo using > and < operators?

texts:
I want to use overpass turbo to query data within a certain range of numerical attribute values. For example, I want to find power=line elements with voltage in a range between 100kV and 200kV.

I would have expected that a query like this

way
  [power=line]
  [voltage>100000]
  [voltage<200000]
  ({{bbox}});
(._;>;);
out;

would yield such results. But in this case I receive the error message,

  parse error: '!', '~', '=', '!=', or ']' expected - '<' found.

so I presume that > and < operators are not allowed here. Is there any way around this?


texts: Trajectory similarity: calculate distance between two trajectories

texts:
I have two sets of coordinates.
And I'd like to calculate the distance between two trajectories by Python.
Especially, I'd like to get the point which is the most distant.

How can I calculate ? Or are there any libraries or tools something like that to calculate easily ?


texts: Edit script of Python Script Tool using IDLE from ArcGIS Desktop opening three Python Shell windows?

texts:
IDLE does not open properly in my ArcGIS Desktop 10.6 (Win 10 64 bit). I set the Geoprocessing Editor with following

C:\Python27\ArcGIS10.6\Lib\idlelib\idle.pyw

When I right-click a script tool in ArcCatalog and then select Edit, 3 instances of IDLE open and none of them have opened the file.

I think it is a path problem. The path is on a Windows network drive:

K:\Me K\Program Resources\ArcGIS\Arcgis10.1

and the 3 instances are

K:\Me
K:\Me K\Program
K:\Me K\Program Resources\ArcGIS\Arcgis10.1\K

My guess is the idle.pyw script split the path at spaces, got 3 members and ran an accumulation of each in succession, creating 3 IDLE windows of different parts of the path. But why would it even do that?

Even then, there is the strange wrap around with the \K.

Either way, it does not work as required. Does anyone have any ideas?

Update: I followed advice to uninstall 10.6 and python and then reinstall. It still opens 3 IDLE windows, but now the file paths have a new component:

K:\Me
C:\windows\System32\K\Program
C:\windows\System32\Resources\ArcGIS\Arcgis10.1\file.py

Trying with Notepad++ as Editor and the same errors persist:

"K:\Me" does not exist
"C:\windows\System32\K\Program" does not exist
"C:\windows\System32\Resources\ArcGIS\Arcgis10.1\file.py" cannot be opened

It is not Python but ArcGIS 10.6.1 sending the erroneous path strings.

This is normal script making in ArcCatalog I have done for years in 9.x and earlier 10.x.

!https://drive.google.com/open?id=1F6pBaMgKq0s9s-V3o7-YJ_LfXISyonmf


texts: How can I get a shapefile from a postgis query?

texts: My data is in a PostGIS database. I would like to generate a shapefile from a query. How can I do that?


texts:
I'm having trouble getting sqlite dialect to work with ogrinfo/ogr2ogr in Python.

I'm able to use ogr2ogr/ogrinfo functions in Python by using the Python ports found here -

http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples.

I import that script into my script and pass parameters via sys.argv = [].

But when I try to use sqlite statements I get errors.

sys.argv = ['','myshape_shp','-dialect', 'sqlite', '-sql', "select sqlite_version()"]

Returns "ERROR 6: The SQLite driver needs to be compiled to support the SQLite SQL dialect"

My hunch is that since I'm using this python port, it doesn't have sqlite functionality bundled in with it?

This does work if I run the same command through the OSGeo Shell.


texts: Missing toolbar and panel from graphical modeler in QGIS

texts: Does anyone know how I can turn on the toolbars and panels of the QGIS 3 graphic modeler? I closed them and now I do not know how to enable them again, consequently only a blank window appears. I'm using Lubuntu 18.04 as operative system


texts: Error in orthorectification of Radarsat-2 scenes with GDAL and RPC + DEM information

texts:
I am trying to use a DEM rational polynomial coefficient (RPC) information to orthorectify radarsat-2 images with GDAL 2.2.1.  I have successfully done this with Orbview-3 images using the tutorial here and running

gdalwarp  -overwrite -s_srs EPSG:4326 -t_srs EPSG:4326 -rpc -to RPC_DEM=dem.tif 3v070302p0001614811a520000100132m_001590624.tif out.tif

However, when I run this command using sample imagery for radarsat 2 (Vancouver_RS2_Fine2_HH_HV_SGF or Vancouver_RS2_FineQuad2_HH_HV_VH_VV_SLC), I get the following error:

ERROR 1: Unable to compute a RPC based transformation between pixel/line and georeferenced coordinates for imagery_HH.tif

Does anyone have experience with this error?

I don't know if it is relevant, but when I call gdalinfo on the orbview image, I get RPC metadata, but I do not get the rpc metadata when I call gdal on the radarsat-2 image (although I do get a long list of ground control points)


texts: How to export underlying vector layers from web map to QGIS?

texts:
The following map is using Leaflet https://www.openreach.com/fibre-broadband/fibre-first
People need to use these layers in their QGIS. Is there a way to maybe load the layers from the same source when it updates, perhaps as a GeoJSON?


texts: Converting Coverage files into shapefiles?

texts:
I am attempting to convert coverage files into shapefiles using arcpy.  This is not the e00 files, but the bin files.   ArcGIS help suggests that it can be done using FeatureClassToFeatureClass_conversion, but I am getting an error saying "parcels does not exist or not supported".

fileName = 'C:\\May_2014_Parcels' + "\\" + filename + "\\" + subfilename + "\\parcels"
                   arcpy.FeatureClassToFeatureClass_conversion(fileName,

r'C:\May_2014_Parcels\Output\parcels.gdb', filename + "_" + subfilename)

How do I actually get the featureclass out of the coverage file so I can perform this task?


texts: A way to identify which ui.Map() instance a widget is located in Earth Engine

texts:
Is there a way to identify which ui.Map() instance a widget is located in when using multiple maps in Earth Engine?

For example, I have 2 maps, each having a textbox and a button. When a button is clicked, I want to print contents of a textbox from the same map with printAdjacentTextBoxValue() callback function. I deliberately use the same function for both buttons in order to use the same logic for multiple maps depending on their context.

This is an example code:

var left_map = ui.Map();
var right_map = ui.Map();

var left_textBox = ui.Textbox({value: 'left one'});
var right_textBox = ui.Textbox({value: 'right one'});

var left_button = ui.Button('click', printAdjacentTextBoxValue);
var right_button = ui.Button('click', printAdjacentTextBoxValue);

// universal function to provide same logic for both maps,
// yeilding potentially different results based on a different state of elements
function printAdjacentTextBoxValue() {
  var value;
  // get value from a textBox from the same Map
  print(vlaue);
}

ui.root.clear();

ui.root.add(left_map);
ui.root.add(right_map);

left_map.add(left_textBox);
right_map.add(right_textBox);

left_map.add(left_button);
right_map.add(right_button);

EE script version


texts: Geometric Network Downstream River Tracing?

texts:
I'm using ArcGIS 10.2 Desktop and I need to trace downstream on a river network from a Discharge point to another point where the river intersects polygons of interest. The distance from each discharge point to the nearest point of intersection (with the polygon of interest) is an important element that I need to know.

I am using a geometric network and my question is how do I go about doing this process? I've looked at flags and barriers but distance doesn't seem to be included when looking at geometric networks as opposed to Network Datasets such as roads etc. I'm not sure how to mark the first point of interaction a river has with the area of interest. I've been able to dissolve my geometric layer so that I'm left with just the sections of river concerned with each discharge point.

I need to be able to say that from Discharge Point A, here is a list (say 5km's downstream of it) of all the receptors (my areas of interest which are either lines or polygons) it interacts with.


texts: Load Multiple WFS layers from array with OpenLayers

texts:
I have a layer on my Geoserver that contains a few dozen pipeline alignments in a single layer.  My goal is to get those into the map frame as individual layers by iteratively calling WFS layers and applying a CQL filter to only return the specified pipeline based on a 'name' attribute.  My reason for doing this is that I only want to maintain one master dataset, but I need to be able to display and toggle visibility of each pipeline individually in the legend box.

Conceptually, I was thinking the following would work:

Put the names of each pipe I want in an array
Loop through the array and construct a WFS GetFeature call for each name, using the name as the CQL filter to return only that pipe segment

However, while the loop appears to succesfully populate the legend box with the names I'm looking for, I only have one pipe geometry being returned.  It is always the last pipe specified in the array and can't figure out why.

Also, the code below shows that I'm putting the layers into a layer group and then adding the layer group to the map.  I've tried this other ways as well, including omitting the layer group and simply adding each layer to the map (e.g. map.addLayer(layer)), but can't get anything to work; always just displays the last pipe in the array.

Code below:

//array to hold requested pipelines
var MammCreekLines = ['Hunter CS to Pumba CS','South Grass Mesa','Shideler 12in'];

//loop to construct WFS GetFeature for each layer
for (var i=0; i<MammCreekLines.length; i++) {

var selectStatement = "CQL_FILTER=name='"+MammCreekLines[i]+"'"
console.log(selectStatement);

MammPipeSource[i] = new ol.source.ServerVector({
    format: new ol.format.WFS({
        featureNS: 'http://www.elev8-ims.com/summit_sw',
        featureType: 'summit_pipes'
    }),
    loader: function(extent, resolution, projection) {
        var url = 'http://elev8-ims.com/geoserver/summit_sw/wfs?'+
            'service=WFS&request=GetFeature&'+
            'version=1.1.0&typename=summit_sw:summit_pipes&'+
            'srsname=EPSG:3857&'+
            //encodeURI("CQL_FILTER=name='"+MammCreekLines[i]+"'");
            encodeURI(selectStatement);

        $.ajax({
            url: url
        })

        .done(function(response) {
            MammPipeSource[i].addFeatures(MammPipeSource[i].readFeatures(response));
        });
    },
    strategy: ol.loadingstrategy.createTile(new ol.tilegrid.XYZ({
        maxZoom: 19
    })),
    projection: 'EPSG:3857'
});

MammPipe[i] = new ol.layer.Vector({
  source: MammPipeSource[i],
  name: MammCreekLines[i],
  style: [thickStyle, thinStyle]
});

MammCreekArray.push(MammPipe[i]);
}

//add layer from the array to the legend group
  var MammCreekGroup = new ol.layer.Group({
  layers: MammCreekArray,
  name: 'Mamm Creek Pipelines'
});


texts: How to selectively generate averaged raster layer from 5-year data raster layers in QGIS?

texts:
I would like to merge 5 years of world ocean surface productivity data raster into 1 averaged raster in QGIS.
However, not every pixel has data in every year.
To generate the raster layer with the averaged data, should I use Raster Calculator? And produce the average raster using:

(raster1+raster2+raster3+raster4+raster5)/5

But how can I omit those pixels with no data for the calculation of the average?

Is there a way to detect the nodata pixel such that it will just divided by the number of layers that have data in that pixel?
For example if raster3 doesn't have the data, it will automatically become

  (raster1+raster2+raster4+raster5)/4

for the calculation in that grid?


texts: Changing Format of Date Field in ArcMap Field Calculator?

texts:
I am trying to change the format of date field using ArcMap field calculator.

My data is currently in the format "%d/%m/%Y %h:%m:%s" (e.g. 5/05/2016 12:25:46 AM)

I want to change this to "%d/%m/%Y" (e.g. 5/05/2016). No time data.

I have been trying to use the following, but this does not work.

datetime.strptime( !DateField!, "%d/%m/%Y)

I have looked at several similar questions posted, but none seem to do this?

Python or VBScript is ok, using ArcGIS 10.3


texts: OpenLayers map displays on Desktop but will not display on Mobile?

texts:
I have the code shown below that works perfectly on a desktop, but will only display the OSM layer on a mobile device.

Am I missing something obvious?

My understanding is that it should work on both with no adjustments.

Devices tested include IPhone, IPad and Android, with a couple of different browsers.

I am working with OpenLayers Version 3.0.0 (release version)

I know the buffer and isBaseLayer parameters may be unnecessary, trying to figure that out now in the documentation.

I figured out it was a tile size issue. I am using GeowebCache which expects a tile size of 256, but it is returning the following error ONLY when used on a mobile device

400: The requested tile dimensions 384x384 do not match those of the grid set (256x256)

I found this code in an obscure email thread, but it appears map.tileOrigin is undefined:

          tileGrid: new ol.tilegrid.TileGrid
                ({
                origin: [map.tileOrigin[0], map.tileOrigin[1]],
                resolutions: map.resolutions,
                tileSize: 256,
                }),

    // Base Map
      Mware_Layer_OSM = new ol.layer.Tile({
            title: 'OpenStreetMap',
            isBaseLayer: true,
            preload: Infinity,
            buffer: buffer,
            source: new ol.source.OSM()
      })

    // Layer Group
      Mware_Layer_PCodes = new ol.layer.Tile({
        title: 'PostCodes',
        preload: Infinity,
        buffer: buffer,
        source: new ol.source.TileWMS( ({
          urls: urls,
          params: {'LAYERS': Required_Layer, SRS:'EPSG:3857', 'TILED': true, format: 'image/' + Image_Format},
          serverType: 'geoserver',
          visible: true
        }))
      });

    // View
    view = new ol.View({
        center: transform(startLon, startLat),
        zoom: Initial_Zoom
    });

    // Create the Map
    map = new ol.Map({
        target: target_div,
        layers: [Mware_Layer_OSM, Mware_Layer_PCodes],
        renderer: 'canvas',
        view: view,
        controls: ol.control.defaults({
            attributionOptions: {
            collapsible: false
          }
        }),

    });


texts:
I have a script that clips 20 feature classes and delete the "clip in file" (fcin). My problem is that the script fails on 3 of the feature classes with error "May be locked by another application" when trying to delete the fcin. I have tried to use testschemalock to only delete if the script  can get schema lock but no diffrent. Now I tried to disconnect all users and new workspace. Then I got an error that the fcin does not exist. Now I have no clue to what to do. I made a last try to put a while loop on the new workspace after disconnect all user but then it got stuck in the  loop (arcpy.Exists) because it cant find the file (the file exist). It is only on the same feature classes on which it fails. When I check connections there is no one connected to the SQL database.

I tried to find out if there was anything wrong with the feature classes but no result. If I run the original script I have to close Python before deleting the feature class manually.

I think it was when we updated to 10.5.1 that the script started to fail.

I just tried to hardcode with a feature class that fails and it still fails. Somehow it must be the feature classes but I have no clue why.. After the script tries to delete the clip in file and fails it moves the clip in file to the root of the database. If i just use the delete.management and skip to clip the file before it works. So its possible to delete the file with ArcPy but it fails if I clip the file before.

connection = 'connectionfile.sde'

arcpy.env.workspace = connection
arcpy.env.workspace = connection + '\\' + 'map_zone2'

arcpy.Clip_analysis('clip_in_file', 'clip_file_zone2', 'clip_out_file_zone2')
arcpy.Delete_management('clip_in_file')

ERROR 000601: Cannot delete clip_in_file.  May be locked by another application.
Layer in use [clip_in_file]
Failed to execute (Delete).
Failed at Fri Oct 18 08:20:32 2019 (Elapsed Time: 0,65 seconds)

Code with while loop

arcpy.Clip_analysis('clip_in_file', 'clip_file_zone2', 'clip_out_file_zone2')

print 'Disconnect all user'
arcpy.DisconnectUser(connectionsde, 'ALL')
arcpy.ClearWorkspaceCache_management()
print 'New connect'
arcpy.env.workspace = connection
arcpy.env.workspace = connection + '\\' + 'map_zone2'

while not arcpy.Exists(clip_in_file):
    print 'New connect 2'
    arcpy.ClearWorkspaceCache_management()
    arcpy.env.workspace = connection
    arcpy.env.workspace = connection + '\\' + 'map_zone2'
    time.sleep(5)

print 'Delete clip in file'
arcpy.Delete_management('clip_in_file')


texts: No GetFeatureInfo response when clicking on a map in OpenLayers 2

texts:
I have the code below, however no response when clicking on the map.

<!DOCTYPE html>

 <meta charset='utf-8' />
 <title>My OpenLayers Map</title>

It is based on this tutorial, How to do it?

Create an HTML file with the OpenLayers library dependencies and add the code for the button and the map's div element:

<button dojoType="dijit.form.ToggleButton" id="featureInfoButton"
onChange="featureInfoChange" iconClass='dijitCheckBoxIcon'
checked="false">Activated</button>

Set the proxy script, and initialize the map instance:

OpenLayers.ProxyHost = "./utils/proxy.php?url=";
// Create map
var map = new OpenLayers.Map("ch05_wmsfeatureinfo");

Adding Controls
176

Now, add two WMS layers. The first will act as the base layer while the second will be
an overlay layer with the USA states:

var wms = new OpenLayers.Layer.WMS("Basic", "http://demo.
opengeo.org/geoserver/wms",
{
layers: 'topp:naturalearth'
});
map.addLayer(wms);
var wms2 = new OpenLayers.Layer.WMS("Basic", "http://demo.
opengeo.org/geoserver/wms",
{
layers: 'topp:states',
transparent: true
},{
isBaseLayer: false
});
map.addLayer(wms2);

Add the layer switcher control and center the map's viewport:

map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-90, 40), 4);

Then add the code for the WMSGetFeatureInfo control:

var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://demo.opengeo.org/geoserver/wms',
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
"getfeatureinfo": function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"chicken",
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true
));
}
}
});
map.addControl(featureInfo);

The same issue also applies to the code provided earlier, Uncaught Reference Error: init is not defined

Here is my current map created using Openlayer2


texts:
I have made some edits to a cyclepath in ArcGIS. The problem is the order of digitizing of the new vertices is changed and doesn't follows the correct direction, preventing to use it as a GPS track.

Is there a tool for reordering them? It's indifferent if in one direction or the other.


texts: Why can't we launch QGIS.exe? Why we have to use QGIS.bat?

texts:
QGIS.bat - it is calling some other batch files (all of them also setting up path variable and some more variables), sets some more variables and setting up PATH.  I have done that in system properties. Still I am not able to directly launch the QGIS.exe

If I run through QGIS.bat then it is launching fine.


texts: Remove lines from inside a polygon (shapefile) in r

texts:
I have this code which prints the Galápagos Islands. But inside the islands, there are lines that I want to get rid off. How is this possible in R?

library(rgdal)
library(ggplot2)

URL <- "https://osm2.cartodb.com/api/v2/sql?filename=public.galapagos_islands&q=select+*+from+public.galapagos_islands&format=geojson&bounds=&api_key="
fil <- "gal.json"
if (!file.exists(fil)) download.file(URL, fil)
gal <- readOGR(fil, "OGRGeoJSON")
gal_map <- fortify(gal)
ggplot() +
  geom_map(map=gal_map, data=gal_map, aes(x=long, y=lat, map_id=id)) +
  coord_equal()

Look at the picture: I don't want to show these lines (all of them).


texts:
How do I start?

I want to open a DXF or a DWG file and then to export it to a KML file to be used in google earth.

Have no idea how to start doing so.


texts:
Here i am try to set polygon outline width but it give me error.

Please flow below code.

from PIL import Image,ImageDraw

img = Image.new("RGB", (1024, 1024), "white")

draw = ImageDraw.Draw(img)

draw.polygon((924, 266, 245, 777, 241, 782, 306, 100, 924, 266), fill="white", outline="black")

img_new_name="C:/example/Garpani_corrected.png"

img.save(img_new_name, quality=90)


texts: CRS problem after raster reproject via QGIS Warp

texts:
I have a land cover raster downloaded from NLCD website with CRS as **EPSG: 42303** - NAD 83/Albers NorthAM. I reprojected it to **EPSG: 102740**, Texas State Plane South Central Zone 4204 via Warp of QGIS. However, when I check the the reprojected new raster CRS, it shows its CRS as

  USER:100030 - * Generated CRS (+proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333334 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.999999999 +datum=NAD83 +units=us-ft +no_defs) - Projected.

Should not it be EPSG 102740 as I directed Warp to do?

Or how I can fix this bug (if it is a bug of QGIS Warp).


texts: Overview Panel not displaying layers in QGIS?

texts:
I'm learning about the QGIS GUI. I've loaded a sample Alaska raster with the vector lakes layer, and activate the overview panel. However, the layers are not displaying within the panel. The extent rectangle is displayed, and I am able to use it to change the extent as normal.

Is there any way to fix the overview panel so  it displays the layers as expected?


texts: Styling a contour line to indicate the direction of elevation

texts:
I've just got a slippy map set-up using Mapnik to render OpenStreetMap data.

I've loaded SRTM elevation data following the PostGIS steps here and can now see contour lines on the map.

I'm trying to customise the contour line styling. Excuse my poor graphics skills in the following image, I thought it may be easier to use to communicate what I am trying to achieve.

I'm trying to style the contour lines in a way that the uphill edge of all the lines have a different colour from the downhill edge (in the above image red to indicate downhill and pink to indicate uphill).

I'm not sure what's the best way or if it's even possible to do using Mapnik styling but I thought of the following possibible options:

Render a line then create a duplicate by calculating the centre of the lines circle, and then reduce or increase the ratio by a pixel.
Render one line and then style using a colour gradient at 90 degrees to the line

I think the first option could produce some varied results given that the contours are all different shapes and sizes. I suspect there could end up being too much of a gap between the two lines in some cases.

The second I think would create a more accurate contour as there will only be one line and hopefully reduce rendering time too. The main difficulty I see with this is how the Mapnik styling can differentiate between the uphill and downhill edge.


texts: Get R scripts from on-line scripts collection

texts:
I have QGIS 2.18 installed on Win 10, I tried to add online R scripts from processing toolbox, but i get errors.

"Python error: An error has occurred while executing Python code: See message log (Python Error) for more details."

I have already activated R and configured the path folders from the providers window