texts: FileGDB write support for GDAL/OGR in macOS

texts:
I am using macOS Mojave and Homebrew with latest update.
I have tried to install gdal 3.0.1 and filegdb plugins via homebrew-osgeo4mac tap as below:

brew tap osgeo/osgeo4mac
brew install osgeo-gdal
brew install osgeo-gdal-filegdb

After complete, I could not find FileGDB on the listed format after checking via ogrinfo —formats
only OpenFileGDB on the list with read-only support

How to enable write support for FileGDB in macOS?
I have follow various solution that already answered in this forum with no success.

For comparison, I installed GDAL+FileGDB plugin from gisinternals repo in Windows 10, and FileGDB on the list with write support.


texts:
Imagine having a MbTiles database like the one you can download here
Is there a way to quickly visualize the tiles on a map? Such as an online tool, QGIS PlugIn, ...

If I get a completly unknown database, not knowing whats in there, its hardly possible to investigate the tiles, unless there is a tool that zooms automatically to the area covered by the tiles.


texts:
I'm not sure if there is a fix for this, or if I am encountering a bug. I have 2 layers. The base layer is the XYZ Tile for OpenStreetMap and the top layer is a 1-channel raster, set to 50% transparency.

The problem is that when I zoom in too much or export it to an image using the Print Composer, it drops sections of the OSM tile.
Zoomed out, looks ok:

Zoomed in, most of the OSM tile has disappeared (note that I have verified that is in fact missing OSM tile and not an issue with the raster's transparency):

When I export to image or pdf, it always renders it with the missing tile sections. I also see this problem with the zooming when I am in the main QGIS window.

Possibly related to this post?


texts: Is there a way to constrain an FME.exe to certain amount of RAM?

texts:
If I have FME Desktop running on a workstation with a large amount of RAM (e.g. 128 GB), is there a way to constrain an FME.exe process to a certain amount of RAM (e.g. 48GB)?

This question is inspired by my closely related question:
Is there an optimum RAM configuration to use for FME Desktop?


texts: Creating polygons based on Sum of point data

texts:
I'm not sure if this is possible? But can you run a tool, or code this in python, that would generate polygons from adding up point data.

Sort of like convex/concave hull but instead of tracing points with similar attribute data, it would trace points by similar location, adding up an attribute field, and stop once it hits a certain number, then repeat. Until all points are inside an individual polygon.

For example, I have building centroids with the amount of units in each building, I want to create polygons around centroids until it reaches 180 units. Then start a new polygon, creating multiple polygons in a area.

I have been trying different tools.


texts: Colorize a point cloud in a web page based on a scalar field?

texts:
The issue:

I have a a PLY point cloud file computed from a photogrammetric acquisition that has been processed in CloudCompare.

The header looks like this:

ply
format binary_little_endian 1.0
comment Created by CloudCompare v2.10-alpha
comment Created 24.08.18 17:12
obj_info Generated by CloudCompare!
element vertex 2162869
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float scalar_C2C_absolute_distances[2D1/2_Triangulation][k=6]_(X)
property float scalar_C2C_absolute_distances[2D1/2_Triangulation][k=6]_(Y)
property float scalar_C2C_absolute_distances[2D1/2_Triangulation][k=6]
property float scalar_Temp._approx._distances
property float scalar_Approx._distances
property float scalar_C2C_absolute_distances[2D1/2_Triangulation][k=6]_(Z)
end_header

One can see some extra scalar fields in addition to the standard XYZ, RGB and normals values. These extra fields are useful to colorize the cloud in CloudCompare based on some analysis, here for example the distance from a reference cloud.

I would like to display such cloud on a web page. All tools I met, for example Potree tiles, or Cesium 3D Tiles are using 3D tiles in LAS or LAZ format.

But the LAS ASPRS specification only allows for predefined and strictly constrained fields, which is a good thing. Naturally, most of these fields do not exist when the point cloud is not acquired by a LIDAR.
And I just didn't find some extra empty fields for any user-defined values.

The question:

Do you know a way to keep the scalar field values from the PLY file up to the display of 3D tiles in a web browser so that they can be used to colorize the cloud in the web page?

Edit:

As sugested: I cannot convert the PLY file with PotreeConverter directly, the output is buggy, I end up with inf coordinates so I have to convert the PLY file to a LAS file before using PotreeConverter. This is where I lose the scalar field information because the LAS file format is standardized and doesn't accept other fields.


texts:
I just upgraded to OS X 10.10 Yosemite therefore I have to use Java 8 (at least this is what Java tells me).

After installing QGIS I was trying to start QGIS but I got the error message that I have to have JSE 6 installed. Everything else is installed according to KyngChaos.

Does anyone else have this problem and knows a solution?


texts: Creating surface from points in ArcGIS for Desktop?

texts: how to create surface from points in ArcGis? I have a points (centroids of the neighbourhood and number of people living in every neighbourhood) and i would like to create surface that would present density of population.


texts: QGIS Mapserver install and URL not working on 18.04

texts:
Giving QGIS Mapserver a go, the url curl http://localhost/cgi-bin/qgis_mapserv.fcgi?map=/home/bjw/QGIS-Training-Data-master/exercise_data/qgis-server-tutorial-data/world3.qgs&SERVICE=WMS&REQUEST=GetCapabilities only returns some binary output, not xml, nor a map. Is there an example of how this should work?

Have followed the guide: https://docs.qgis.org/3.10/en/docs/user_manual/working_with_ogc/server/getting_started.html#serve-a-project

and this older info https://www.paulshapley.com/2016/07/how-to-install-qgis-server-on-ubuntu.html  to no avail.


texts: Installing QGIS web client 2 on Raspberry Pi (Ubuntu 20.04 - ARM64) - possible?

texts:
I am trying to install QGIS Web Client 2 on a Raspberry Pi 4 running Ubuntu - therefore ARM architecture and 64-bit).
I have managed to install it with yarn, but when issuing 'yarn start' I get several errors - being the first "Error: annot find module 'deepmerge'".
How can I debug / fix this?


texts: Attribute Table Sort Disordered in QGIS?

texts:
I am using QGIS.  I opened my attribute table in Open Office Calc and sorted the table by a column.  I believe I had all the columns selected when I sorted.  Now when viewing the layer, everything is screwed up with wrong attributes.

Is it not a good idea to sort the table?

Is there a way to revert back?


texts: What is the precise distance from equator to pole according to WGS84?

texts:
For calculating areas of polygons by means of projecting to a cylindrical equal area projection I came across the following discrepancy:

I ended up with a different distance, off by more than 5km, from the equator to a pole (the half length of any meridian) for the WGS84 ellipsoid than given elsewhere.

Distance calculated by Integrated Elliptic Circumference:

10007.559km
Distance calculated by Simple Elliptic Circumference Calculation:

10001.973km (very close to source above)
Difference: 5.586km (~0.056%)

Please check the example javascript calculation here:

http://codepen.io/mxfh/pen/rGLiv

The WGS84 ellipsoid definition (pdf) (Chapter III) doesn't specify this.

Is the integrated solution of 10007.559km more precise?

Edit/Clarification:

I'm referring to the exact circumference of the ellipse intersecting the WGS84-Ellipsoid at the two poles and the equator where a (semi-major axis) and b (semi-minor axis) are defined by the WGS84-ellipsoid definition
The distance of pole to equator is a quarter of that circumference (blue line in sketch).

I'm aware that the original meter definition of it was a 10 000th of this distance.


texts: GeoServer not responding to OpenLayers 6 GetFeature request, after enabling CORS filter in the file located at webapps/geoserver/WEB-INF/web.xml

texts:
instructional URL/link of enabling CORS for GeoServer
File location/Directory

As given on the website, I uncommented my the filter in web.xml file to enable CORS,

but now I can not access the GeoServer service.

and even after returning the web.xml file to original format. I am not able to access the WMS layers, because instead of opening the layer in new tab, it is downloading it as WMS file.

so have to remove and reinstall the whole GeoServer.
Kindly suggest, how to rectify this issue?


texts: problem to show layers in legend using arcgis silverlight api

texts:
I tried to create a simple webgis with silverlight.
Software that I used to make the application:  ArcGIS Desktop 10 (without sp), ArcGIS Server 10, Silverlight 4, Microsoft blend 4, and Visual Studio 2010 sp1.
We generally use the code below to add layers to map:

<esri:Map x:Name="Map" >
        <esri:Map.Layers>
              <esri:ArcGISDynamicMapServiceLayer ID="samplewebgis"
                    Url="http://m-pc/arcgis/rest/services/test/MapServer" />
        </esri:Map.Layers>
  </esri:Map>

But when i use the code, the map legend shows no layers. then I tried the code below:

<esri:Map x:Name="Map"   Grid.RowSpan="3">

      <esri:FeatureLayer  ID="xx" Url="http://m-pc/arcgis/rest/services/test/MapServer/0"/>
      <esri:FeatureLayer  ID="yy" Url="http://m-pc/arcgis/rest/services/test/MapServer/1" />

</esri:Map>

This code works properly and legend show layers. Why can't I use esri:map.layers and why can't the legend show layers of map when I use map.layers?


texts: GDAL online courses and Books with tutorials

texts:
I feel I have progressed well with some GDAL functionality including some novel uses of calc but I feel I am missing so much more. I would like to learn more particularly when it comes to raster data processing. Website resources are great but often lack explanation or examples and hence I come to this board for help. I am looking for quality GDAL online courses or books with tutorials (earlier questions have focused on general GDAL learning materials but I am looking particularly for online courses or texts with tutorials). Low-cost options are fine. Below is progress thus far.

Courses

Introduction to GDAL
The course listed on the GDAL website is now a broken link (http://cosmicproject.org/OGR.)
The Penn State (GEOG 585) one is web focused not processing focused.

Books

Geospatial Power Tools


texts: Focusing GeoNetwork default map on Canada?

texts:
When i open geonetwork "map", I want to see 'Canada' by default instead of other locations of the world. I changed the bounding box within an xml file located at
/usr/local/tomcat8/webapps/geonetwork/WEB-INF/data/data/resources
I am not seeing the change in the map extent.

can anyone suggest whats wrong here?


texts: Seeking simple sample mapcache.xml file that works with mapserver?

texts:
I have a functioning mapserver installation runing on Ubuntu 14.04 and it's working fine.  However, I would like to up the performance by putting mapcache in front of it.

I've installed mapcache, but I can't seem to create a valid mapcache.xml file.

I've found a number of 'complete' examples online, but I'm having trouble wrapping my head around all of the details.

Can someone point me to a minimal mapcache.xml file that simply forwards GetMap requests to mapserver and caches the resulting tiles?

That would at least help get me started.


texts: Easy Custom Labeling plugin - Cannot find leader lines/arrow button

texts:
I have installed the Easy Custom Labeling plugin but the toolbar is nowhere to be found. I have checked the box "Activate experimental plugins" in the Plugins' "Settings" menu. Does anyone know what I might have forgotten? I am using QGIS 2.6.

EDIT: I am able to see the "Easy" label button. However I am not able to see the other functions that I have seen in other posts where Easy Custom Labeling is mentioned, such as "Generate line", the "Arrow button", etc.

Perhaps I should have mentioned that what I am trying to achieve is create leader lines (possibly with arrows) between labels and polygons.


texts: Translating WGS 84 datum to mean sea level?

texts:
I'm very new to GIS so here my question is I have WGS84 DEM data for my country and I want to calculate the sea level rise.

I will use QGIS raster calculator, my problem is I need to find sea level for WGS84 datum or the reverse my vertical datum will be the mean sea level?

Any solution?


texts: How to assign fixed values in a raster using to multiple polygons in QGIS?

texts: I have digitised multiple small polygons over a city boundary and its floodplain. I would like to create a raster of the run-off coefficient out of it (for a flood model). Therefore I would like to assign into my empty raster (of the run-off coefficient) different fixed values according to the shape (polygons) file that I have created. How do I do this in QGIS?


texts: Map from point-data to region data in Python

texts:
I have a dataset that lists entities per district - where district is a named shape that exists on a map. I have a different dataset that contains entities of the same type, only instead of being positioned categorically (i.e. by district name) they are positioned using lat-long coordinates.

So, given a shapefile (in either ESRI or GML3), how can I transform a list of lat-long coordinates into a matching list of named districts?

I am looking for the most generic algorithm possible, but if there are tools/modules out there that perform this function natively, that would be good to know too.


texts: Extract value to points runs but table won't open

texts:
I am running ArcMap 10.4.
I have a point file and a raster and I am trying to run extract values to points. It runs successfully, but when I go to open the table I get this error:

Error reading OID from table. Reading rows has been stopped. Check
that the datasource is valid.

I have done this in the past with no issues, I even tried it on a raster/point file that I have done the exact operation with before and get the same error. So I don't really think it's an issue with the data itself (although I'm sure it's possible).


texts: How do you get a correct output CRS when using grass processing algorithms in qgis?

texts:
So the problem I've encountered is when I use grass algorithms from the processing toolbox, it doesn't keep my initial projection and instead changes it for this thing:

But the one I had from the .shp just before was:

It always asks this also when I try to check the properties:

Right now I am coding using pyqgis and I use a lot of r.to.vect, r.watershed, r.water.outlet and I need to add a warp or a reprojection every single time and I feel like there has to be some other way to be able to make this work because my code doubled in size juste because of all the reprojections.
Thank you!
EDIT: When using pyQGIS to do the operations and load the layers after a clip for example he keeps the correct projection when it isn't a GRASS processing algorithm. Even tried to change the project CRS but didn't change anything:


texts: Enable the current location panel in QField

texts: How can the current location pannel be enabled within QField? (see picture below)


texts: Is it possible to load large non georeferenced pictures in Geoserver?

texts:
I use Openlayers as a viewer of very large pictures, they are tiled and the navigation is exactly what I need.

I also can add a vector layer and draw on it.

But when it comes to save those drawings, saving them online... I can not find anything.

Then I learned about WFS-T and if a map (my picture) and its vector layer are on Geoserver it is possible for the user to draw on it and save the modifications to Geoserver.

Now I can not see how to upload a non georeferenced picture on Geoserver ? I got it up and running but that's it.

At this point I'm such a newbie I don't even know if my combo is the good solution to my problem : drawing with a vector layer on very large pictures and save online the modifications.


texts: How to generate one geojson file from several rows in Postgres/PostGIS?

texts:
I have a table with geospatial objects, in particular, polygons. I know that I can generate from one row a geoJSON string using ST_AsGeoJSON(http://www.postgis.org/docs/ST_AsGeoJSON.html). But I would like to generate one geoJSON from all the table. Is this possible? How can I do it?

Thanks in advance


texts: Minimal Distance Between a geometry and a layer on PostGIS

texts:
I am working on PostGIS where I have a two tables.
Let's call them A and B.
A is coming from a multi polygons layer.
B is coming from a multi points layer.

I have created a new column "min_distance" in A. I would like this column to take the value of the distance between the current polygon (eg the own of the row) and the closest point in the table B.

I am thinking about a "for" loop and using the ST_Distance() function but I am honestly lost about how to implement it.
My question is : How can I do this ?

By the way, I am also searching for a clear tutorial about PostgreSQL programing.


texts: Using Alter Field tool of ArcGIS Desktop on shapefile?

texts:
According the ArcGIS 10.2.2 help this should work:

inZoneData = sys.argv[1] # This is a shapefile
fieldList = arcpy.ListFields(inZoneData)
    for field in fieldList:
        if field.name.upper() == 'STATUS':  # rename status
            arcpy.AlterField_management(inZoneData, field, 'status')

but it does not.  What I get is invalid parameter.  If I try this:

for field in arcpy.ListFields(inZoneData):
    if field.name() == 'STATUS':  # rename status
        arcpy.AlterField_management(inZoneData, 'STATUS', 'status')

I get invalid unicode error.  I understand that error at least.

Can anyone shine some light on how AlterField actually works?

I've tried several other things but cannot get this tool working.

Is it a shapefile bug?


texts: Naming conventions for PostGIS Database?

texts:
We are starting to build up a database with PostGIS. The database is supposed to be for a team of about 5-8 researches who work frequently with geodata and statistics.

Has anybody experience with naming conventions when setting up a database?

some important things I already figured out are:

use only lowercase
use_underscores not spaces
don't use special characters like ä,é, etc
only use one language (might seem trivial but we are international)
name tables and columns always in singular
find a standardized way to name the objects in the database i.e. topic_year_source_format

Especially the last point is tricky. Storing my own data i recognized that sometimes you'll get enormous names. So would it be bether to store this information in a metadata that is easy accessible instead of making these huge names that can be quite annoying.


texts: How can I set the base layer of map before initialization?

texts: I have been using map.setBaseLayer(layer); to switch to my preferred map layer, using the localStorage variable layer that is stored in my web browser, upon initialization of the map. But I realize that this is creating unnecessary calls to load the default (first layer) map tiles that I may not need if the preferred layer is the second or third one. Is there a way that I can pre-select the base layer to be displayed (before map initialization), without changing the order of the map layers?


texts: Intersecting linestrings with polygons in Python

texts:
I have two shapefiles, one is a 1x1 km grid displayed as polygons and the other one is a street network displayed as linestrings. I want to cut the linestrings where they intersect the boundaries of a polygon and add the data from the respective gridcell to the resulting linestrings (similar to "Intersect" operation in ArcGIS). I searched for a solution for a while now, but I  cannot find an appropriate answer for this problem. Is there a way to do this operation using Python?

I tried something with geopandas now and it seems to be working now! :) after some more searching around, i found this and i got the setup from there intersecting two shapefiles from Python or command line

import geopandas as gpd

grid_raw = gpd.read_file(r"fliepath")
grid_g = grid_raw[98597:98697].copy()
street_raw = gpd.read_file(r"filepath")
street_g = street_raw[99:125].copy()

data = []

print("Start")
for index, streets in street_g.iterrows():
    for index2, grid in grid_g.iterrows():

        if street['geometry'].intersects(grid['geometry']) is True:
            data.append({'geometry': street['geometry'].intersection(grid['geometry']), 'gridcode':grid['GRIDCODE'], 'emission': grid['emissions'], 'oneway': street['oneway'], 'length':street['geometry'].intersection(grid['geometry']).length})
            print('cut')
        else:
            data.append({'geometry': street['geometry'], 'gridcode':grid['GRIDCODE'], 'emission': grid['emissions'], 'oneway': street['oneway'], 'length':street['geometry'].length})

int_data = gpd.GeoDataFrame(data,columns=['geometry', 'gridcode', 'emission','oneway','length'])
#int_data.to_file('intersection.shp')

int_data.head()


texts: Why does a raster with resolution 5x5m not create a grid with these dimensions?

texts:
I created a 5m x 5m raster using ArcGIS 10.0 Spatial Analyst from a point file. As can be seen in the screenshots of the image and the table, the resulting grid has a higher resoluation than is actually stated. Can anyone explain why this is?

Here is the image of the points and raster: I expected the raster grid to be the same size as the distance between the points...ie 5m!

and here is the table


texts:
I will be installing PostGIS for my project using PostgreSQl (OSM) in Ubuntu 9.04. I had all the requirements prior to the installation (PostgreSQL, Proj4, GEOS). When I unzip the PostGIS tar, then './configure' it, it says that the pg_config.h file is missing. I found out that I need to 'apt-get install libpq-dev' for me to able to have this file and past it as parameter to ./configure --with-pgconfig=PATH. When I executed this, this is what happens:
...
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
Using user-specified pg_config file: /usr/include/postgresql/pg_config.h
./configure: line 16394: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16404: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16405: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16406: /usr/include/postgresql/pg_config.h: Permission denied
checking PostgreSQL version...
./configure: line 16411: test: : integer expression expected
./configure: line 16416: test: : integer expression expected
./configure: line 16426: test: : integer expression expected
./configure: line 16433: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16434: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16439: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16440: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16445: /usr/include/postgresql/pg_config.h: Permission denied
./configure: line 16449: /usr/include/postgresql/pg_config.h: Permission denied
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
configure: error: could not find libpq-fe.h

I checked in the /usr/include/postgresql/ directory and I found the pg_config.h and libpq-fe.h files there.
What can I be missing here?


texts: Regarding Time Series analysis in earth engine

texts:
I have been working on time series change using Landsat 5,7 and 8 satellite images. The objective of my study is to see any changes in features like forest, agriculture etc over time using NDVI
To observe and visualize the changes, firstly I need a  combine chart of monthly NDVI of all above landsat series.

Secondly, I have made mean images of ndvi for each year (a mean of all of the months). I wish to make a chart of mean annual ndvi values vs years, for all the features.


texts: PostGIS unknown projection id in ST_Transform proj4 string

texts:
Using PostGIS I'm trying to transform a point coordinate from EPSG:31468 to EPSG:4326 using a proj4-string that I obtained from QGIS "Select Datum Transform" (is it one?):

SQL is of the form geometry ST_Transform(geometry geom, text to_proj);:
SELECT(ST_AsText(ST_Transform(ST_SetSRID(ST_Point(4482649, 5485174), 31468), '+proj=pipeline +step +inv +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +step +proj=hgridshift +grids=BETA2007.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg')));

As the result I'getting this error:
ERROR:  transform_geom: couldn't parse proj4 output string: '+proj=pipeline +step +inv +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +step +proj=hgridshift +grids=BETA2007.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg': unknown projection id
CONTEXT:  SQL function "st_transform" statement 1

What's probably wrong here?


texts: Polygon area calculation in Ruby (on Rails, rgeo, PostGIS and GEOS) in sqare meters

texts:
In a Ruby-on-Rails application, I need the area  in square meters (or any other surface measure, be it ares, hectares, square kilometers, but not in pseudo surface measure like square degrees) of a geographic polygon.

The application already uses rgeo and PostGIS (via the activerecord-postgis-adapter) and already requires rgeo's optional libGEOS support. So I'd like to make use of these tools for the area calculation, too.

I can use PostGIS (via the activerecord-postgis-adapter) to compute the area of any rgeo geometry:

def calculate_area(geometry)
  ActiveRecord::Base.connection.execute("
  SELECT
    ST_Area(
      geography(
        ST_Transform(
          ST_GeomFromText('#{geometry.as_json}', #{geometry.srid}),
          4326
        )
      )
    ) AS area;
  ")[0]['area'].to_f
end

(Nesting ST_Area()'s argument in geography() is what causes the result to be in square meters.)

However, having to extract the result from execute()'s return value and having the lengthy SQL code embedded in Ruby is rather ugly.

Also, rgeo already provides an area method on the RGeo::Feature::Surface module, which RGeo::Feature::Polygon includes. Its default implementation just isn't all that useful:

srs_db = RGeo::CoordSys::SRSDatabase::ActiveRecordTable.new
wgs84_factory = RGeo::Geographic.spherical_factory(srid: 4326, srs_database: srs_db)

# 1/8 of the Earth, should be around 6.4e13 sqm
polygon = wgs84_factory.parse_wkt('POLYGON ((0 0, 0 90, 90 0, 0 0))')

polygon.area # RGeo::Error::UnsupportedOperation: Method Surface#area not defined.

I have installed rgeo such that it can use libGEOS, which I can verify like so:

RGeo::GEOS.supported? # true

Thus, I thought that I might be luckier with a GEOS-specific factory:

geos_wgs84_factory = RGeo::Geos.factory(srid: 4326, srs_database: srs_db)
geos_polygon = RGeo::Feature.cast(polygon, geos_wgs84_factory)
geos_polygon.area # 4050.0

Well, that's the area in square degrees (90° ⨉ 90° / 2). How can I get the area in square meters without calculating it myself and without longish SQL?

Must I convert my polygon to an area-preserving projected coordinate reference system? (Those seem to come with a working area method in rgeo.) That'd feel kinda wrong to me, but maybe it's still the right thing to do.


texts: How to do polygon fills for KMLs with GDAL/OGR

texts:
I'm trying to create a filled polygon in Python with osgeo. When I set the polygon edge and fill with .SetStyleString(), PEN successfully sets the polygon outline colour, but BRUSH does not fill it. (Brush parameters are defined in section 2.4 of this specification.)

Here's my code:

from osgeo import ogr

# Create ring
ring = ogr.Geometry(ogr.wkbLinearRing)
ring.AddPoint(5.9559111595, 45.8179931641)
ring.AddPoint(10.4920501709, 45.8179931641)
ring.AddPoint(10.4920501709, 47.808380127)
ring.AddPoint(5.9559111595, 47.808380127)
ring.AddPoint(5.9559111595, 45.8179931641)

# Create polygon
poly = ogr.Geometry(ogr.wkbPolygon)
poly.AddGeometry(ring)

# output a KML
# (via examples on https://pcjericks.github.io/py-gdalogr-cookbook/geometry.html)
outDriver = ogr.GetDriverByName('KML')
outDataSource = outDriver.CreateDataSource('output.kml')
outLayer = outDataSource.CreateLayer('output.kml',geom_type=ogr.wkbPolygon)
featureDefn = outLayer.GetLayerDefn()
outFeature = ogr.Feature(featureDefn)
outFeature.SetGeometry(poly)
outFeature.SetStyleString("BRUSH(fc:#FF0000FF);PEN(c:#00FF00FF)")
outLayer.CreateFeature(outFeature)
outFeature = None
outDataSource = None

And here is the output:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Folder><name>output.kml</name>
  <Placemark>
    <Style><LineStyle><color>FF00FF00</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
      <Polygon><outerBoundaryIs><LinearRing><coordinates>5.9559111595,45.8179931641,0 10.4920501709,45.8179931641,0 10.4920501709,47.808380127,0 5.9559111595,47.808380127,0 5.9559111595,45.8179931641,0</coordinates></LinearRing></outerBoundaryIs></Polygon>
  </Placemark>
</Folder>
</Document></kml>

This should create a KML polygon with a green border and red fill. A successful result would have this line:

<Style><LineStyle><color>FF00FF00</color></LineStyle><PolyStyle><color>FF0000FF</color><fill>1</fill></PolyStyle></Style>

I'm not sure how to tell GDAL that the polygon should be filled.


texts: Getting the nearest point and applying attribute filter using Distance Matrix in QGIS

texts:
I have two point layers, one with 233 row, other with 1531.
For every point in layer 1, I would like to get the closest point from layer 2, (ok simple enough, but here's a trick) that has the value of attribute 1 lower than the compared point in layer 2.
This attribute being time, so it occurred before (I converted time to integer for easier comparison).

I wanted to go with distance matrix, but there's no filter option, so I just tried to do the complete matrix, but that didn't work since there s too much data.
The solution doesn't need to include distance matrix, I can also do some simplescripting I guess.

Sorry if I didn't express myself clearly, I will edit, update if needed.


texts:
I need to install Qgis2 on my openSUSE 13.1 box but its standard repo (Application:Geo) on software.opensuse.org reports a build error. Has anyone already found a way to get it working?

martin


texts: Looking for data to create contour lines at close range

texts:
This is my first post here and I'm new to GIS and I'm not massively even sure what I'm asking, so please be gentle!

I'm attempting to learn QGIS through self-study and my idea is to take on a few different types of projects and puzzle my way through to learn that way. One of these is to make a map of my friend's farm... it's a small piece of land so I'll be working at a super zoomed-in level.

I've figured out how to get DEM data and make contour lines from that, but I've only been able to find data for 7.5 arc-seconds which isn't precise enough. I've done a bit of research and see that 1/3 arc-seconds exists and I'm wondering if this data will help me get more precise contour lines to be able to add them to the farm map?

Could someone please let me know where to find 1/3 arc-second DEM data for Portugal? Or if I'm completely off track on what I should be doing to achieve the contour lines, I'd be very happy to be pointed in the right direction!


texts: Avoiding reprojection gaps when merging DEM rasters?

texts:
I have two raster DEMs in same resolution I want to bring together. I was using the merge-function in SAGA, GRASS and QGIS but I always get the following result:

Where could the fault be?


texts: What are geodesic distance calculations used In ArcGIS Desktop

texts:
I'm working on a project where I need to calculate geodesic distances for millions of lat-long points.
Just out of curiousity and in a search for better methods of geodesic distance calculation, I'm wondering, what does ArcGIS use for geodesic distances?
I haven't seem to have found much of any information on that. Also, at the moment I'm using Vincenty's formula (instead of Haversine/Great circle) in Python.


texts: How to test if ArcGIS for Server is running correctly?

texts:
I've recently installed arcgis server 10.1, but I'm not sure if it installed correctly, or if the proper ports are open. Here is my reasoning and I may be off:

1) When publishing a new service(i.e newMap), the folder "arcgisserver\directories\arcgisoutput\newMap" remains empty, I'm assuming their should be a copy of the service in there now.

2) When trying to access the service through arcgis javascript api, I get a blank page. I copied and pasted the source code from the tab or window that pops up when you press "view" in the services thumbnail into a .html file. Then I replaced the url with the REST URL given to me under the services' capabilities options. I've also tried replacing localhost with my machine name and I still get a blank page.

http://localhost/myorg/rest/services/MyMapService/MapServer

If anyone can provide me with some working test code, that would be great, as I'm learning to use javascript api and server at the moment and I want to make sure its configured correctly. Thank you.


texts:
I am very new to javascript and html. I am trying to display a web map, which works, but my issue is trying to figure out how to add a local geojson file to my html code. Here is what I have so far:

<!DOCTYPE html>

    <meta charset='utf-8' />
    <title></title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.css' rel='stylesheet' />

And here is where the issue is trying to display the Geojson:

$.getJSON('operatingArea.js').addTo(map)


texts: How to interpolate (ordinary kriging) large files with QGIS processing

texts: I'm using the Saga ordinary kriging tool as apart of different processing models. The biggest issue I have is the very slow performance. My point shape files have mostly more than 200.00 points (some are >500.00). My workaround is to interpolate the points in SAGA and export them back into QGIS. That is really annoying because I have to switch between the programs. Is there another chance to speed up the performance in QGIS? Or is there another faster tool I could use?


texts: Decrease memory use deploying web-map with raster layers R Shiny Leaflet

texts:
I tried to deploy my web-map with 6 raster layers (60 m resolution each, file size ranges from 400 Kb to 1 Mb) in R shiny leaflet. So the rasters are quite small (initial Landsat 30 m resolution raster did not want to be deployed any way). I had an experience deploying the same 4 rasters on the one map, and it finally worked (when I decreased a resolution to 60 m).
So I have chosen an option 'large (1 Gb)' size instance. But my app being successfully deployed instantly closed every time I open it - and having 'Out of memory' error in the Shiny logs.
Everything can be reproduced from my Github. I searched across links on StackOverFlow (like this) and did not find appropriate solutions, unfortunately.
Since raster size is not really large, I suggest that there can be some solution to decrease it through the coding (like opening on the virtual disc or something like that). May be you can notice that another thing in my ui.R and server.R, global.R could consume to much memory. I've already tried to deploy it without small pictures, but did not successed.


texts: Why are values inserted into postgis columns of type geometry in quotes?

texts:
I'm figuring out how to use the PostGIS extension, and I found a nice tutorial: http://postgis.net/workshops/postgis-intro/geometries.html.

First the tutorial directs to create a table:

CREATE TABLE geometries (
    name varchar,
    geom geometry
);

Then insert into that table

insert into geometries (name, geom)
values
    ('Point', 'point(0 0)');

Then, looking at what other column types I can use with the PostGIS addon, I found that I can use the point type directly:

create table points (
    name varcar,
    point point
);
insert into points (name, point)
values
    ('point 1', point(0, 1));

(Notice that the inserted value into the point column is NOT wrapped in quotes)

Trying to insert a point into the geometries table without wrapping the value in a quote fails:

insert into geometries (name, geom)
values
    ('Point', point(0 0));

  SQL Error [42601]: ERROR: syntax error at or near "0"

This seems like it might be significant... If a column of type point allows for inserting values defined via that type (point(0 0)) - I assume this isn't a normal SQL function call? -, why can't I do the same for a column of type geometry?


texts: US Cities (from JSON) and USA––Same CRS, Wrong Projection

texts:
To learn geopandas, I'm trying to layer US cities (raw json file) over a world map provided by Geopandas.
With the same CRS, the US cities are showing up in the wrong place (picture below). If I used the cities dataset (provided by Geopandas.datasets), it works fine.

import matplotlib.pyplot as plt
from geopandas import GeoDataFrame
from shapely.geometry import Point
import pandas as pd

world = world[(world.pop_est>0) & (world.name!="Antarctica")]
world['gdp_per_cap'] = world.gdp_md_est / world.pop_est

# US Cities from Raw JSON File
url = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json'
cities_df = pd.read_json(url)
geometry = [Point(xy) for xy in zip(cities_df['latitude'], cities_df['longitude'])]
cities_gpd = GeoDataFrame(cities_df, crs=world.crs, geometry=geometry)

cities_gpd.crs, world.crs
# Ouputs ({'init': 'epsg:4326'}, {'init': 'epsg:4326'})

fig, ax = plt.subplots(figsize=(10, 5))
ax.set_aspect('equal')
world.plot(ax=ax, column='gdp_per_cap', cmap='OrRd', scheme='quantiles')
cities_gpd.plot(ax=ax, marker='o', color='green', markersize=16)
plt.show()

Map Image


texts:
As a little disclaimer, I'm going to get the terminology wrong in this question, but please bear with me.

There's plenty of questions and answers I've looked at in my journey of troubleshooting so far trying to merge shapes in My Maps.

I've been able to create polygons and merge them by right clicking, but I have other shapes, styleURL #icon-1739-FFD600 from the KML file, that aren't able to work the same magic. I did a find-and-replace to change the styleURL from #icon-1739-FFD600 to #poly-000000-1200-77-nodesc, but had no luck. It did change how things looked on maps, but right clicking outside two adjacent shapes' bounds only gave me the option to delete selected.

I've also tried to simply take the folder references out of the KML file as another answer suggested, but the ends of the shapes didn't line up resulting in choppy, unexpected areas:

If there would be any way to put these in the right order before the folder references are cut out of the file, I'm sure that would solve the issue, also.

All I need is the U.S. States as polygons in a format where I can merge them.

These are only the routes I have tried to go in effort of avoiding the worst-case scenario, drawing them all by hand with accuracy.


texts: Number of Points on the edges (number of districts at country border)

texts:
I'm extremely new on QGIS and I have a district map of India which looks like this.

I want the data of districts situated on the border. Basically, with each district there will be another column stating a binary output(0/1, situated at the border/not situated at the border) which is apparently the number of points on the edges. How can I do this?


texts: Layman friendly method to create a shapefile

texts:
I have a few projects where I'm plotting various things on a map that's broken down by neighborhood (this, basically). It's looking like I need to make my own shapefile but with absolutely no GIS knowledge of any kind I'm utterly stumped about how to do this. Everything I've found so far relies on expensive proprietary software and technical procedures that are way over my head, it looks like a lot of it even presupposes you already have a shapefile and just need to convert it to a different format.

Is there some way a layman can load up a map of a city and draw their own?

[edit]

Since apparently there is no way to directly message the staff who locked this: This question is not opinion based. Whether a program exists that allows someone to visually draw polygonal shapes on top of a map and save the result as a shapefile is a question answerable only by objective facts.


texts: Modelling open water flow in TIN-model using ArcGIS for Desktop?

texts:
I have a TIN-model created from 1800 xyz-coordinates (that I also have). There is an pipe leading all the water in and on for all the water out.

I would very much like to simulate movement of the water under different volumes of water flowing into the system.

Any bright ideas?

I already tried HEC-RAS / HEC-GeoRAS but it doesn't work with ARC 10.3 which is the only version I can get from my university.


texts:
I want to polygonize this PNG. I try

  gdal_polygonize pic.png -f "GeoJSON" polygonized.geojson

but I get only 11 polygons instead of more than 20. What is the cause or how can I fix it?


texts:
I'm running a for loop to rescale a bunch of rasters and then save them for use in another function. However, I'm having trouble saving the rasters properly. My current solution is to copy the rasters so that they have the correct names (they're initially called "numpyarraytoraster_[long unique string of characters]") and then delete the old temporary layer. Using arcpy.Delete_management deletes the extraneous layers but also crashes the program (ArcGIS Pro 2.0.0) on the final iteration. I'd love to know why.

Relevant code, all within a for loop:

            name = inRaster.name.replace('Int_Raster','Rescl')
            outName = os.path.join(arcpy.env.scratchWorkspace, name)

            # Convert back to raster
            rescaledRaster = arcpy.NumPyArrayToRaster(rescArray, lowerLeft, cellSize, value_to_nodata=NULL)
            arcpy.DefineProjection_management(rescaledRaster, 4326)

            # Save the rescaled raster
            arcpy.env.overwriteOutput = True
            if arcpy.Exists(outName + ".lyrx"):
                os.remove(outName + ".lyrx")
            copy = arcpy.CopyRaster_management(rescaledRaster, outName)
            rasLayer = arcpy.MakeRasterLayer_management(copy, name)
            lyrx = arcpy.SaveToLayerFile_management(rasLayer, outName)
            #arcpy.Delete_management(rescaledRaster)    #causes ArcGIS to crash when not commented out
            members.append(name)

I'll note that this solution still doesn't allow me to access the rescaled rasters without saving, quitting, and reopening the program, but if I can get it to at least output all the correct rasters with the correct names then I'll be happy.


texts:
I am developing a GIS_desktop application with VB.NET and MapWinGIS.  When I load a shapefile into the application, it is displaying blocks instead of the actual polygons

.

The shapefile is supposed to display the polygons as shown in the attached


texts:
I receive a polygon layer in Leaflet via ESRI REST. (similar to here )
I want to have a menu where I can zoom to specific polygons. (one button per polygon)

How can I do that?


texts: Displaying KMZ file + my location in Android Google Maps application?

texts:
This is probably a newbie question, but I don't know anything about GIS.

Someone sent me a GPX file that I converted into a KMZ file so it's displayed in Google Maps.

It works fine when viewed in a browser, but I'd like to display it in the dedicated Maps application in Android so I can view the KMZ route and my current location at the same time so I don't stray away from the planned route when going for a ride.

However, Maps doesn't like pasting the URL with the KMZ file.

Here's a screenshot:

Is there a way to see both a KMZ route and the current location?

Thank you.


texts:
I am trying to define a custom CRS in QGIS 3.4 to work on some data in Central Asia. I want to use the Albers Equal Area Conic but change the parameters so that the transformation works best for my study area.

I first tried to go via "Settings" --> "Custom CRS". I defined the name and the +projstring as +proj=aea +lat_1=21 +lat_2=49 +lat_0=37 +lon_0=87 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs. But when I click "Ok", nothing happens.

I don't get an error message or any feedback, there's just no response. (I tried QGIS 3.10 as well, but the same problem occurred.) This looks like a bug to me or is there something I missed?

If this cannot be reproduced, I could also go the Python way, but I'm not so familiar with that. I've read through some documentation and found the following pieces of code but I'm not sure if they are in the right order or if something is missing:

my_crs = QgsCoordinateReferenceSystem()
my_crs.createFromProj4("+proj=aea +lat_1=21 +lat_2=49 +lat_0=37 +lon_0=87 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")
my_crs.saveAsUserCrs("Albers_Central_Asia")


texts: What is the best way to connect spatial data with attributes in Excel table?

texts:
I have many attributes which are stored in an Excel table. They refer to USA counties. I need to somehow connect those attributes to polygons in some format (don't know which is the best) and visualize it by Leaflet or similar API. Those attributes need to be in popups.

What do you recommend? How can I connect spatial data (polygons of counties) with attributes stored in Excel table? I'm using software like ArcGIS and Quantum GIS. I am opened to MySQL and PostgreSQL regards to databases if you recommend those.

Please try to explain with more details and exact steps so I can be sure I understand.


texts:
I have a DEM in .xyz format and a polygon. I tried to use the "Clip raster by mask" tool to Clip the raster but it doesn't work. The error message just said "couldn't create layer ... there are more Information about the algorithm in the Qgis main Window".

Could it be that clip raster by mask doesn't work with .xyz Format? Any other ideas where the Problem might be?

The CRS is the same for both the Polygon and the .xyz DEM.


texts: Is Sandy Springs, GA actually Atlanta, GA (ambiguous cities while geocoding)?

texts:
I installed postGIS and the associated TIGER geocoder for work, and noticed a strange thing when geocoding some addresses in the Atlanta area.  For example, when I geocode the address "8610 Roswell Rd,  Atlanta GA 30350," the TIGER geocoder spits out

-[ RECORD 1 ]-----------------------------------------------
addy    | (8610,,Roswell,Rd,,,"Sandy Springs",GA,30350,t)
geomout | 0101000020AD1000000D9C2329851655C04F0F9046E4FE4040
rating  | 11

At first I thought this was just an issue where someone had incorrectly entered the address as Atlanta instead of Sandy Springs.  Strangely though, if I search for "8610 Roswell Rd,  Sandy Springs GA 30350" on googlemaps, it says that the address is in Atlanta.  This is despite the fact that a search for Sandy Springs in googlemaps returns a bounding box that clearly includes the address in question.

Does someone know what is causing this discrepancy?  Is there something weird going on with cities around Atlanta or is this a general pattern?


texts: "This tool has no parameters" after opening agent analyst

texts:
I installed the agent analyst based on the data and the book available on this link http://resources.arcgis.com/en/help/agent-analyst/
But after installing, I encounter the following when opening it "this tool has no parameters"
No one knows about this؟؟
I've tried this thread on ArcMap 10.3 and 10.4.


texts:
I have in my table column geom with geometry, data type of this column is geometry(Point,102067). I want to change SRID from 102067 to 5514, but if I use this command

select UpdateGeometrySRID('my_schema', 'table', 'geom', 5514) ;

docs say: ERROR:  invalid SRID: 5514 not found in spatial_ref_sys
CONTEXT:  SQL statement "SELECT UpdateGeometrySRID('',$1,$2,$3,$4)"

I found, that EPSG:5514 = EPSG:102067 (both is S-JTSK_Krovak_East_North), but in second table I have EPSG:5514, and for example comand ST_Contains says: Operation on mixed SRID geometries.


texts: How to dissolve two lines only when there is a point between them?

texts:
I have a network of line features. Each lines are supposed to be connected to other line end to end at nodes. The connected lines (at nodes) may or may not have different IDs (yes there can be two lines with same ID in the same featuere). I want to make a join based on the attribute IDs available on each line. That is, I want join to happen between end to end touching lines only if there is no point (which is from a different point feature class) between them. The red pentagons on the attached figure shows those locations.

How did I get here? The black dots and the pink squares are the only points where I wanted the lines to be split on the first place. First, I used join to join to join all these line features and then used split lines at points to split them only at the points. Strangely, the line also splits at the red pentagons shows (apparently, intersection between two lines).


texts:
This is a flat earth model:

flatearth

Yes, it's funny, no, I'm not a flatearther. My interest is just exploring how the world would look like if the Earth would be flat according to this model.

I don't know too much about QGIS and I would like to start using it. I've succeeded to import geofabrik files.

How can I produce this projection?


texts: What's the alogorithm used to show places names in Cartography when zooming?

texts: Actually I am using graphs with Viz.js . For large graphs I want to implement the same algorithm of maps used when zooming. So, at first we get a general map then on zooming showing new places (for graph at the beginning show general nodes and on zooming show children nodes). I couldn't find the algorithm used in cartography to show/hide when zooming in/out. Can you explain to me how it works?


texts: Finding all points in linestring that are contained by polygon using PostGIS?

texts:
I have a linestring made up of 4D points and I need to determine which points in this linestring fall within a specific bounding box so that I can get the Z dimension of those points. I'm using Python 2.7 and Postgresql 9.3.4 with PostGIS 2.1.2. As of right now I'm first determining if the linstring overlaps the bounding box:

SELECT id FROM my_table WHERE ST_Intersects(my_geom, ST_GeometryFromText('POLYGON((minLon minLat, minLon maxLat, maxLon maxLat, maxLon minLat, minLon minLat))', 0))

Next, I'm dumping out all of the points of any linestring that intersects the bounding box:

SELECT ST_AsText((dp).geom) FROM (SELECT ST_DumpPoints(my_geom) as dp FROM my_table WHERE id like id_from_above) as foo

I then loop through the points and store any that are found inside the box (I'm pseudo-coding here):

for i in range(0, len(points)):
    SELECT ST_Contains(ST_GeometryFromText('POLYGON((minLon minLat, minLon maxLat, maxLon maxLat, maxLon minLat, minLon minLat))'), ST_GeometryFromText('points[i]'))

Last, I get the Z dimension of each of these stored points (again, pseudo-coding):

for i in range(0, len(stored_points)):
    SELECT ST_Z(ST_GeometryFromText('stored_points[i]'))

This method seems to work, however each linestring contains on the order of 25000 points. Since there are potentially many linestrings that will need to be checked, I'd like something that runs a bit faster.


texts:
If I wanted to import a single function, such as RasterToPolygon_conversion, how would I do that without import all of ArcPy through import arcpy?

I'm trying to reduce the time it takes at program startup, and I don't need all of ArcPy.


texts: InvalidJsonValueException in geoserver printing module

texts:
I have a leaflet web app displaying some WFS and WMS with tiles from the IGN in WMTS.

I've installed leaflet.print plugin and the geoserver printing module.

But, when I want to print, a web page is opening with :

1 Error while generating PDF:
2 com.itextpdf.text.DocumentException:org.mapfish.print.InvalidJsonValueException: spec.layers[0].baseURL has an invalid value: http://wxs.ign.fr/my key/wmts?LAYER=GEOGRAPHICALGRIDSYSTEMS.MAPS&EXCEPTIONS=text/xml&FORMAT=image/jpeg&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX= (spec.layers[0].baseURL has an invalid value: http://wxs.ign.fr/my key/wmts?LAYER=GEOGRAPHICALGRIDSYSTEMS.MAPS&EXCEPTIONS=text/xml&FORMAT=image/jpeg&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX=)

Any idea ?

Here is my config.yaml :

dpis: [75, 150, 300]

scales:
- 524288000
- 262144000
- 131072000
- 65536000
- 32768000
- 16384000
- 8192000
- 4096000
- 2048000
- 1024000
- 512000
- 256000
- 128000
- 64000
- 32000
- 16000
- 8000
- 4000
- 2000
- 1000

hosts:
- !localMatch
    dummy: true
- !ipMatch
    ip: 0.0.0.0
    mask: 0.0.0.0
- !dnsMatch
        host: http://wxs.ign.fr
- !key
        key: my key

layouts:

A4:
    metaData: &commonMetaData
        title: "${mapTitle}"
        author: "GeoExplorer"
        subject: "Map printed with the OpenGeo Suite"
        keywords: "map,print"
        creator: "OpenGeo Suite"
    mainPage:
        pageSize: A4
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 600
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"

Legal:
    metaData: *commonMetaData
    mainPage:
        pageSize: LEGAL
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 650
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"

Letter:
    metaData: *commonMetaData
    mainPage:
        pageSize: LETTER
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 550
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"


texts:
I several times had the same problem using the QGIS expression aggregate: I got the impression that it behaves somehow buggy - or I make a mistake.
See this expression I use on a point layer:
aggregate (
    layer:='points',
    aggregate:='concatenate_unique',
    expression:=x($geometry),
    concatenator:=','
)

The preview shows an error: Could not calculate aggregate for: x($geometry). If I click the arrow to the right of the preview to change to the preview for the next feature, the preview changes from error to NULL. As far as I can see, comparing with the help on the right side, the syntax is correct. Simplifying the expression to aggregate ('points','concatenate_unique', x($geometry)) results in exactely the same problem. I also changed the layer name to the @layer variable and used an existing field id to aggregate: aggregate (@layer,'concatenate_unique',  "id" ). However, the very same problem persists.
Is this a bug or do I make a mistake?


texts: Why can not Landsat 5 image use Fmask algorithm to identify cloud?

texts:
I want to get 1990 NDVI from Landsat5,and remove the cloud cover, so I used the code:

var addNDVI = function(image) {
  var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
  return image.addBands(ndvi);
};

var addFmask = function(image) {
  var datamask = image.select('fmask');
  var cloudMask = datamask.neq(1).and(datamask.neq(2)).and(datamask.neq(3)).and(datamask.neq(4));
  return image.updateMask(cloudMask);
};

var collection2 = ee.ImageCollection('LANDSAT/LT5_L1T_TOA_FMASK')
    .filterBounds(alb)
    .filterDate('1991-01-01', '1991-12-31')
    .select(['B3', 'B4', 'fmask'])
    .map(addFmask)
    .map(addNDVI).select('NDVI');

When I run this code, I got the error as below:

Error generating chart: ImageCollection.load: Use LANDSAT/LT05/C01/T1_SR instead of LANDSAT/LT5_L1T_TOA_FMASK

So, I'm wonder if there are any question to use Fmask algorithm in the Landsat5 or I need to make some correction?


texts: Cannot load PyQGIS/PyQT modules: ModuleNotFoundError: No module named '_shaded_thriftpy' in PyCharm

texts:
New to PyQGIS.
I am trying to set up my environment to create PyQGIS scripts.
I have QGIS Zurich 3.18.2 installed which I installed through the OSGeo 32bit installer.
I have PyCharm Community Edition 2021.1.1
My interpreter seems set to the right configs and the modules are loading:

But when I run the following code to import my libraries:
from qgis.core import *
from qgis.PyQt import *
from qgis.analysis import *
import datetime
import math
import os
import pandas as pd

I get the following error:
C:\OSGeo4W\bin\python-qgis.bat "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\plugins\python-ce\helpers\pydev\pydevconsole.py" --mode=client --port=63002
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 5, in <module>
    from _pydev_comm.pydev_rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_rpc.py", line 4, in <module>
    from _pydev_comm.pydev_server import TSingleThreadedServer
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_server.py", line 4, in <module>
    from _shaded_thriftpy.server import TServer
ModuleNotFoundError: No module named '_shaded_thriftpy'
Process finished with exit code 1

I got the same error even after editing my .BAT file and also when I was running the 64bit version (which  also caused a different Python error and wouldn't load GRASS like this QGIS Unable To Load Processing, Vector Tools and Plugins)
What am I doing wrong?


texts: r.composite gives blank image output in GRASS GIS

texts:
While running r.composite in GRASSGIS GUI command the image formed looks absolutely blank. The data I used is listed here below.

IRS-LISS III Multispectral coverages. (i.e. band 2, 3 and 4 for Blue, Green and red respectively)


texts: Converting table UTM coordinates to decimal lat-long in Attribute table using expression

texts:
I would like to formulate an equation in the attribute table calculator tool to calculate the decimal latitude and longitude values from the existing UTM NAD3 coordinates in the table.
The UTM NAD83 coordinate fields are "UTM_X" and "UTM_Y", and the floating-point fields that I want to receive the calculation results are floating-point fields "Lat_DD" and "Long_DD". The "UTM_X" and "UTM_Y" fields have already been populated with the expression $x and $y respectively. My project CRS is UTM NAD83 zone 16.
I have an intuition that this is probably a routine calculation that is processed by a standard function but I'm new enough to QGIS that my browsing through the "Geometry" and "Function" calculator categories has not yielded the correct combo.


texts:
Does anyone here know when OpenLayers 2.12 is likely to become a Stable release rather than a release candidate, it contains so many handy performance and user interface improvements that I really want to get it into our application but me and my colleagues are (only slightly) hesistant about using a release candidate and would rather use a stable release.

If its going to be ages or unknown then I'll probably just use the release candidate I am using for developement (I think its rc-8) as it seems perfectly stable, just wondered if the community had any idea!

Thanks!


texts: Layers with same coordinates not lining up

texts: I have a project where I have a few layers (State of Texas, cities, roads, etc.). They are all resaved and projected to NAD83 / UTM zone 14N EPSG: 26914. The project CRS is also NAD83 / UTM zone 14N EPSG: 26914 and on the fly projection is enabled. I added a text delimited file and cannot get them to line up. I checked the attribute table of the delimited file and the coordinates are correct. I cross-checked this with a point close to where a few of the points from the delimited file are and they are very close so in theory they should be lining up. I tried to save the delimited file and save it with the same projection and add the shp file back in and that did not work. Anyone have any ideas? I can't think of anything else to try.


texts:
I'm building gdal 2.4.1 with the following config options

  ./configure --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-openjpeg --with-opencl=yes --with-opencl-include=/usr/local/cuda/include --with-opencl-lib='-L/usr/local/cuda/lib64 -lOpenCL' --with-python=yes --with-libkml=yes --with-png=yes --with-sqlite3=yes --with-spatialite=yes --with-python=yes --with-geos=yes --with-curl=/usr/bin/curl-config

and I'm getting the following error during build

/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_info_read'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_slist_append'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_add_handle'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_easy_perform'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_perform'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_cleanup'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_easy_init'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_easy_cleanup'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_remove_handle'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_easy_setopt'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_version'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_easy_getinfo'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_slist_free_all'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_init'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_fdset'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_version_info'
/home/ruggedroutes/Sources/gdal-2.3.3/.libs/libgdal.so: undefined reference to `curl_multi_wait'
collect2: error: ld returned 1 exit status
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory `/home/ruggedroutes/Sources/gdal-2.3.3/apps'
make: *** [apps-target] Error 2

I'm really not sure what to do about this.


texts: ArcGIS: How to programmatically refresh selected features

texts:
Background: I have C#, ArcGIS command that 1. lists selected features, and 2. allows you to delete selected features from this list out of a geodatabase.

My problem: After I delete features, ArcGIS doesn't update the selected features list.  When my program asks ArcGIS for the selected features, it gets back references to the features it already deleted.  It shouldn't.

My Question: What should I do to tell ArcGIS to check the selected features list for non-existent features?  Is there a "refresh" command that will do this, or do I have to reselect the features (excluding the deleted ones) programmatically?


texts: how to calculate area verses each NDVI value?

texts: I created an NDVI map, I want to calculate area of vegetation verses the respective NDVI value of the given map. Which tools are used for this process and what steps are required?


texts: Get a list of all countries and their states?

texts:
I'm searching for a data set that contains the country information (Name, ISO 2 char, ISO 3 char, ISO number, ...) and other data. Also I'm looking for all states for each country including their abbreviation.

I'm willing to pay for that data if it is verified, actual and gets updated from time to time. I've already tried searching but couldn't find anything reliable.

Please note that I don't need geographical information directly but just a table of the data above.


texts: Optimal tiling of polygon using ArcGIS Desktop?

texts:
I am trying to tile a polygon with a minimal number of fixed sized squares.

Currently I am creating a fishnet over my polygon then spatially joining the squares that intersect the polygon. This is not optimal.

Also note the squares can be shifted vertically/horizontally but not rotated.

My end goal: The polygon represents a clipped image and I want a tiling of the clipped image. Where each tile is 300px by 300px. Some overlap is fine if that makes the problem easier.

Current

Manually optimized

Are there any tools or algorithms that would help with this? I am proficient with Python and ArcMap.

The polygon was created from line features so I also have access to those segments. Maybe that would will help for generating the squares.

The entire polygon must be covered.


texts: Changing from degrees to meters with QChainage plugin?

texts:
I have some difficulties changing degrees to meters,
My CRS is WSG84, EPSG:4326,

On googling they all change the CRS to handle it (some CRS will be meter when using QChainage), but I can only use this,

Is there any solution that can help me to change degrees to meters?


texts: Displaying HTML popups for feature service

texts:
This bit of information caught my eye today as I was reading about Feature Services in the ArcGIS Server .NET help:

  Feature services also support HTML
  pop-ups setup in ArcMap. HTML pop-ups
  are a powerful and easy way to share
  HTML formatted information about
  features. They work much like the
  Identify tool, except that the
  information display can be customized
  HTML.

I set up the HTML popup in ArcMap and it worked as expected, and then I published a map service.  The REST endpoint of my service now shows esriServerHTMLPopupTypeAsURL as the HTML Popup Type, however, I can't seem to find a sample, etc. that shows how to display the popup in a web application.

Does anyone have a link to a sample, or some sample code, that can show me how to do this?  I have looked through the JavaScript API samples/reference and didn't find what I was looking for (or what I thought I should be looking for).

Thanks,
Tim

Edit:  Thanks to those who supplied answers for the links.  I think I need to re-phrase the question:  I'm not having problems getting the popup to display - that is working fine.  My HTML popup type is set as PopupTypeAsURL, so I was expecting the popup to display the contents of the URL, say http://whateversite.com.  Essentially I want the popup to display a web page or web form.  Is this possible?


texts:
At one time we locked ArcGIS's customization mode (in an attempt to make the toolbars stop moving). Since then we have forgotten a password. The customize mode is shared through all MXDs, so saving a copy of the MXD or even creating a new MXD does not work.

Is there a way to remove the customize mode password?


texts: Unable to draw shape after shapefile merge

texts:
I have merged a bunch of shapefiles in ArcCatalog and get the "the selected file failed to draw...." error. Every thing has merged alright in the db.

I'm new to GIS and could use some help.

Each of the shapefiles that were imported to ArcCatalog are an aggregate of the following file extensions:
•.dbf
•.prj
•.shp
•.shp (xml)
•.shx


texts: Stopping PyQGIS script that has infinite loop, using keyboard?

texts:
So I wrote a script that does what I want over and over again using a "while True:" in a certain time interval (every 5 seconds using time.sleep(5)). So far so good, BUT when I want to stop it I just can't.

I have tried Control+C, Control+Break, Escape and it practically ignores my keyboard. The only way to stop it is to close QGIS. Any ideas? Furthermore, when the script hits time.sleep(5) QGIS kind of lags and freezes for 5 seconds and I can not, for example, pan the layer but I assume this is normal.

Here is my script:

from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.core import *
from qgis.utils import iface
import time

while True:

    def change_color():
        active_layer = iface.activeLayer()
        pipeline=[]
        txt=open('C:/users/stelios/desktop/project/Sensor.txt','r')
        for line in txt.readlines():
            pipeline.append(line.split())
        print pipeline
        pipeline2=[]
        for label,color in pipeline:
            if "0" in color:
                pipeline2.append([label,"green"])
            else:
                pipeline2.append([label,"red"])

        print pipeline2
        elatomatikoi=""
        categories=[]

        for label,color in pipeline2:
            if 'red' in color:
                elatomatikoi=elatomatikoi + label+","
            symbol = QgsSymbolV2.defaultSymbol(active_layer.geometryType())
            symbol.setColor(QColor(color))
            category = QgsRendererCategoryV2(int(label), symbol, label)
            categories.append(category)

        expression = 'id'
        renderer = QgsCategorizedSymbolRendererV2(expression, categories)
        active_layer.setRendererV2(renderer)
        active_layer.setCacheImage(None)
        iface.mapCanvas().refresh()
        iface.legendInterface().refreshLayerSymbology(active_layer)
        elatomatikoi= elatomatikoi[:-1]

        for label,color in pipeline2:
            if 'red' in color:
                QMessageBox.critical(None,"Warning",("Leakage at pipe(s):%s\nCheck Pipeline status " %elatomatikoi))
                break
        txt.close()

    change_color()
    time.sleep(5)


texts:
I'm looking to style some lines in QGIS to look like the steps in OpenStreetMap's default style. Actually, I'm styling those same steps on my own machine.

Basically, unless I'm missing something, I need to make a dashed line that is wide with very short dashes.

I've tried setting a custom dash pattern, but qgis doesn't seem to take values of less than 1 because the size of the dash doesn't shrink after that point. So I can get a custom dash pattern with a dash that is as short as it is wide, but no shorter. Is there a way past this, or some other way to style the lines to look like steps?


texts: Precise Projection output in image files

texts:
A friend is having problems with output of a projection in QGIS.
The problem statement is:
How to output a projection from upper left corner being Pacific/Guam, lower right corner New Caledonia/Noumea in 1 or more image files, BMP or PNG (lossless information is required).
Size/Scale of resultant image file must be around 10 pixels per Nautical Mile.
Precision is required, no overlapping parts must be present in the image(s)
So the result image will be fairly large. My friend used the "Print Composer" so far, but it seems to only be able to print the area "in view", so viewing scale determines the content of the output.
I have read about a thing called "Atlas Generator". Can this be used towards our goal, and if yes, how to do so?
Though of course any solution is appreciated.
Additional details: The projection contains colored (raster?) layers to show elevations on land and below sea level.


texts: Can Google Earth be used to display underground 3D structures?

texts: Trying to make it easy for a non-GIS savy person to view the 3D data I produced in ArcScene. I can't seem to get Google Earth to view underground/below the standard imagery.


texts:
I have this huge table with all the addresses of my country in it. Every house is an object, and  there is a column for the streetname (or street ID) and a column for the housenumber.
I want to make a new table with all the street-id's in it, and the sum of houses on that street, what is the fastest way to make this calculation ?

Thanks


texts: Opening local *.accdb file through ArcGIS API for Flex button?

texts:
I have a web mapping application created with the ArcGIS Viewer for Flex application builder.

Is there a way to create a button that will open a local accdb file?

I dont want to connect to MS Access through my app. I just want to open the file.


texts: rgdal installation error: How to set GDAL_DATA directory?

texts:
I've long had GDAL, proj, etc. installed and working fine for various other related software (e.g., QGIS). Unfortunately, every time R gets updated it tends to lose links to previously installed R libraries. I'm used to this, just a little annoyed, and I try to re-install rgdal. However, it doesn't work this time.

> install.packages('rgdal')
Installing package into ‘/home/arthur/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.4-3.tar.gz'
Content type 'application/x-gzip' length 1687331 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.3
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... no
checking GDAL: GDAL_DATA data directory readable... configure: error: GDAL data directory not found.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/arthur/R/x86_64-pc-linux-gnu-library/3.5/rgdal’

The downloaded source packages are in
    ‘/tmp/RtmpdZ7ZWN/downloaded_packages’
Warning message:
In install.packages("rgdal") :
  installation of package ‘rgdal’ had non-zero exit status

Searches online aren't very helpful because most users reporting this kind of error actually didn't have GDAL or a related dependency installed. This problem cropped up on Ubuntu GNU/Linux 18.04 with GDAL version 2.2.3 and R version 3.5.2.


texts: Trying to create colour co-ordinated values on a map from data from a csv. file

texts:
I have a list of values for some data recorded via Magnetic susceptibility, I have these in a shapefile and want to try creating a colour map out of the values.
The values that I'm using relate to, OSGB 1936 / British National Grid, EPSG:27700

Example of the data in csv. file.
I want to try to achieve something similar to the coloured area in the second image. I don't know if this will be possible in QGIS but I thought it was worth trying.


texts: If a shapefile with geometry esriGeometryPoint is valid is it guaranteed to have a non null featureclass?

texts:
I have been given a point shapefile but it's feature class is null.  I haven't seen this before so I'm wondering if the data is bad or if it's something I need to handle with code.

//I was using this to determine if my layer was a point layer, but it's FeatureClass is null
public void isPointsLayer(ILayer layer)
{
IFeatureLayer fl = layer as IFeatureLayer;
if (fl == null && fl.FeatureClass == null) return false;
esriGeometryType type = fl.FeatureClass.ShapeType;
if (type == esriGeometryType.esriGeometryPoint) return true;
}

edit:

I guess ILayer.Valid returned false, thanks for the answers.


texts: VB code for automatic refresh in arcmap with timer?

texts: We have a shapefile of electrial network.The SCADA data of the electrical network is stored in oracle 10g express edition.We have to link oracle table with the arcmap and automatically refresh the map with the values which will be updated in oracle table.Do suggest a method and a code to execute this in Arcmap


texts: Can someone point me what's the type of encoding used in

texts:
I am trying to understand the type of encoding used to represent a poly line on earth from here.com Platform Data Extension service requesting ROAD_GEOM_FC layer.

"LAT":"5013674,12,12,16","LON":"865514,-13,-12,-17","ZLEVEL":",,1,"

Can someone point me to RFC or some documentation about it.


texts:
I'm currently developing an application that uses shapefiles for Dublin. In particular I want to display the postal areas for Dublin but cannot locate an appropriate shapefile.

Can anyone advise where to locate the shapefile for Dublin postal areas?


texts: How to create fixed length (and width) buffer around a polyline in ArcMap 10?

texts:
Could someone please help me?
I would need to create 100 buffers (500m x 1km) along a stream polylines. I know how to do it by using shortest distance but the buffers should follow the curves of the streams. Each buffer should start from certain point (sampling site) and go to upstream for a 500m. Some of my stydy-streams have multiple tributaries on upstream areas and in those cases the buffer should follow each branch.

So far I have a polyline-layer with 100 streams and point-layer with 100 sampling points snapped together with the end of study-streams. How to proceed from here? With some network tools?

I would really appreciate some help!


texts: gdal_translate multiple GDAL_PDF_LAYERS_OFF entries gives error

texts:
The documentation says that GDAL_PDF_LAYERS_OFF takes a list of comma separated layers. Examples look just like what I am trying to do.

Executing the following gives an error
FAILURE: Too many command options.

gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES" MyTopo.pdf MyTopo.tif --config GDAL_PDF_LAYERS_OFF "Other_5", "Quadrangle_Extent", "Other_2" --config GDAL_PDF_DPI 150

If I only use a single layer to turn off, it works flawlessly. Am I missing something simple?

This was the solution as requested. Double quotes as shown in some examples are not needed.

gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES" MyTopo.pdf MyTopo.tif --config GDAL_PDF_LAYERS_OFF Other_5,Quadrangle_Extent,Other_2 --config GDAL_PDF_DPI 150


texts:
Is there an application / service where I can put my floorplan of a building en 'position' it on the right place on the earth? (The buildings location).

I found TileMill an application where I can import an raster image in. Howerver the image covers the entire world.

When importing I supplied an 900913 'string' with some information about the location and size I presume.

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over

With the above string the building 'covers' the entire earth. Is there a way to get the 'correct' string so I can place it over the correct building?


texts: Hillshade is block grey in ArcGIS Desktop?

texts:
I am trying to create a hillshade on my DEM because I need to be able to distinguish features which I can't do in its current state (see picture).

However, when I add the hillshade, it adds a block grey image over the top.

I tried the hillshade again. When I use a stretched render the DEM doesn't appear. I have tried altering the values but it appears to make no difference.
So, the same thing still happens, I try adding a separate hillshade layer and it is still a block colour - sometimes grey, sometimes black.

Any ideas as to how I can get the relief on?


texts: I started to use Quantum GIS 2.0.1 Dufour and I'm still trying to understand how to work with it. I have a shape layer in QGIS made of points, and I want to attach a different hyperlink to each of the points. Is that possible? For now, I have only accomplished attaching several hyperlinks, but to the entire shape layer.


texts: Changing colour of imported SVG icon in QGIS 3.4


texts:
I would like to run the Saga wind shelter index (wind.shelter). It was apparently on older versions of Saga and has been re-added to Saga 7.4 and 7.5

Here is what I have done:

Installed Saga 7.3 and all is well with that;
Installed R and RSaga in order to have access to the wind.shelter module; however Rsaga expects versions 2.3.1 LTS - 6.2.0 and I can't get wind-shelter to run in Rsaga;
Tried to install version 7.5 of Saga which reintegrates the module, without success.

So I don't know how to proceed. Any thoughts? Is there any way I can run the rsaga version of the wind shelter index from within saga_gui?

Please note that I am running Ubuntu 19.10.


texts: trying to create array reader for feature fields

texts:
I am trying to create a functionality that creates array data for any layer that user selects. Now I am able to get all the data in the feature layer that the user selects but I am having some trouble with the ArrayReader to which I need to assign the field names of the feature data.

So this is field collection loop,

for (var prop in e.features[0].attributes) { attrfields.push(prop); }

As of now I am hard coding the ArrayReader like this,

var myReader = new Ext.data.ArrayReader({},[
                    {name: 'family'},
                    {name: 'species'}
                ]);

I need to replace,

[{name: 'family'}, {name: 'species'}]

with the attrfields, which looks like this,

[Object {"Family"}, Object {"Species"}]

Now am confused as to how I should create attrfields to replace it in the ArrayReader? Any suggesstions?


texts: Georeferencing *.tiff to given feature geometry automatically?

texts:
I´ve got the task to georeference an tiff image to the referencing polygon footprint (Polygon).
I have found a lot of ways to do get the footprint from a raster but I could not find a way to use pyqgis or gdal to do it the other way around. Hints using ESRI ArcGIS are also welcome.


texts:
My organization has a asset management application using Google Maps Java API as the GIS viewer.  The application does some simple editing/querying on a kml file through html form elements.

Instead of editing against the kml files, can the API edit/query against a WFS-T service (served by ArcGIS Server)?

If not, can I modify this OpenLayers WFS-T Using a GeoServer Hosted PostGIS (link below) Layerinstructions to edit against ArcGIS Server/SDE database/WFS-T?

http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html

//wfs-t editable overlay
var wfs_layer = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
//projection: new OpenLayers.Projection("EPSG:26910"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
// loading data through localhost url path
url: "http://localhost/geoserver/wfs",
featureNS :  "http://www.opengeospatial.net/cite",
maxExtent: mapextent,
// layer name
featureType: "wfst_test",
// geometry column name
geometryName: "the_geom",
schema: "http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&;typename=cite:wfst_test"
})
});

Thank You!


texts: Resampling GeoTIFF images to same resolution using QGIS

texts:
I have two geotiff images that I would like to resample the same resolution.
If I use ArcGIS Desktop this is easy to do but how do I do this using QGIS?


texts:
The following code allows me to save a text file with .xls extension in Python. When I open it, I receive the following warning:

  The file you are trying to open, is in a different format than
  specified by the file extension. Verify that the file is not corrupted
  and is from a trusted source before opening the file. Do you want to
  open the file now?

def saveExcel (layer,name):
  # get the path
  pathSave=getDirectoryPath()
  chdir(pathSave)
  filename=name+".xls"
  f=open(filename,"w")
  # Save fields'names
  for field in layer.fields():
    f.write(field.name()+ "\t")
  f.write("\n")
  # Save attributes
  for element in layer.getFeatures():
    for field in layer.fields():
      f.write(str(element.attribute(field.name()))+ "\t")
    f.write("\n")
  f.close()


texts: Dissolving overlapping polygons in Google Earth Engine

texts:
I have a series of buffers stored in a feature collection. Some but not all of the buffer polygons overlap. I need to dissolve the polygons in a way that Google Earth Engine still recognizes each as a separate polygon with a unique ID (its own feature in a feature collection) so that I can then determine the polygon that each of my sample points falls into.
The user support I've found on this topic uses the union function like this:
var buffsSample=buffers.union();

This creates a feature collection of one large polygon (one feature). I want a feature collection where each stand-alone polygon (some of them dissolved, some not) is its own unique feature with an ID.
UPDATE: I found that I could create a multipolygon with separate coordinates for each polygon as follows:
var buffsSample=buffers.geometry().dissolve();

The problem is that this is a multipolygon and not a feature collection. When I took this multipolygon and converted it to a feature collection as follows:
var buffsFeature = ee.FeatureCollection(buffsSample)

I end up with the exact feature collection I would have gotten using '''union()''' (only one feature, whereas I want each polygon to be a feature).
Please let me know if you have suggestions for converting the multipolygon into a feature collection where each buffer is its own feature. Or if you have an alternative suggestion for dissolving polygons within a feature collection and returning a feature collection where each polygon is its own feature.
Code here.


texts:
I'm running a loop that create feature classes at a geodatabase. After creating 221 datasets I get the error message "pyscripter out of memory". Is there a way to clear the physical memory of computer in order to resume with the script ? I've alredy tried :

  gc.enable
  clear = lambda: os.system('cls')
  clear()
  gc.collect()


texts: Creating Centroid Long and Lat points for each Kernel Density cell

texts:
I am trying to create a point raster file of the highest (red) kernel densities (figure 1), which places one GPS location at the centre of each of the cells within the highest kernel density bins.

I have tried to merge my kernel into a mosaic raster but this loses data and is continuous, which for further analysis in maxent I need discreet values.

I have also tried converting the kernel plots to point raster but this creates the entire extent of my study site and not my highest kernel bin, as suggested in http://www.researchgate.net/post/Is_there_any_way_in_ArcGIS_to_calculate_the_Latitude_and_Longitude_of_each_pixel.

Are there any tools i have overlooked which address this?

Forgive me if they are obvious. ARC GIS 10.1

.


texts:
I'm trying to string together a field calculator script that will populate all the records of a field at once based upon values in a number of fields.  I can't even get the first part of the command to work and can't figure out how to get all the other conditions to fit in.

Here's a simplified version:

NewFIELD: the field I would like to update

Fields = COVER1 and COVER2 (values are three letter codes) and LANDUSE (Values are WET, FOR, COM, RES...).  There are other fields I'll be selecting on but for an initial example this should do.
    One complication is that there is some overlap between results depending upon how one selects the records.  So one record (polygon) could fall into two Forest/Landcover groups (selected first by species composition and secondly by LANDUSE) but I may want to update this new field with only the first Forest class.  So I need to do the selections sequentially and explicitly exlude records that have already been defined.

IF [COVER1] = "WWW" OR [COVER1] = "OWW" OR [COVER1] = "SFW" OR [COVER1] = "WAT" THEN
  F2 = "Wetland"
ELSE IF ([COVER2] = "WS" OR [COVER2] = "BF" OR [COVER2] = "CE" OR [COVER2] = "LA") AND
[DRAINTYPE] ="IMPERFECT" OR [DRAINTYPE] ="POOR") AND [NewFIELD] <> "Wetland"
  F2 = "Forest1"

The first statement updates NewFIELD with "Wetland" for all those records to which it applies.  The second statement will apply to some of those that were selected in the first statement but I want them to remain as "Wetland"

As mentioned, I can't even get a simple statement to work so I suspect my initial syntax is horribly wrong.

My first try looks like this and didn't work:

dim f2
if [COVER1] = "SDW" OR [COVER1] ="BSB" then
  f2 = "Beach"
end if

So, any thoughts on how I would approach this?  I can do it by selecting all applicable records using Select by Attributes and then updating NewFIELD (doing this 9 or ten times) but it'd be nice to do this all at once.  And I'm not familiar with Python so don't know where to start with that.  But I'd be interested in trying it.

Looking at this thread (If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?) it looks like I may be able to use the SQL IN function but I'm still unclear about it.


texts: Creating a horizontal legend with labels in GeoServer

texts:
Im am trying to ask GeoServer for a horizontally orientated colorbar legend for my raster layer. I prepared an SLD style for the layer and asked for the legend with the GetLegendGraphic method, including: legend_options=layout:horizontal in the request.
The result is indeed a horizontal legend, but with its labels rotated and above the color bar.
What I am after is just a horizontal color bar with the labels beneath it.
What am I missing?

My server request is:
http://localhost:8090/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=50&HEIGHT=30&LAYER=Sacstests:S5P_NRTI_L2__NO2____20190401_latlon_0.500000&legend_options=layout:horizontal

The results (with and without the horizontal option) are included below. As you can see, the whole legend has rotated, including the labels, wereas I would like the labels to stay upright, and be placed below the colorbar.


texts: "Easy Custom Labeling" arrows: How do I get them?

texts:
I have installed the Easy Custom Labeling plugin, but haven't figured out how to make the "Generate lines" function work. When I click on the tool in the toolbar, it opens the dialogue to specify my CRS. Ok, that's done. So having moved a label that was too crowded, how do I make the connector line?

(I'm running QGIS 1.8)


texts: ArcMap, Editor and Geodatabase API edit session question

texts:
Say a feature class from a File GDB is added to ArcMap and an editing session on it is in progress. What happens if an add-in launched from the same ArcMap session tries to start an edit session using IWorkSpaceEdit on the same feature class?

What if the feature class is in ArcSDE and versioned?

Tested on File GDB. Nothing happened, no crash. The note on IWorkspaceEdit.StartEditing does say "StartEditing cannot be called when a edit session is already active" - it appeared it can?

The note also says "With non-versioned editing always be sure to check the current edit state via IsBeingEdited before called StartEditing or StopEditing.  If the workspace is being edited outside your context, there is no need to call StartEditing" - I'm confused.


texts: Difference between projection and datum?

texts: What's the difference between a projection and a datum?


texts: Calculate Landsat 7 NDVI time series and get the maximum NDVI value and correspond image using Google Earth Engine?

texts:
I want to to calculate NDVI time series from 2015 to 2018 using Landsat 7 and get the maximum NAVI value in this period and it's corresponding image index. That is, the horizontal and vertical axes value of this picture, I want to get the Image index in Google Earth Engine, not the time.

code

var landsat7_SR = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR")
                    .filterBounds(geometry);
var ndvi_list = landsat7_SR.filterDate("1999-01-01", "2018-04-30")
               .map(function(image) {
                 var ndvi=image.expression('float(b("B4") - b("B3")) / (b("B4") + b("B3"))').rename('ndvi');
                 return image.addBands(ndvi);
                });


texts:
How to enable log message in QGIS? debug mode or verbose mode.

I put variable in my env but without success.

More informations to complete this question:

I would like to see messages of detail the transaction between QGIS and database. I'm another problem with QGIS see my another post my idea is discovery more informations to understand the cause of this problem. To me is important enable debug mode in QGIS or enable high level logs.


texts: Embed Google Fusion Table Map without setting it as public

texts:
I would like to make use of Google Fusion Tables and Maps to visualize sales data. The map will eventually be embedded into a webpage so that senior management can access it for decision making purposes as well as company performance evaluation.

The problem is this: The data is sensitive and can not be opened up to public view.

The question is: Is there a way in which a map can be created and embedded without publishing the map to the public?


texts:
Using gdal I want to resample (in this case, oversample) a DEM. The only thing that should change is the pixel spacing, so I want to interpolate in between the values that I currently have. For this I have the current function:

def resample_DEM_and_image(DEM,new_posting):
    """
    This function reprojects a gtiff
    to a new posting

    Parameters
    ----------
    DEM : osgeo.gdal.Dataset
    The geotiff to project
    new_posting : iterable
    The desired new pixel spacing
    """
    from osgeo import gdal, osr
    geo_t = DEM.GetGeoTransform()

    x_size = DEM.RasterXSize * _np.int(_np.abs(geo_t[1]/new_posting[0])) # Raster xsize
    y_size = DEM.RasterYSize * _np.int(_np.abs(geo_t[5]/new_posting[1]))# Raster ysize

    #Compute new geotransform
    new_geo = ( geo_t[0], new_posting[0], geo_t[2], \
            geo_t[3], geo_t[4], new_posting[1] )
    mem_drv = gdal.GetDriverByName( 'MEM' )
    dest = mem_drv.Create('', x_size, y_size, DEM.RasterCount,1,gdal.GDT_Float32)
    dest.SetGeoTransform(new_geo)
    dest.SetProjection(DEM.GetProjection())
    res = gdal.ReprojectImage( DEM, dest, \
            DEM.GetProjection(), DEM.GetProjection(), \
            gdal.GRA_Bilinear )
    return dest

then I was planning to read the gdal dataset that I get in dest using dest.ReadAsArray(). However all I get is values of 0 in an array that does have the correct shape (i.e. n times the size of the initial DEM, where n is the oversampling factor)

what am I doing wrong?


texts:
I've got a script wherein I'd like to toggle (gray out) certain fields, unless a file has been specified.

In the above image, I'd like Field A, B, and C to only be editable once a file has been selected in Input Worksheet. In updateParameters I've done the following, which doesn't seem to work:

  def updateParameters(self):
    if self.params[0].value:
        self.params[1].enabled == True
        self.params[2].enabled == True
        self.params[3].enabled == True
    else:
        self.params[1].enabled == False
        self.params[2].enabled == False
        self.params[3].enabled == False

I've tried using altered as well, nothing seems to work the way I'd like it to.


texts: Why does polygon area change when projection is changed in ArcGIS Desktop?

texts:
I have a simple polygon in a given coordinate system (example see below) as a feature in a FGDB. I would like to re-project the polygon to ETRS 1989 LAEA (EPSG 3035) using the project tool (data management tools - projection and transformations).

So far this works fine, but looking at the output I stumble over two things I cannot explain.

The area of the polygon changes (e.g. from  16'000'000 m2 to 15'999'517 m2).
When adding the "old" polygon with the initial projection (on the fly projection) and the reprojected "new" polygon (epsg 3035) into the same data frame (set for epsg 3035) the two polygons are slightly set apart (see image)

My interpretation of these two observations is that the size as well as the location of the polygon was altered during the projection to EPSG 3035.

Does anybody know why this happens and how to avoid that?

Example for initial coordinate system:

Germany_Zone_4
WKID: 31494 Authority: Esri

Projection: Transverse_Mercator
False_Easting: 4500000,0
False_Northing: 0,0
Central_Meridian: 12,0
Scale_Factor: 1,0
Latitude_Of_Origin: 0,0
Linear Unit: Meter (1,0)

Geographic Coordinate System: GCS_Deutsches_Hauptdreiecksnetz
Angular Unit: Degree (0,0174532925199433)
Prime Meridian: Greenwich (0,0)
Datum: D_Deutsches_Hauptdreiecksnetz
  Spheroid: Bessel_1841
    Semimajor Axis: 6377397,155
    Semiminor Axis: 6356078,962818189
    Inverse Flattening: 299,1528128


texts: Edit raster values above 100 in Euclidean distance

texts:
I have a dataset I have Euclidean Distance'ized. I need to use this dataset in Machine Learning as a way to tell the AI what values have larger influence on an event than others. When we move further away than 100 meters we assume that we no longer affect the probability of said event happening.
So, what I need to be able to do, is to edit all values above 100 m, so that all values above 100 m, get the value 100 m, as these don't affect the area lesser and lesser but the same as at 100 m?
I'm using ArcMap 10.8 but I don't think the version matters that much.