texts: G_Malloc error for Grass module(r.stream.extract) in R

texts:
I am having a big issue of this G_malloc Error while using a module of Grass (6.4.4) (r.stream.extract) in R. Initially I thought my computers configuration was low, So I switched to 8gb Ram 64-bit Windows 10. And I found error occurring again.
I tried setting the g.region to the current using DEM with the following function.

"execGRASS("g.region",flags= "a", parameters=list(rast="DEM")"

The error function is:

  "execGRASS("r.stream.extract", flags="overwrite",
    parameters=list(elevation="DEM", accumulation="Accumulation",
    threshold=round(AT_mean[[i]], digit=0), mexp=0.01,
    stream_rast="Stream_Comparison"))"

and the error is as follows:

"Current region rows: 8129, cols: 10704
ERROR: G_malloc: unable to allocate 696102528 bytes of memory at main.c:259
Warning message:
running command 'r.stream.extract.exe --overwrite elevation=DEM accumulation=Accumulation threshold=6 mexp=0.01 stream_rast=Stream_Comparison' had status 1"

I tried solving it in many ways such as, allocating memory using memory.limit(), setting up the computational region and also dividing the DEM into half. But nothing was successful.


texts: Why are multipart features not allowed in Geometric Networks?

texts: I'm beginning to familiarize myself with Geometric Networks in ArcGIS Desktop, and according to About Verify Network tools and commands, multi-part features are not allowed, but they do not explain why. What is it about multipart features that breaks a geometric network?


texts:
I have three files. The first is a shapefile for country boundaries and the second and third are raster files with the global land covers for 2005 and 2009. I'm thus charged to calculate the areas for the different land uses in 5 countries in 2005 and 2009. The CRS for all files is World Mollweide EPSG:54009.

First, I selected the countries (one by one) that I wanted to deal with and I stored them as shapefiles... Afterwards, I clipped the two raster files using as mask each one of the five countries that I previously stored as shapefiles. I calculated then the areas for each one of the generated rasters (using r.report). So, my issue came out.

The problem is that the total area for each country in 2005 is not the same as the area for the respective country in 2009 (there are some differences like 100 square kilometres for some countries). I guess the problem started when clipped because some countries got more cells (I notice that when I zoom in and look at the borders of the generated rasters)...

So my question is, using QGIS, which other option could I use to calculate the areas more accurately? I tried to reproject, with the number of counts per value... but the differences are still too big...


texts: Looking for an API that will autocomplete adresses, and split them up into parts

texts:
I'm kinda new to the whole GIS thing, and found that is necessary for onw of my web apps. It's come to my attention that some people don't know what a proper physical address looks like, and so I'd like to make life a little easier.

I have an app that requests a person's physical address. Instead of typing in the full thing, I'd like to use an autocomplete service. I'm in South Africa, so AfriGIS seems to be the best bet. However, I can't seem to find a service that will autocomplete an address for me, and split that same address (result) into it's parts. For example, in JSON:

{
    'address': {
        'streetNumber': 12,
        'streetName': 'Main Street',
        'suburbTown': 'Kensington',
        'city': 'Johannesburg',
        'province': 'Gauteng'
        'streetCode': '2094',
        <etc>
    }
}

Are there any services that support this functionality (for South Africa, of course)?

Update:

This is very close to what I'm looking for: https://google-developers.appspot.com/maps/documentation/javascript/examples/full/places-autocomplete-addressform

However, it is not very accurate in terms of complete addresses. In the above case, Google will not return the suburb. In South Africa, suburbs are areas, and not city outskirts. Also, the Zip codes it returns are wrong.


texts:
I wish to implement this formula from Wikipedia to convert LLA to ECEF
coordinates:

where

and a and b are the semi-major and semi-minor axes respectively.

My question is: what units will this work with? This paper says the equation is in meters. I am wondering if it can be more general than that. Can I use any unit of distance so long as I am consistent?


texts:
I have a multiline label made of 3 attributes made through an expression like:

"Length"  || '/' ||  "Level"  || '/' || '→ ' || "Bearing"  || ' ←'

I'd like to make the Length and Level lines in bold while maintaining the bearing in a normal style. You can expand this question in a more general sense, because I could use some different styles (font size etc) for the different attributes.
Is there a way to achieve this?

EDIT: i read about similar questions, but i didnt come up with any solution OR workaround. Im asking if anyone has come up with any yet lately.


texts: Getting EPSG code in pyproj with version==2.1.3?

texts:
I'm using pyproj in python and I want to get epsg code based on an existing Proj class. An example in version=1.9.6:

from pyproj import Proj
CGCS2000metre = Proj(init='EPSG:4544')
print(CGCS2000metre.srs)

# +units=m +init=epsg:4544

As you can see, I can find epsg code 4544 in the return result. But I can't do it in version==2.1.3:

from pyproj import Proj
CGCS2000metre = Proj(init='EPSG:4544')
print(CGCS2000metre.srs)

# +proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs

I just want to get epsg code from an existing Proj.

How can I get epsg code in pyproj with version==2.1.3?


texts: Change of latitude and longitude when rotating around an Euler pole

texts:
Suppose we have a point P on the surface of the Earth characterized by its latitude and longitude. There is an Euler pole given together with an angle of rotation around the axis associated with this Euler pole.
How do I calculate the change in latitude and longitude of P that results from this rotation? I would like to avoid converting to geocentric coordinates to avoid numerical errors due to conversions.


texts: Creating a for loop to publish multiple CSVs as feature services?

texts:
I have multiple CSVs that I want to publish them each as unique feature services. Instead of publishing them one at a time, I'm trying to find the correct syntax to create a for loop.

This is the notation I (successfully) used to publish a single layer:

from arcgis.gis import GIS
from arcgis.geocoding import geocode
gis = GIS("http://slustl.maps.arcgis.com/home", "*username*")
import pandas as pd

df = pd.read_csv("thunder_d.csv")
df.head()
csv_file = r'C:\Users\Stephanie\NOTEBOOKS\thunder_d.csv'
csv_item = gis.content.add({}, csv_file)
csv_lyr = csv_item.publish(None, {"Address":"ToLocation"})

And this is the start of my attempt to publish multiple using a loop:

from arcgis.gis import GIS
import os
from arcgis.features.analysis import *
from arcgis.features import FeatureLayer

gis = GIS("http://slustl.maps.arcgis.com/home", "*username*")
data_dir = r"C:\Users\Stephanie\NOTEBOOKS\FINAL\csvs"
file_list = os.listdir(data_dir)

csv_file_list = [x for x in file_list if x.endswith(".csv")]
print("Number of .csv files found: " + str(len(csv_file_list)))
for file in csv_file_list:

I'm new to coding so creating loops still can confuse me.

Once I publish the CSVs, could I also create a loop to edit their symbology, or do I have to do that one layer at a time?


texts: How to plot latitude and longitude stored in database on ArcGIS map

texts:
I am new to ArcGIS and I have tried basic things like I created a csv file with latitude,longitude and place as data in it.
I imported that file as a layer when I created a web map in ArcGIS.

This showed me all the places and plotted it on my map. It shows something like this.

I am building a website using asp.net MVC and jQuery which will show a map on page, and I want to show data something like in the image on my web page.

What I have to do is to link my database to this map. That is, when the table in database gets new values it should automatically plot it on the map.
I also know about services provided by ArcGIS.

Can I use those services and pass my data to them through jQuery? If yes, can you please let me know how to do it?

I researched a lot on how to pass my data to map but I couldn't find any solution. But I found some topics which I thought would be required to make it happen.

Topics like ArcGIS web servers for services which is server for services.
But to host a service I will have to create a service and I couldn't find any topic on how to create your own service.

I also found out that there is ArcGIS for desktop. Do I have to install it to create services?

I think I am going in a wrong direction. Can you guys please help me with right direction.


texts: Is newer better? - should I replace my 2008 model Garmin GPS60 handheld GPS?

texts:
I use my mid-price Garmin GPS60 handheld GPS device to record waypoints for vegetation surveys and other field surveys, often under tree cover.

In asking 'should I replace my old unit', I should say that I don't really care about colour screens, backdrop display maps or any other enhancements. I just want good waypoints.

Would a newer mid-price handheld GPS do an appreciably better job of getting satellite fixes and getting better positional accuracy than my 7 year old unit?

Is the basic technology now better in some way, or is it much the same as it was 7 years ago?


texts: C++ OGR GDAL Set spatial reference of new layer

texts:
When creating a new layer using OGR / GDAL in C++, how do i set the spatial reference?

OGRLayer  *poLayer2;
poLayer2 = poDS2->CreateLayer( "layerName", NULL, wkbPoint, NULL );
if( poLayer2 == NULL ) {
    printf( "Layer creation failed PODS2.\n" );
    exit( 1 );
}


texts: How can I calculate the bearing between two points in PostGIS?

texts:
How can I find the bearing between two points in PostGIS?

Please specify in your answer whether or not the method producing a bearing on the spheroid, or a planar bearing.


texts: Setting color info without defining new instance of renderer

texts:
I have an esri map with five feature layers. Each also has an id, and it is used in a toggle layer function to update layer visibility in the map. For most layers, I just need to set one static color for all features. I do so as follows:

var normalLayer = new FeatureLayer(url,{stuff});
normalLayer.on('load',function(){
  normalLayer.renderer.setColorInfo({
    field: 'field',
    colors: ['#ffffff']
  });
  normalLayer.renderer.setOpacityInfo({
    opacityValues: [0.50]
  });
});

For two of the five layers, I'm trying to set a color ramp. I'm using these instructions. Here is my code:

var colorRampLayer = new FeatureLayer(url,{stuff});
colorRampLayer.on('load',function(){
  colorRampLayer.renderer.setColorInfo({
    field: 'field',
    colors: ['#ffffff','#002a5c'],
    minDataValue: 0,
    maxDataValue: 15.51
  });
  colorRampLayer.renderer.setOpacityInfo({
    opacityValues: [0.50]
  });
});

What I'm expecting is for a color ramp to be generated  for this feature layer, starting at white (#ffffff) and ending at dark blue (#002a5c). But what happens is everything comes in as the same color. I also tried defining stops per the API reference linked above. These however don't seem to allow for a range of values to be represented by stops. For example if I define the stops as 1,2,3,4,5 only polygons with exactly the values 1,2,3,4,5 get colors and everything else is blank.


texts: Problem: QGIS-Plugin that involves setting a shortcut, does not work when run a 2nd time

texts:
I am trying to build a Qgis plugin which involves setting shortcuts to perform some function on the selected layer in the plugin.
When I use my plugin for the first time, everything works as expected.
The problem appears when starting the plugin again to change the layer.
Nothing works, also when selecting the same layer again.

To help me debugging my problem I wrote a small example script:

active_layer = iface.activeLayer()

def current_layer():
   print('active_layer: '+ str(active_layer))

shortcut = QShortcut(QKeySequence(Qt.Key_Space), iface.mapCanvas())
shortcut.setContext(Qt.ApplicationShortcut)
shortcut.activated.connect(current_layer)

When I just run the first line, I can change the 'active_layer' I print when pressing space_bar.
But when I run this entire script again, it's not working anymore.
So it has to be smth. with the shortcut being defined again.

I tried shortcut.activated.disconnect(current_layer) and running the script again, with not much success.

Any Idea what  I would need to add/change to make this script work when I run it again?


texts: Understanding why buffers not circular in QGIS?

texts:
I would like to select areas under a particular circular radius in QGIS. I believe this is accomplished with the buffer tool, but when I specify the radius the area is not circular.

How to make them circular?


texts: Identify polygon grid in which the point belongs to?

texts:
I have a dataframe with 3 columns , which has my custom lat / long with a failure rate associated with each Lat / long

head(df)

        Latitude        Longitude Failure.rate
         51.3           -0.108             0
         51.3           -0.109             0
         51.3           -0.121             0
         51.3            0.0632            1
         51.3            0.0312            0
         51.3           -0.126             0

I have a Polygon shape file which consist of grids over a region. I want to combine both the shape file and point file in R to be able to identify which points + failure rate is associated with which grid and create a shp file as a result to be plotted in any visualisation tool

I tried both over and poly function in R, But i get an empty file filled with NA's . Please find the polygon shape file here

sample aggregated csv ( point files )
I believe it is to do with the different projections used in both point and polygon file , Can someone help me to fix the same.
Please find the script below

require(sp)
require(rgdal)
require(maps)
require(spatialEco)

#Read the points coordinates from the CSV file into a dataframe and convert it to SpatialPointsDataFrame
ID <- read.csv("df_custom_long_lat.csv")

# Coerce into SpatialPointsDataframe from the data-frame
coordinates(ID) <- c("Longitude", "Latitude")

#read in the spatial polygon shape file from current directory
#LGA <- readOGR(".", "grid_shape_file")

#have a sneak peak of what is loaded in the data , Uses a different geocode since the co-ordinates are not interpretable in relation to points df
test_LGA <-as.data.frame(LGA@data)

#Assign Similar Projection's -- Not sure which projections are being assigned
proj4string(ID) <- proj4string(LGA)
#proj4string(ID) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
#proj4string(ID) # to check projections

#Find the point in the polygon
#over(points , polygon )  # Over = at the spatial locations of object x,
# retrieves the indexes or attributes from spatial object y

inside.LGA <- !is.na(over(ID, as(LGA, "SpatialPolygons")))
ID$LGA <- over(ID, LGA)$LGA

write.csv(ID, "ID.csv", row.names=FALSE)
writeOGR(ID, ".", "ID", driver="ESRI Shapefile")

############################################
# Using alternate function to over (sp)
#Spatial Eco Package point in polygon , The crs layer should be similar for both points an polygons

test_a <- point.in.poly(ID,LGA,sp = TRUE , duplicate = TRUE)
test_a1 <-as.data.frame(test_a@data)
head(test_a1) # all NA's, failed to assosiate polygons to point dataframes
summary(test_a1) # Index is null


texts: Cartographic-complete Maps in PDF On Request using Open Source?

texts:
Currently I have some data in PostGIS. I want to implement the following: users will make a request via web, with parameters like location, scale, layers to be displayed, etc. and I need to provide them with maps in PDF format. The layout of these maps will contain the map itself as well as common cartographic elements like scale bar, north symbol, legend, date, title, etc.

I was looking to Mapnik to render the PDFs. The problem then is how to render the layout (dynamic, since the layers, scale, date...will vary).

What open-source package with Python bindings (or other solution) would you recommend for doing this (I'm looking at QGIS right now)?

I am looking for an alternative to the Esri arcpy.mapping module.


texts: GIS Software Choice for a small university research centre

texts:
I need to choose a GIS system for a small university research centre. We are handling a broad range of data, (for example, numerical tidal analyses, weather data, poverty, isolated economic activity, skills availability and renewable energy resource availability) and operate primarily in countries with relatively poor existing data sets.

We interact with other groups, some of which use ARCGIS. Do I have to wade through every GIS software descriptor on the web, or can someone please give an indication of likely candidates?


texts: Delete Records from Feature Layer using ArcGIS API for JavaScript?

texts:
I am trying to delete some records from a feature layer, but I kept getting the error of invalid parameters from the errback.

Below is my code:

function deleteRecords()
{
var incidentId = 2;
var queryTaskDeleteRecords= new esri.tasks.QueryTask(FEATURE_SERVER+"/"+LAYER_V_RECORDS);
var queryDeleteRecords = new esri.tasks.Query();
queryDeleteRecords.outSpatialReference = map.spatialReference;
queryDeleteRecords.returnGeometry = true;
queryDeleteRecords.outFields = ["*"];
queryDeleteRecords.where = FIELD_V_RECORDS_INCIDENTID + " = " + incidentId ;
queryTaskDeleteRecords.execute(queryValveRec,deleteRecordsResults);

}

function deleteRecordsResults(results)
{

    var featureLayer= new esri.layers.FeatureLayer( FEATURE_SERVER+"/"+LAYER_V_RECORDS,{
        outFields:["*"]
    });

    for (var i = 0; i < results.features.length; i++)
    {

    featureLayer.applyEdits(null, null, [results.features[i]], function onComplete(adds, updates, deletes)
    {
         if (deletes.length > 0)
         {
            alert("deletes : " + JSON.stringify(deletes));
         }
    },
    function errCallback(err)
    {
        alert(err);
    });

    }

}

Is there sometime wrong with the querying of features and passing the features in one by one to applyEdits for deleting?


texts: Getting an error when trying to add buttons to toolbar

texts:
recently I tried to add some geoprocessing tools as buttons to my toolbar as I use them quite often.

I found ou that there is the option to add buttons to tool bar under processing/options, but when I tick the box I get an error that says:

'Specified path does not exist'
C:/PROGRA`1/QGISLY1/apps\saga

I think there is an old reference to qgis Lyon (I'm using 2.18.3) and a typo with the '/'\'. Is there a workaround?


texts:
I'm new working with cartoDB and I'm trying to show the hour and the date in a torque slider but doesn't work properly and show mm/dd/yyyy instead of mm-dd hh:mm.

Using:

"http://libs.cartocdn.com/cartodb.js/v3/3.14/cartodb.js" script
"http://libs.cartocdn.com/cartodb.js/v3/3.14/themes/css/cartodb.css" stylesheet

I'm using the following code:

function main() {
   cartodb.createVis('map', 'viz.json', {
        shareable: true,
        title: true,
        description: true,
        search: false,
        tiles_loader: true,
        center_lat: 0,
        center_lon: 0,
        zoom: 10,
        time_slider: true,
    })
    .done(function(vis, layers) {
      var slider = vis.getOverlay('time_slider')
      slider.formatter(function(d) {
        return  d.getUTCMonth()+"-"+ d.getUTCDay() + " "+ d.getUTCHours() + ":"+ d.getUTCMinutes();
      })
    })
    .error(function(err) {
      console.log(err);
    });
  }
  window.onload = main;

How can I fix it?


texts: Calculating zonal statistics as table for all attributes (columns) in raster using ArcGIS Desktop

texts:
I have a raster that has multiple columns in the attribute table that I can symbolize. I would like to calculate zonal statistics as a table for each of the columns in the raster attribute table individually.
How do I do this?
Here is an example of the raster attribute table.

OID
Value
Count
slodegradd
aws025wta

0
538236
7729
0.5
0.3

1
538237
21
0.4
0.2

2
538239
82
0.5
0.3


texts: Formula for the great circle arc between two points (lng/lat coordinates)

texts:
I am trying to animate a point moving from one location to another on a map. And I would like the point to travel along the great circle arc between the locations, rather than in a straight line.

Given the starting coordinates (lng/lat) and the ending coordinates, is there a formula for interpolating along the great circle arc to get the point's coordinates at each step in its route.

I need to run this calculation on the fly (in a WebGL shader), so I can't use PostGIS or a GIS application. It needs to be a formula or algorithm.


texts:
I have a problem drawing an ellipse in PostGIS and 4326 system.

My parameters are:

"geography" : {"type":"Ellipse",
                    "smallSide":100,
                    "bigSide" : 110,
                    "rotation" : 0,
                    "coordinates":[8.54736328125,46.37156925087649]}

Searching on web (stack overflow) I came up to a solution that is close to my request but I have some problem with Scale and Translate.

ST_AsEWKT(ST_Translate( ST_Rotate( ST_Scale( ST_Buffer(ST_Point(8.54736328125,46.37156925087649)::geography, 3000)::geometry, 0.3,0.5)::geometry, 0), 8.54736328125,46.37156925087649))

The center is set in Switzerland.

This function has 2 big problem:
1. The Ellipse is not centered in the original coords;
2. I don't know how to convert xFactor/yFactor of Scale to match meters parameters;

I've tried to split the function to check where the problem starts:

If you stop to the circle, it works perfecly:

ST_Buffer(ST_Point(8.54736328125,46.37156925087649)::geography, 3000)::geometry

Than there is the ST_SCALE. This function will shrink the circle to create an ellipse.

It accepts a geometry and a couple of "factor" (xFactor and yFactor).

If you launch it with 1,1, you get the same circle.

select ST_AsEWKT( ST_Scale( ST_Buffer(ST_Point(8.54736328125,46.37156925087649)::geography, 3000)::geometry, 1,1)::geometry);

If you change the "factors" (for example 0,3 and 0.5), you get an ellipse but its completely translated (in Niger, Africa).

The original function has a translate after the scale to move back the shape to the original point. I don't know why but using original center coords, I get an Ellipse in Sweden:

select ST_AsEWKT(ST_Translate( ST_Rotate( ST_Scale( ST_Buffer(ST_Point(8.54736328125,46.37156925087649)::geography, 3000)::geometry, 0.5,0.3)::geometry, 0), 8.54736328125,46.37156925087649));

I think is a problem about projection and Referring System (the ellipse in sweden is cleary smaller) but im too noobs to understand where to fix.


texts: Count pixels of different bands in MODIS

texts:
I need some help with my script in GEE.  I’m working with a MODIS Terra Vegetation Continuous Fields Yearly (MOD44B.051 Terra Vegetation Continuous Fields Yearly Global 250m) and I’m trying to obtain the number of pixels of three bands (Percent Non vegetated, percent vegetated, percent tree cover) at municipal level (2, 458 units).

So far my script runs until it count the total of pixels inside the municipality, and its ok, but I need to know of the total of pixels (inside the municipality) how many belongs to non-vegetated, vegetated and tree cover. Below it’s my script

//Counting pixels per municipalities //

//Map of municipalities done in ArcGIS//

var Mun= ee.FeatureCollection ('users/ceciliasosaa/MUN_FINAL')
Map.addLayer (Mun)

//Load MODIS. Specify year and band of interest//
var NV2000= ee.Image ('MODIS/051/MOD44B/2000_03_05'). select ('Percent_NonVegetated')
Map.addLayer (NV2000)

// Center locality//
Map.setCenter (-100.55, 21.37); //Mexico

// Counting pixels in municipalities //
var MunNV = NV2000.reduceRegions({
  collection: Mun,
  reducer: ee.Reducer.count(),
  scale: 250
});

print(MunNV);

What I’m missing in my script?


texts:
I am a QGIS 2 user and trying to use vertex tool in QGIS 3.
I noticed that there is a feature for QGIS3:
https://qgis.org/en/site/forusers/visualchangelog30/index.html#feature-range-vertex-selection-in-node-tool.
The diagram interested me, how convenient it is! This means that I can move a inner filled ring of a polygon.
for example, (from A to B)

Anyway, I use vertex tool awkwardly, I tried the Shift+R key but I can't make any solid blue selection,

My selections shown in the picture, are blue hollow circles.
How to make a blue solid selection?


texts: How to specify fields to export from QGIS?

texts:
I'm using QGIS 2.0.1 and am connected to a MS SQL Server spatially enabled database (not ESRI).  I am able to connect to the layer and load it into my TOC just fine.  I have hidden a number of fields that are not important for visibility sake.

Now I want to export that data to another data type (we'll use shapefile for this example).  When I right-click the layer, choose "Save As" and define the output file, I get the following error:

  Export to vector file failed. Error: unsupported type for field GlobalID

Note 1: If I check "Skip attribute creation" in the dialog box, the shapefile is created with no errors.

Note 2: ArcGIS does not have this problem, it just converts the GUID field to "TEXT" type.

Looking at the table, one of the fields that I have hidden is a GUID of SQL type <uniqueidentifier>, which is in all likelyhood the culprit.  In an attempt to resolve this, I made the field "hidden".  I would have assumed that because the field was hidden, QGIS would not try to export this field, but that turned out to not be the case.

Can you define the fields you want to export from QGIS?

Is it possible for QGIS to export just the "Visible" fields?  Or is there another alternative way of doing this from QGIS (maybe define the fields via an ogr2ogr query)?  This seems like a shortcoming of QGIS if I cannot define which fields to export.

UPDATE: I did a test using a sample shapefile to see if I could limit the output fields.  The following ogr2ogr command line worked and eliminated all fields except for "name":

ogr2ogr -f "ESRI Shapefile" test.shp city.shp -sql "select name from city"

but using QGIS and adding:

-sql "select name from city"

to the "layer" section of the "Save As" dialog did not result in a shapefile with just the single field.  So I don't really see how I can manipulate the file output to show just a select few fields.  Any help is appreciated.


texts: How to access vector coordinates in GRASS GIS from python?

texts:
Is there a way to iterate over lines and their vertices using python? I'm new to GRASS GIS, and it looks like there are ways to read raster (for numpy), but I don't see a direct way to access coordinates and topology for vectors.

I know that I can access binary data but it does not seem right. I can convert vector feature to db for later use with vector_db_select but it is an extra operation for conversion and I have no data what was what (how can I walk a graph?).

Also when I try to run v.to.db like

v.to.db map=merged_single@PERMANENT layer=1 option=coor units=meters columns=cat

I'm getting

This option requires at least two columns
Finished with error

For instance in ArcGIS I can easily iterate over elements using SearchCursor. I wonder if there is anything similar in GRASS GIS?

Update 2012-06-24

After reading GRASS GIS manual, it looks like one has to use C library and functions prefixed with Vect_.

Another possible choice probably is to use OGR as it somewhat supports GRASS GIS, but its python bindings are not perfect. It all seems a bit awkward as QGIS so nicely works with all formats from GUI so the inability to access all that from python (which is the official scripting language) seems like a huge shortcoming unless I missed something. Perhaps it will be better in the future.


texts: Does osm2po find routes of alternating modes e.g. car, ferry, car

texts:
I loaded europe-latest.pbf into osm2po using the default osm2po.config and

java -Xmx8g -jar ../osm2po-4.6.9/osm2po-core-4.6.9-signed.jar prefix=eu tileSize=x,c ../europe-latest.osm.pbf

and looked at car routes that must use ferries, e.g. Dover to Calais or between Athens and the greek Islands etc.

osm2po doesn't find any route.

Does any else observe this, too?

How should I proceed to make osm2po also find these kinds of routes?

Thanks.


texts: Extract population count from GeoTIFF based on mask layer

texts:
I downloaded Population Count data from Gridded Population of the World (GPW), v4 as a *.GeoTIFF file. In a next step, I would like to extract the population count of a given area based on a mask layer (e.g. the political boundaries of Portugal imported from a *.geojson).

I came across an answer on StackExchange, which I believe is trying to achieve a similar result. However, I could not reproduce it due to NotImplementedError: multi-dimensional sub-views are not implemented and I suspect the solution would be overengineered for me.

When I open the *.GeoTIFF file in QGIS and display the layer properties, I see the following information (I suppose, I am interested in the STATISTICS_MEAN):

The files are avialble for download here (only for seven days or 100 downloads though):

GeoTIFF: https://send.firefox.com/download/a4be075f0dda3acb/#UlUv5RDx8i3XXvV4dQHtEA
Geojson: https://send.firefox.com/download/54d3458a17ca355a/#DM8M3hGOfcoIDOVeKcMZJA


texts: Function to determine font color of data driven page attribute in ArcMap 10.2

texts:
ArcGIS 10.2

I am looking for an IF/ELSE statement that I can place in the text properties of my Data Driven Page Attribute item to change the font color based on the value in that field.  Here is the function I have been trying.  Its a variation on a function for basic map label.  I can't get this function to work w/ dynamic text.

Function FindLabel<dyn type="page" property="attribute" field="RP_Slope" domainlookup="true"/> > 2 then
    FindLabel = <CLR red='255'><dyn type="page" property="attribute" field="RP_Slope" domainlookup="true"/></CLR>
else
    FindLabel = <dyn type="page" property="attribute" field="RP_Slope" domainlookup="true"/>
end if
End Function


texts: Custom SVG does not work in my Qfield project

texts: When I open my project in Qfield, all SVG symbols are relocated by a question mark. Here is the path of my installation in my Tablet ..... \ Tablet \ Android \ data \ ch.opengis.qfield \ files \ share. Android 5.1.1 - Tablet A6.


texts: ListDatasets() returning empty array on sde workspace

texts:
I am trying to get list of datasets within sde connection.This sde connection is already present in ArcMap and all datasets are visible. I am posting snapshot my code. It is returning empty array,though there are clearly many datasets available. What is the problem with my code?

import arcpy

arcpy.env.workspace = "C:\Users\Vijay\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\xxx.sde"
featureDatasets = arcpy.ListDatasets()
print featureDatasets
for fc in featureDatasets:
    try:
        print fc
    except Exception as e:
        print e


texts:
I would like to add to my leaflet's web map layer from my WMS service (Geoserver), but I need to use CQL filter in GetMap link:

  localhost/geoserver/my_location/wms?(...)&CQL_FILTER=[...]

Is it possible? Please, help ;)

edit:

var heatmap = L.tileLayer.wms('http://my_wms_adress:8080/geoserver/my_location/wms?service=WMS&version=1.1.0&request=GetMap&layers=my_location:my_location_history&styles=&bbox=54.406021,18.531216,54.497708,18.577851&width=768&height=390&srs=EPSG:4326&format=application/openlayers&CQL_FILTER=user_id=1', {layers: 'my_location_history', format: 'image/png',transparent: true})

As you can see I added all parameters, but IMHO it's wrong, but I am not sure how to do it. Can I skip parameters like bbox, width, height and add only CQL_FILTER?


texts: 'gdalwarp' is not recognized in Python3.6

texts: I have created a batch file in Python 3.6.3 to clip a raster image using gdalwrap (I use some coordinates for clipping). Running the batch file in the command line gives error 'gdalwarp' is not recognized as an internal or external command,operable program or batch file. I tried https://stackoverflow.com/questions/31174320/gdal-merge-py-not-working-after-gdal-and-it-python-bindings-have-been-installed, but python is not recognized in this case.


texts: How do I match my road data with a Mapbox dataset?

texts:
I made an app that detects how bumpy roads are but I only know the road name and zipcode. Is there a way for me to layer this on top of a map?

For example, in my database, Main Street in zipcode 01234 has a bump score of -24, I'd like to append that onto the map so that I can show Main Street in the color red and users can filter it out if they only want well-paved roads.

So far I've looked into Mapbox which mentioned that basically every map works off of GeoJson and, from what I've read, it looks like GeoJSON is based on coordinates not types like "streets".


texts: QGIS desyncing with Geoserver and Postgis

texts:
I have a setup in which the layers in QGIS get served from Geoserver from the database in postgis.

In order to avoid users inputting wrong layer, I set up some foreign keys. Users need to first create layer A, and then copy portions of layer A over to layer B. If layer B has ids that don't match with layer A, then layer B can't be saved.

Now what occasionally happens, is that sometimes, when a user creates something in layer A and then saves it, after copying it over to layer B, he can't save on layer B. Then after I check in both QGIS and in the database, the new features in layer A are NOT saved. When checking on the user's computer, it clearly shows it as saved

So I assume this is some form of desync occurring here.

I could just tell the user to restart QGIS and redraw the features but this is a time waste so I wonder if there's something else that could be done. His QGIS version is 2.14.11, would a different version solve the issue?


texts: Unable to get Mapbox leaflet-omnivore to load markers from .csv

texts:
I'm using the Mapbox.js API to build a really simple web map using a .csv file to place markers with tooltips.  I'm trying to use the suggested leaflet-omnivore library to easily parse the csv and place the markers.  Using this example guide I have been unable to get omnivore to place any markers at all.  I've also noticed that just importing the library adds considerable load time to the map with the script:

<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.0.1/leaflet-omnivore.min.js'></script>

Here is (some) of the .csv I'm trying to place:

Name,latitude,longitude,Sport,Contact,Website,Location
Oregon Avenue Octopi,39.915048,-75.170185,Softball,,www.octopisoftball.org,"Marconi Plaza Philadelphia PA 19148"
West Philly Waste,39.943065,-75.215689,Softball,,,"Kingsessing Rec Center Philadelphia PA 19143"
Pittsburgh Pounders,40.466298,-79.961581,Baseball,,,"Arsenal Park Pittsburgh PA 15201"

I've tried variations on the snippets:

omnivore.csv('/data/teams.csv').addTo(map);

and

omnivore.csv('/data/teams.csv', latfield:'lat', lonfield:'lng', delimiter:',').addTo(map);

My csv is in a proper location and should be able to be read.  The obvious question is whether this is a problem with my code or with omnivore.

I have had success inputting the markers individually but would much rather use a csv for easy adding and editing by multiple people.  I'm also open to suggestions outside of omnivore if anyone has any.

Thanks!


texts:
I have four shapefiles with different original projections that I am trying to bring into ArcMap 10.2. How do I set these four shapefiles to a single projection that will display the layers correctly? Any help would be appreciative.

Layer         Current Coordinate Ref Sys   Lines Up
Street        NAD83 UTM 16                 YES
Major Roads   NAD83 UTM 16                 YES
County        NAD83                        YES (probably)
Railroads     ??


texts: Autosizing all fields in a QGIS attribute table

texts:
Is there a way to autosize all fields in an attribute table?

I am working with attribute tables that have over 50 columns and all of them have long names. Instead of autosizing single columns via double-click or right-click...

... I'd rather resize them all at once.

I'd be interested in doing this manually, but a script will do as well.


texts: Adjust image size and info window size in carto db

texts:
I am trying to adjust images into carto db infowinwdow. Same image size (adjusted to info window ) should be showed regardless of image size or orientation.

I have been trying different possibilities (pop-up-header, pop-up-content,..wrapper) and actions ('width:auto', 'width: auto;
display: inline-block;'..etc) but I can´t get that I need.

I have thought in resize the images before and lock the info window size but It will only work with images oriented on the same direction.....

Is it possible to do that I need?


texts: Why does layerView as returned by view.whenLayerView not have a watch method in it?

texts:
It seems to me that the layerView variable used as in this line:
view.whenLayerView(layer).then((layerView) => {

does not have the watch property so the zooming-to-Romania functionality does not work in my code.
Here is a code sandbox you can test and fork: https://codesandbox.io/s/gifted-kirch-nm0lm?file=/src/App.js (I think it is best viewed and edited in Chromium).
We are using the latest version of esri-loader.
I have read some documentation pages such as this but it is not of much help.
The main piece of code is this:
/**
 * When the layer view updates, zoom onto it.
 */
function zoomOnUpdate(layerView, view) {
  // if (typeof layerView.watch !== "function") {
  //   // debugger;
  //   console.log("error", layerView);
  //   return;
  // }

  console.log("dir", Object.keys(layerView));
  const handler = layerView.watch("updating", (val) => {
    // if the component is not being updated, do nothing
    // if (!val) return;

    // zoom onto it
    layerView.queryExtent().then((results) => {
      // here the results can be like this:
      // { count: 0, extent: null }
      // (I don't know why)
      console.log("RESULTS", results);
      view.goTo(results.extent);
    });
  });

  handlers.push(handler);
}

The output of the first console.log is this:
dir
["_emitter", "_promiseProps", "lastUpdateId", "refreshDebounced", "_effect", "_viewStateId", "_visibilityOverrides", "_highlightIds", "doRefresh", "_onRenderingConfigChange", "_updateHighlight"]

I also logged the layerView.prototype and layerView.__prototype__ and the browser told me that they are null or undefined, although I did not verify this in all situations.
The zoomOnUpdate function is used in a single place, like this:
view.whenLayerView(layer).then((layerView) => {
  zoomOnUpdate(layerView, view);
  layerView.filter = { where: "Country_co = 'RO'  AND Source = 'RO' " };

  // setModules({ ...modules });
  // setModulesAreLoading(false);
});

The URL of the layer is this: https://trial.discomap.eea.europa.eu/arcgis/rest/services/BISE/NUTS0_Marine/MapServer/0.
If this question is better suited for StackOverflow please forgive me and move it where it is most likely answered.


texts: Classifying LiDAR data to mid vegetation using LAStools?

texts:
I want to classify LiDAR vegetation points in low and mid vegetation, using LAStools.

High vegetation is simple to get, using top of canopy (first return), but how about low vegetation, and mid? Following ASPRS standards they are class 3 and 4, respectively. How could I separately isolate these classes using LAStools, in order to create DEMs from them?


texts:
I would like to write a Python script in QGIS and would like to use functions from a plugin.
For example, QuickOSM plugin has an import function and an "Open" button, that creates a temporary file in QGIS with the result of importing the osm file.
I would like my script to perform the same for more files within a folder.
I would also like the script to add a new field in the resulting file with the name of the file.
How can I do that?


texts: Accessing attachments from hosted feature service FDGB in ArcGIS Desktop

texts:
This might be an easy question, but I've created a hosted feature service on ArcGIS Online to collect data from the public. This data also includes attachments (primarily photos) which from my understanding can be downloaded for further analysis in ArcGIS desktop.

I've managed to export the feature service to a FGDB which contains a point file for the locations, a table with attachment info and a relationship class property file.

How do I actually view the attachments or get access to them in ArcGIS?


texts: Stacking rasters of different resolutions in PostGIS

texts:
I have three rasters covering the same area but with different pixel sizes (Sentinel 2 tiles if it matters). My goal is to "stack" them, such that pixel[i,j] in the resulting raster contains [bands from first raster, bands from second raster, bands from third raster]. This functionality is also accomplished using gdal_merge.py with the -separate flag, but I'd like to do it in PostGIS.

I seem to be getting some of the way doing the following:

CREATE TABLE results.tmp AS (
SELECT h.rast FROM results.hires h
UNION ALL
SELECT ST_Resample(m.rast, h.rast, 'bilinear') FROM results.midres m, results.hires h
UNION ALL
SELECT ST_Resample(l.rast, h.rast, 'bilinear') FROM results.lowres l, results.hires h)

The result seems to be an upsampling of the raster in results.midres, with all of the other data thrown out. What is the correct way of doing this?

(Needless to say I tried figuring out how to do it with ST_Union, but it's not straightforward to me how to get it to work with multiple raster files).


texts: Creating datastores in GeoServer REST API with external file option

texts:
Following the REST API documentation here I should be able to do a PUT request to /workspaces/{workspaceName}/datastores/{storeName}/{method}.{format}. Problem is I cannot get how to do it with an external method option.

This is with I'm doing:
I already have a .zip file with shapefiles in the GeoServer data directory and I do the following PUT:
/workspaces/MyWorkspace/datastores/StoreName/external.shp

The file absolute path is in the body and the myWorkspace already exists.

Geoserver logs:

org.geoserver.rest.RestException 500 INTERNAL_SERVER_ERROR: Error while storing uploaded file:
...
Caused by: java.net.MalformedURLException: no protocol: "/Users/Projects/geoserver/data/release/myData/shapefile.zip"

It really seems to me that GeoServer is trying to process the file path as an URL but that should only happen if method was URL.

Also, I'm able to do this request if method is file and the body has the file binary.


texts: ArcGIS Silverlight API - Use POST instead of GET

texts: Is there a way to get queries performed using the ArcGIS API for Silverlight to use POST instead of GET?  I'm trying to pass in a geometry which has too many vertices for the character limit.


texts: QGIS Server Not Rendering VRT Layer that is accessing COGS on S3

texts:
I have deployed a QGIS server following steps in the user manual on an AWS EC-2 instance. https://docs.qgis.org/3.16/en/docs/server_manual/containerized_deployment.html#docker-stacks
I am serving three layers through it

Vector Polygon in GPKG
Tiff in Server Storage
VRT in Server Storage: that itself is accessing COGs on a private S3 using /vsis3/

The first two layers are being served fine by the server. The third layer is throwing up internal server error. I looked at the logs of a qgis-service container, there is this message CRITICAL Server[23]: Map rendering error in layer 'va-crmp-dem'

I checked access to the COGs (that VRT is referencing to) from the server and the server does have access to COGs


texts: The longest straight line (L) within a polygon and the longest perpendicular line (T) to L

texts:
I'm mapping elongated glaciological features within QGIS 2.18.22 and I need to measure the longest straight line (L) and the longest perpendicular line (T) to L (as illustrated in the picture) within a mapped polygon (shapefile).

I have found the longest line by using the Oriented Minimum Bounding Box Tool, but this does not show me the location of T/the max width of the polygon, and I need to find this to determine the point B (see picture).

]1


texts: Alignment in ST_Intersection with PostGIS raster

texts:
Trying to intersect two rasters, but they don't have the same scale. I have to do everything in one query.

The query below gets the following error: The two rasters provided do not have the same alignment

select row_to_json(t) from (
    SELECT A.rid, B.rid, pvc
    FROM file_xbwnbydpmwesokzmrcht A
    JOIN file_caolvkddzzlgmvyeofrh B
    ON ST_Intersects(A.rast, B.rast),
       ST_ValueCount(ST_Intersection(A.rast,1, B.rast, 1)) AS pvc
) as t;

I've tried this, but syntax is wrong, apparently (ERROR:  column a.rast does not exist):

select row_to_json(t) from (
    SELECT A.rid, B.rid, pvc
    FROM (
        select st_rescale(
            C.rast, st_scalex(D.rast)
        ) from file_caolvkddzzlgmvyeofrh as C CROSS JOIN file_xbwnbydpmwesokzmrcht as D
    ) as A
    JOIN file_caolvkddzzlgmvyeofrh B
    ON ST_Intersects(A.rast, B.rast),
       ST_ValueCount(ST_Intersection(A.rast,1, B.rast, 1)) AS pvc
) as t;

How can I do this?


texts: Can gdal be used to generate a single patch of the HEALPix projection?

texts:
Given a geo-referenced map of the world, I am able to produce a version with a HEALPix projection using gdalwarp like this:

gdalwarp -t_srs '+proj=healpix +a=1 +ellps=WGS84 +wktext' -te -3.14159265 -1.57079632 3.14159265 1.57079632 -wo sample_steps=1000 -r cubic world.tiff healpix.tiff

A HEALPix projected world map can be subdivided in twelve square patches, like this:

My goal is not to generate the entire map, but one specific patch only. So if I want to create patch 3, the result should look like this:

The closest I got to this goal is to use the -te parameter to crop the target region to the bounding box of the patch. Since the origin of the HEALPix coordinates is in the center of patch 6, this would be -te 0 0 π/2 π/2 for patch 3. However, in order to get to the desired image, two further steps are required which can be done with image processing tools like imagemagick: I have to rotate the result by 45° and crop some corners.

While this is not impossible (in fact, the "desired result image" above has been created this way), it is ineffective and prone to precision issues because the input image is resampled multiple times during the process.

So here comes the question:

Is there some way to make gdalwarp produce the image above directly, without the need for any further steps?

The best would be something like the -te parameter but with the possibility to specify four corners and not four extends...


texts:
I installed QQUake plugin and I got earthquake points but all of them are in 2D X,Y.
Also I tried to import list of earthquake's and used Z axis for depth but again it comes as 2D X,Y.
So question is is there a way to get depth points in 3D Map view or similar?
Idea is to create 3D view map with terrain (which I have) and earthquakes points (which I have) where earthquake points are shown in corresponding depth which I can not achieve.
This is example of what I want to achieve:


texts: Accessing bands in .pix (PCIDSK) file in python/arcpy

texts:
I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format.

I have things working great with a tiff file. I am able to access the bands using this code:

desc = arcpy.Describe(inRaster)

for band in desc.children:
    bandName = band.name
    currentBand = inRaster + "\\" + bandName

And then just using bandName as the input raster.

However, this code does not work with my .pix file ("Input value raster: testraster.pix\b does not exist.")

I think I can use the CopyRaster tool to convert the file to tiff format, but this is slow and seems like it should be unnecessary.

Does anyone know if there is an easier/more efficient way?

I've also tried the MakeRasterLayer tool to make a raster layer from a single band. I first tried this in ModelBuilder and it worked great. I extracted the ModelBuilder code to python to ensure I was running it with the exact same parameters, but alas, I get the following error:

ExecuteError: ERROR 010213: Error in reading raster band1. Zonal statistics program failed
ERROR 010067: Error in executing grid expression.
Failed to execute (ZonalStatisticsAsTable).

This is when using the exact same input files and the same tool, so I'm not quite sure why it isn't working.

I've also tried GDAL, but I'm not sure if it's possible to load a raster with GDAL and then process it with arcpy. Here is part of my code:

filename = "E:\\Temp\\Test\\testraster.pix"
dataset = gdal.Open( filename, GA_ReadOnly )
band = dataset.GetRasterBand(1)
outStats = ZonalStatisticsAsTable(shapeFile, shapeFileField, band, outTable, "DATA", "MEAN")

Which results in (as I expected):

RuntimeError: Object: Error in executing tool


texts: How to label feature of shapefile on the color map in matlab

texts:
I am trying to make color map from text file data. I am using geoshow to call shapefile of the region and to set it as back ground of the color map. My shapefile is of the country. I have digitized its districts as polygons. In the attributes of the shapefile I named these districts under "NAME_1" field. I am using these codes to make a color map

fid = fopen('1000_2000.txt');
C = textscan(fid, '%f %f %f')
 fclose(fid);
 f = {'lat', 'long', 'temp'}
 S = cell2struct(C,f,2);
 N = 100;
 [Xi, Yi] = meshgrid(linspace(60,80,N),linspace(20,40,N));
 Ci = griddata(S.long, S.lat, S.temp, Xi, Yi);
 f = figure; set(f, 'Renderer', 'painters')
 colormap default
  h = geoshow(Yi,Xi,Ci,'DisplayType','surface');
 set(h,'ZData', zeros(size(get(h,'XData'))));
 p = geoshow('PAK_adm1.shp', 'DisplayType','polygon','FaceColor','none','EdgeColor','w');
 xlim([60.5 78.5]);
ylim([22.5 38.5]);
xlabel('Longitude');
ylabel('Latitude');
set(gca,'CLim',[0,3000])
 colorbar

I am getting output as

I want such kind of label features( want to show label in the attribute of shapefile with field name NAME_1)

Any idea how to correct these codes to label features on my color maps?


texts:
I'm using the plugin builder to develop a plugin QGIS. I want the fields of the selected layer in combobox_1 to appear in combobox_5and fields of the selected layer in comboBox_2 to appear in comboBox_3 and comboBox_4.

I am new to python and PyQGIS. I do not have the methods defined in initGUI. How can I achieve this?

def initGui(self):
    """Create the menu entries and toolbar icons inside the QGIS GUI."""

    icon_path = ':/plugins/TheWorkflow/icon.png'
    self.add_action(
        icon_path,
        text=self.tr(u'The Workflow'),
        callback=self.run,
        parent=self.iface.mainWindow())

def unload(self):
    """Removes the plugin menu item and icon from QGIS GUI."""
    for action in self.actions:
        self.iface.removePluginVectorMenu(
            self.tr(u'&The Workflow'),
            action)
        self.iface.removeToolBarIcon(action)
    # remove the toolbar
    del self.toolbar

def run(self):
    """Run method that performs all the real work"""
    # show the dialog
    self.dlg.show()
    # Run the dialog event loop
    result = self.dlg.exec_()
    # See if OK was pressed
    if result:
        # Do something useful here - delete the line containing pass and
        # substitute with your code.
        pass


texts:
To import data into a PostgreSQL/PostGIS database I need this CSV format:

"1,nameOfPoint,0101000020E6100000689DA690152F114090338CFF9B0B4A40,2019-07-22 19:56:03.603+00,2019-07-22 19:56:04.243+00"

From my understanding the third field is a PostGIS geometry object (created inside PostGIS with ST_MakePoint). However I have coordinates. Can I convert coordinates into a PostGIS object outside of the database? Is there a conversion tool for this?


texts:
I'm new here and in the world of Python scripting mostly with the arcpy module.
I hope you can help me with the trouble that I have.

I'm trying to develop a script to extract or uncompress multiple tar.gz files (I can do it properly) with the condition that if the file into the tar.gz file contains certain name only.

import os, tarfile, glob

ws = "workspace" out = "out workspace"

for tar_file in glob.glob(ws + "/*.gz"):

    tar = tarfile.open(tar_file,"r")

    for member in tar.getmembers():
        if "atribute 1" or "atribute 2" in member.name:    # here i'm failing
            tar.extract(member,out)
            print "%s extracted" %(member)
    tar.close()

I can´t create the condition if.
Any idea how can I uncompress only the files with the attributes that I want?
I'm trying to do this to extract only some bands of a huge LANDSAT 8 dataset.


texts: How to create a movable point in OpenLayers?

texts:
I have the following code:

    function mapCreate(lon,lat){
    map = new OpenLayers.Map("map1");
    var osm = new OpenLayers.Layer.OSM();
    vectors = new OpenLayers.Layer.Vector("Vector Layer");
    map.addLayer(osm);
    var center = new OpenLayers.LonLat(lon,lat).transform(
        new OpenLayers.Projection("EPSG:4326"),
        map.getProjectionObject()
    );

    point = new OpenLayers.Geometry.Point(center.lon,center.lat);
    vectors.addFeatures([new OpenLayers.Feature.Vector(point)]);
    drag = new OpenLayers.Control.DragFeature(vectors);
    map.addControl(drag);
    drag.activate();
    map.setCenter(center, 15);
    map.addLayer(vectors);
    point.events.register('moveend',point, function(evt){
        alert('hello');
    });

}

The part that does not work is:

        point.events.register('moveend',point, function(evt){
        alert('hello');
    });

Can anyone help me with creating an event listener for a point in OpenLayers?


texts: Unable to create a circular polygon with ArcGIS Explorer SDK

texts:
I am having trouble creating a circle with a specified radius of 200 feet.  I have tried several ways to translate the points along the circular arc.

here is my current code:

var display = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;

var center = display.TrackPoint();
var convertedRadius = Unit.Convert(200, Unit.Feet, center.CoordinateSystem.Unit);
var firstPoint = GeometryOperations.Move(center, convertedRadius, 0);

var points = new List<Points>();
points.Add(firstPoint);

for (int i = 1; i < 360; i++)
{
    var point = GeometryOperations.Rotate(firstPoint, center, (Math.PI / 180) * i) as Point;
    points.Add(point);
}

var poly = new Polygon(points, display.CurrentCoordinateSystem);
var circleGraphic = new Graphic(poly, Symbol.Fill.Solid.Red);
display.Graphics.Add(circleGraphic);

I only seem to have a problem creating a polygon.  Using the above loop I can place 360 markers in a circle around the center point.

Alternately, If there is a way to create a buffer from a point using programmatic methods that would suffice.  I am trying to query all shapes that are within 200 feet of a target point.


texts:
I'd like to convert a subset from HDF5 to GeoTIFF

The data is OMPS Aerosol Index data (EarthData login to download)
https://snpp-omps.gesdisc.eosdis.nasa.gov/data/SNPP_OMPS_Level2/OMPS_NPP_NMTO3_L2.2/2019/211/

I'm expecting an eventual output of this https://acd-ext.gsfc.nasa.gov/People/Seftor/OMPS/world_2019_07_21.png

I've tried these methods from other Answers but the command line just stops and doesn't give any errors.

gdal_translate -of GTiff ‘HDF5:"OMPS-NPP_NMTO3-L2_v2.1_2019m0724t000444_o40089_2019m0724t020831.h5”://ScienceData/UVAerosolIndex’ omps.tiff

and

for %A in OMPS-NPP_NMTO3-L2_v2.1_2019m0730t013311_o40175_2019m0730t054038.h5 do gdal_translate -of GTiff -sds "%A" "%A.tiff"

This is the output from gdalinfo for the subdataset I'm interested in

 SUBDATASET_32_NAME=HDF5:"OMPS-NPP_NMTO3-L2_v2.1_2019m0730t013311_o40175_2019m0730t054038.h5"://ScienceData/UVAerosolIndex


texts: Is there an open source GIS to view and edit CityGML models?

texts:
I'm looking for an open source GIS that supports viewing and editing of CityGML models.

So far, I've found a list of open source applications that support CityGML, but they all seem to be stand-alone applications, that don't integrate with common GIS systems: http://www.citygmlwiki.org/index.php/Open_Source.

I would also be interested in your experience with CityGML in a GIS (also commercial) context.


texts: Displaying unique records in combo-box in ArcGIS API for JavaScript?

texts:
I am displaying almost 9000 records by four type (A,B,C & D) in which I am displaying records using combo-box.

Each record is classified by "ctype" ( A or B or C or D) so I am putting this in combo so that If I select type A then all records of type A will be display..

Code that I am following :

Code link : http://jsfiddle.net/sunilspalkar/hdmNx/1/

In above code all records displaying but its not showing unique records of dam . I am facing same problem..

What I tried :

1.I am using query layer &  I can not use "distinct"  because of "geom" column .
2.I searched the API reference also for "unique elements for combo-box" but I did not found suitable material.
3. I found this link In this link values are hard coded and I have dynamic values.
4. If I use "STATE" column instead of "ctype" then it works fine.. the "ctype" column has string type and all records are well formatted..

Software's : Sql Server 2008 r2 (for query layer) , ArcGIS Server/Desktop 10.1 , Java script API ver. 3.0/3.1


texts: Street view points are not visible in Google Earth app

texts:
I published a panorama image of my home in Google Street View app. But when I went to Google Earth app, and went to my location, it didn't show any street view points/circles. However there are a few other circles around the town uploaded by others. So why didn't mine work?

I asked initials of this question in a separate question. I followed the steps from there, but it's not listed in Earth app.

What can be wrong?


texts: Where can I find global spatial data for net primary productivity (NPP)?

texts:
Where can I find a reliable source of global spatial data for net primary productivity (NPP)?

I have looked and looked but have met various road blocks.


texts: Extrude polygons with holes in GRASS using v.extrude

texts:
I have a shapefile with building footprint polygons. Many of the polygons have holes/inner rings within them (I'm not sure of the correct term in Grass). These import correctly into Grass GIS. I aim to drape the polygons over a DEM, extrude  and export them and the DEM for use in a realtime 3D visualisation.

The following workflow is functional, except where v.extrude messes up the geometry:

import vector (allowing cleaning) and raster data
set g.region to the polygon layer
drape the polygons on the DEM using v.drape
extrude them using v.extrude
output the layer using v.out.vtk

My problem is that the extrusion process ignores the holes in the polygons and creates geometry for the outer ring only. This happens whether or not v.drape is used beforehand.

I've tried the following (unsuccessful) ideas already:

generating centroids for the 'holes' first (this just creates a new polygon 'separate' from the outer ring).
using v.clean with the chbridge option, hoping that might add a bridge from outer to inner ring.

Another idea might be to break all the polygons down to triangles first, but I hate to think how complex the 3D geometry would be afterwards! Likewise, manually adding bridging lines to the polygons is not practical given the size of the dataset.

Am I missing something? I'm happy to use Grass and QGIS. Many thanks


texts: How do I smooth edges of polygons in QGIS?

texts: Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now?


texts: Create a circle in R, and plot it in a shapefile

texts:
I want to plot a circle with a radius of 5 miles around a hospital in Massachusetts. I was using some previous answers found here, but it is not working. st_buffer shows an error.

library(sp)
library(rgdal)
library(sf)

# Getting data:
download.file('http://download.massgis.digital.mass.gov/shapefiles/state/zipcodes_nt.zip',
              f <- tempfile(), mode='wb')
unzip(f, exdir=tempdir())
p <- readOGR(file.path(tempdir(), 'ZIPCODES_NT_POLY.shp'))
# location of hospital.
lon <- -71.06
lat <- 42.36

# defining the hospital location
dub <- st_point(x = c(lon, lat), dim = "XYZ")
dub <- dub %>% st_sfc(crs = 4326)
m5 <- set_units(8.04672, km) %>% set_units(m)
dub_buffer <-  st_buffer(dub, m5)
plot(p)
plot(dub_buffer, add=TRUE)


texts: Inaccurate result while clipping on gis data using ArcObjects?

texts:
I am trying clip polyline data using a polygon geometry. I am using itopologicaloperator to do this task. However, resultant clipped data is off by 1 feet. Meaning that the polylines at the boundaries of the polygon geometry goes beyond the boundary by 1 feet.

Here is my case:

the polygon geometry is in GCS_North_American_1983
the polylines are in GCS_WGS_1984

I tried to generate the result by projecting the polygon geometry data to GCS_WGS_1984 ((I used NAD1983_To_WGS1984_5 for geographic transformation to equidistant conic projection) before clipping the data . The resultant clipped data is not accurate in that polylines cross the polygon by 1 feet or more.

I tried to generate result using ESRI tools with accurate results. I do not understand why I could not do this with my code.

Here is my code:

ITopologicalOperator topo;
IFeatureCursor cursubdiv = null;
IClone geoclone = null;
IFeatureCursor curtrack = null;
IFeature feattrack = null;
IGeometry geotrack = null;
IGeoDataset geosubdiv = null;
ESRI.ArcGIS.esriSystem.IUnitConverter unitConverter = null;

//tracks are in gcs_1984
//Polygon geometry is in GCS_North_American_1983
//so convert track geometry to gcs_1984
//project clipped data to USA_Contiguous_Equidistant_Conic
try
{

  geosubdiv = (IGeoDataset) psubdivftly.FeatureClass;

  //get the geometry projected
  geoclone = (IClone) clipgeo ;
  IGeometry clipgrid = (IGeometry) geoclone.Clone();
  // this polygon geometry is in GCS_North_American_1983

  ISpatialFilter spfilt = new SpatialFilter();
  //project the polygon geometry to GCS_1984
  clipgrid = ProjectFromEquidistantToGCS(clipgrid);

  spfilt.geometry = clipgrid
  spfilt.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects
  curtrack =  pGeoTrack.FeatureClass.Search(spfilt, true);

  //create featurebuffer to insert clipped data into the input layer
  IFeatureBuffer subdivfeatbuff =  memcliptrackly.FeatureClass.CreateFeatureBuffer();
  IFeatureCursor insertcur = memcliptrackly.FeatureClass.Insert(true);

  //check each feature is within or crosses and add to the virtual track layer.
  while ((feattrack = curtrack.NextFeature ()) != null)
  {
    geotrack = feattrack.ShapeCopy;
    IRelationalOperator relop = (IRelationalOperator)geotrack;
    if (relop.Within(clipgrid) == true)
    {
      geotrack = projectFromGCSToEquidistant2(geotrack); //projects it  to USA_Contiguous_Equidistant_Conic
      subdivfeatbuff.Shape = geotrack;
      insertcur.InsertFeature(subdivfeatbuff);
    }
    else
    {
      if (relop.Crosses(clipgrid) == true)
      {

        topo = (ITopologicalOperator)geotrack;
        //get the clipped geometry
        topo.Clip(clipgrid.Envelope);
        // geoclone = (IClone)topo;
        geotrack = projectFromGCSToEquidistant2((IGeometry)topo); //projects it  to USA_Contiguous_Equidistant_Conic
        subdivfeatbuff.Shape = geotrack;
        insertcur.InsertFeature(subdivfeatbuff);
        }
    }

  }

  insertcur.Flush();


texts: Extracting the z-values of a stream in a watershed if I have the values of the contours

texts: I have the z-values of the contours (physical contours) of a watershed in AutoCAD civil, but I may use them in ArcGIS 10.2 and I have already created a DEM. I need to extract the z-values for the stream, in order to create the AgreeDem and to continue with the fill and flow accumulation process in ArcGIS.


texts: Adding raster file from file geodatabase to .lyrx file using ArcPy

texts:
I have a file from a file geodatabase, which contains all raster files, that I want to save to an already existing layer file. I am using ArcGIS Pro.
I am trying this like so:
import arcpy
import os
arcpy.env.overwriteOutput = True

#read in the file geodatabase
dnbr = "X:/user/pre_85/dnbr.gdb"

#save all raster names
arcpy.env.workspace = dnbr
all_rasters = arcpy.ListRasters() #this returns ['test', 'test2']

#get the first raster in the list
test = all_rasters[0]

#read in the lyr file
lyr = arcpy.mp.LayerFile("X:/user/arcpy_maps/New_Group_Layer.lyrx")

#list the existing layers in the group layer file
lyr.listLayers() #this returns [<arcpy._mp.Layer at 0x91f3e9c8d0>, <arcpy._mp.Layer at 0x91f3e9c7f0>]

#now lets add the test layer to the third location of lyr
for_adding = os.path.join(dnbr, test)

lyr.addLayerToGroup(for_adding, [2]) #add to the third location, since two exist

but this returns the following value error:
  File "<ipython-input-15-07b8bd305e3c>", line 1, in <module>
    lyr.addLayerToGroup(one, [2])

  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\utils.py", line 191, in fn_
    return fn(*args, **kw)

  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 739, in addLayerToGroup
    return convertArcObjectToPythonObject(self._arc_object.addLayerToGroup(*gp_fixargs((target_group_layer, add_layer_or_layerfile, add_position), True)))

ValueError: X:/user/pre_85/dnbr.gdb\test


texts: Why does Exporting Document to JPEG using ArcObjects in Layout View result in bad picture quality?

texts:
I want to export the Active View with ArcObjects to JPEG. All Layers in the Document are raster layers (GeoTiff).

I use this code which works quite well when in Data View, but when I perform the same export in Layout View, the picture quality is really bad.

Has anyone an idea what the cause of this problem could be?

If I do File -> Export Map picture quality is good in both Data and Layout View.
So Esri seems to be doing it differently in ArcMap.

EDIT: kenbuja had the answer. In case somebody needs the C# variant of the method he mentioned, have a look at the esri documentation


texts: Compress - ERROR 000837: The workspace is not the correct workspace type

texts:
Getting an error with a very simple compress script.

This script works perfectly fine within arcmap, but I want to make this into a scheduled recurring script.

import arcpy
from arcpy import env

env.workspace = r"\\UNC PATH \dbconnection.sde"
arcpy.Compress_management(r"\\UNC PATH \dbconnection.sde")

Super simple. I've tried importing arceditor in order to set the product for ArcGIS Desktop standard, to no avail. I've also attempted to run:

arcpy.ClearWorkspaceCache_management()

before setting env.workspace, but still doesn't work. I have also tried different variations of the UNC path, such as specifying parent folder in workspace and then only the .sde in the compress, etc...

All errors come out as the one in the title: ERROR 000837: The workspace is not the correct workspace type.


texts: QGIS Processing Plugin Not Loading "RuntimeError: maximum recursion depth exceeded in cmp"

texts:
I am having serious issues with my QGIS program regarding the Processing Plugin. Upon start-up and if I turn on the plugin within the program.

I have uninstalled and reinstalled the program. Have wiped it clean from the computer, and continue to have this error come up.

It appeared all of a sudden when I opened the program at the beginning of the day.

[


texts: Extraction of Roads from a Large Geographical Dataset

texts: Google Maps API allows grabbing roads for individual latitude and longitude specifications (or the nearest roads if the point/s are not on a road). However, the way it requires data to be entered for each individual request makes finding a large number of roads very difficult (in my case ~17000). I was wondering if anyone knew how to automate the process to take a list of points and spit back the relevant roads (either in Google Maps or elsewhere)?


texts:
I have VisualStudio 2013, and I have installed ArcGIS Runtime SDK for Dotnet 10.2.7. But still unable to get the ArcGIS Runtime assemblies in VisualStudio references. Is any version update of VisualStudio required or, if not, what is the solution for this?

How do I get the ArcGIS Runtime SDK assemblies in VisualStudio after installation?


texts: How to extract elevation data from ASTER/SRTM?

texts: I just want to know if there are any other tools available in QGIS apart from the Point Sampling tool to extract elevation data from ASTER/SRTM/CartoDEM (for India) data? When I convert these images to XYZ, I can see 1 to 2m differences in certain points with respect to the Point Sampling tool results. More over, the results obtained through point sampling are integers, not decimals like that of the extracted XYZ.


texts: Having Trouble with ST_Buffer and ST_Union

texts:
I am trying to build a coverage map, and measure how well a given set of points covers the target area.

I started by writing a query like this:

SELECT cartodb_id,
   ST_Transform(ST_Buffer(the_geom::geography,400)::geometry, 3857) as the_geom_webmercator
FROM set_of_points

That gave me a nice map of the areas covered by the set_of_points. But now I want to combine those buffers into a set of polygons where the overlapping buffers are merged into a single polygon.

What's the best way to do this?


texts: OpenLayers 3: Can I set a default "error tile" for when a tile is not available?

texts:
Many of my map layers are zoomable to zoom level 21, but one of my basemaps is only zoomable to 18. When I zoom past this level with that particular basemap activated, the background goes white.

I'd like to indicate to my user that this is expected behavior and that there's just no data for that zoom level. I'd like to do this by inserting a tile similar to Google Maps's "no data" tile.

Can I set a default error tile in OpenLayers 3?


texts:
I'm trying to perform pgRouting with MapServer so I've created a function in PostGIS and the call it in map file with runtime substitution. The DATA part is as follows:

DATA "geom FROM (SELECT * FROM routing_func(%source% , %target%)) AS foo USING UNIQUE seq using srid=2100"

My validation section in the map file is:

   VALIDATION
        "source" "[0-9]+"
         "target" "[0-9]+"
   END

and the CLASS object:

CLASS
        NAME 'routing'
        EXPRESSION "%source% && %target%"
        STYLE
            COLOR 255 0 0
            WIDTH 4
       END
   END

I try to pass the parameters in map mode with the following request:

 http://127.0.0.1/cgi-bin/mapserv?map=/home/user/mapdata/mapfile.map&mode=map&source=90&target=900

but nothing is drawn for the route that was supposed to be calculated.

If I try the OpenLayers template like:

   http://127.0.0.1/cgi-bin/mapserv?map=/home/user/mapdata/mapfile.map&template=openlayers&source=90&target=900

The MS_ERRORFILE gives me the following error:

Error (ERROR:  syntax error at or near "%"
LINE 1: ...d, source, target, time as cost FROM roads_noded',%source%,%...

What am I missing here?


texts: Which software to use to create professional fly-over/ fly-through animations?

texts:
I will need to create a high quality fly-over animation which penetrates the surfaces and reveals subsurface geology.  The intended use is for demonstrations, presentations and a company website so it cannot include copyrighted data.

Available Data: I have high resolution satellite & aerial imagery, 20m resolution DEM for the entire area of interest, 10 x 10 km 1m resolution LiDAR data, subsurface geology in 3D DXF and ArcGIS multipatch features; basically all the data I would like to "fly over and through".

Software: I have ArcGIS 10 ArcEdtor with Maplex, 3D and Spatial Analyst, Access to MapInfo Professional (no experience), Google Sketchup Pro, Leapfrog Mining and CorelDraw X5 and Adobe Master Collection CS5 (limited experience) at my disposal.

I've seen some ArcGlobe and Google Earth animations and from what I have seen seems too choppy and the camera moves too fast and turns abruptly.

Here is an example of something I would like to create except that I need to also explore features beneath the surface. I will need some pop-up balloons to indicate points of interest similar to what's in the linked video as well as a compass or an arrow showing approximate north orientation.

I am only looking for suggestions how to create the "guts" of this animation; the actual fly over and into the data with the pop up labels and direction.

I would really appreciate any suggestions on:

Recommended workflow for such animations (preferably using the tools I already have)
Other software commonly used to create such animations

Please share links to any good examples.


texts: Not able to deploy geoserver.war through apache tomcat

texts:
When i try to upload the geoserver.war file through apache tomcat and then deploying by clicking on Deploy .....deployment failed

Screenshot


texts: arcpy.mapping.ExportToTIFF won't work with resolution and world file?

texts:
mxd = arcpy.mapping.MapDocument("CURRENT")
path = "C:\\fakepath\\test.tif"
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.mapping.ExportToTIFF(mxd, path,   resolution = 820 , world_file = True)

The above code produces:

  TypeError: PageLayoutObject: Error in executing ExportToTIFF

arcpy.mapping.ExportToTIFF(mxd, path,   resolution = 820 )

This one works, but of course no world file.

arcpy.mapping.ExportToTIFF(mxd, path, df,   resolution = 820 , world_file = True)

This produces a result,but it is not in 820 dpi but 96 dpi.

How can I get both the dpi and the world file together?


texts: Values for multiple locations and years in Earth Engine

texts:
I am using the TerraClim data in Earth Engine to obtain location and year specific temperature values. I have 12 districts and TerraClim has data from 1958 to 2015. For each district, I want to get the mean of max temperature (during January - April) for each year. I was able to get the mean max temperature (Jan-Apr) for each year. But, for some reason, the reduceRegion() or reduceRegions() is not working. Need help to ultimately create a table with: District attribute, mean temperature for each year between 1958 and 2015.

//Image and shapefile import
var images = ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE"),
var districts = ee.FeatureCollection("users/asifishti/IGP_dist");

//Selecting maximum temperature band
var image_maxtmp = images.select ("tmmx");
print (image_maxtmp);

//Filtering image for Jan - April and 1958 and 2015
var maxtmp_janapr = image_maxtmp.filter(ee.Filter.calendarRange(1958,2015,'year'))
.filter(ee.Filter.calendarRange(1,4,'month'))
print (maxtmp_janapr);

//Getting yearwise max temperature image
var year = ee.List.sequence (1958,2015);
var mean_func = function (i) {
  return maxtmp_janapr.mean().set("Year", i)
};

var yearwise_maxtmp = ee.ImageCollection(year.map(mean_func));
print (yearwise_maxtmp);

//Calculating max temp for each district (NOT WORKING)
var dist_maxtmp = function(feature){
  var mean_maxtmp = yearwise_maxtmp.reduceRegions({
    reducer: ee.Reducer.mean(),
    geometry: feature.geometry(),
    scale: 4000, //The image has 2.5 arc-second/~4km resolution
    maxPixels: 1e12
  });
  var maxtmp_dist = feature.set("Max Temp", mean_maxtmp.get("tmmx"));
  return maxtmp_dist;
};

var distwise = districts.map(dist_maxtmp);
print (distwise);

Thank you!


texts: layer.visible command not working in arcpy.mapping module

texts:
I am using the arcpy.mapping module for the first time, and the lyr.visible command is not working as it should (or I am not using it as I should). I have a list that contains the the layer names of .img files that are loaded into a single data frame - the list is called "layernames". I am using a while loop to go though the layernames list, turn on one of the layers at a time, export a .png file with that layer visible, then turn that layer off and move on to the next layer in the list.

At the beginning of each pass through the loop I specify which raster layer should be turned on by setting layernames.visible = True, and at the end of the pass through the loop I turn off that layer by setting layernames.visible = false.

The first time through the loop the script works and does turn on the correct layer in the list "layernames". But for all subsequent passes through the loop, only the first layer remains visible, and none of the others are turned on or off. In other words, every .png image shows the same raster (the first one that is turned on), instead of a different raster in each .png image. I have pasted my script below. Any help would be greatly appreciated!

mxd = arcpy.mapping.MapDocument("Z:\\sharks\\Models\\Summer2013\\daily figures.mxd")
layernames = arcpy.mapping.ListLayers(mxd)
counter = 0
yr = 2005
while counter < 365:
    layernames[counter].visible = True
    x = str(layernames[counter])
    y = x[9:12]
    j = int(y)
    date = datetime.datetime(yr,1, 1)+ timedelta(days=(j-1))
    strDate = str(date)
    if (j + 1)<= 31:
        mxd.title = "January (" + strDate[0:10] + ")"
    elif (j + 1) >= 32 and (j+1) <= 59:
        mxd.title = "February (" + strDate[0:10] + ")"
    elif (j + 1) >= 60 and (j+1) <= 90:
        mxd.title = "March (" + strDate[0:10] + ")"
    elif (j + 1) >= 91 and (j+1) <= 120:
        mxd.title = "April (" + strDate[0:10] + ")"
    elif (j + 1) >= 121 and (j+1) <= 151:
        mxd.title = "May (" + strDate[0:10] + ")"
    elif (j + 1) >= 152 and (j+1) <= 181:
        mxd.title = "June (" + strDate[0:10] + ")"
    elif (j + 1) >= 182 and (j+1) <= 212:
        mxd.title = "July (" + strDate[0:10] + ")"
    elif (j + 1) >= 213 and (j+1) <= 243:
        mxd.title = "August (" + strDate[0:10] + ")"
    elif (j + 1) >= 244 and (j+1) <= 273:
        mxd.title = "September (" + strDate[0:10] + ")"
    elif (j + 1) >= 274 and (j+1) <= 304:
        mxd.title = "October (" + strDate[0:10] + ")"
    elif (j + 1) >= 305 and (j+1) <= 334:
        mxd.title = "November (" + strDate[0:10] + ")"
    elif (j + 1) >= 335 and (j+1) <= 365:
        mxd.title = "December (" + strDate[0:10] + ")"
    mxd.save()
    out_png = "Z:/sharks/Models/Summer2013/RF/ALL/SB_RF/AVpresRFP/figures/" + strDate[0:10] + ".png"
    arcpy.mapping.ExportToPNG(mxd, out_png)
    layernames[counter].visible = False
    mxd.save()
    counter +=1


texts: Question marks ("?") in QGIS layer panel when using svg markers defined with "Data defined override"

texts:
When using svg marker symbols and set the path to svg file via Data defined override the svgs display well in the map canvas, but not in the layers panel (applies for QGIS 2.x and 3.x).

svg marker symbol setup:

Expression for Data defined override (Note the output preview):

@svg_path || '\\baustelle_laufend.svg'

(This is build from a variable holding different paths to svg symbols in various environments and the svg file name itself)

The correct display in the Symbol Selector and in the map canvas as well proves that this approach works fine, but in the layers panel the svg symbols are replaced by some ugly question marks:

Why is that so? Is this a bug?


texts: How to work out sqft/m of land coverage?

texts:
I am currently self teaching myself on qgis whilst volenteering on a project on a river catchment and your help is hugely appreciated!

I need to be able to work out the percentage of land cover or sqft/m coverage. I have all the land uses on as a vector layer over my river catchment.

Many thanks and let me know what other info i need to give as a newbie!


texts: How to convert a string field to a date field

texts:
I have a layer with points which represent the fatal road accidents and the field "dates_14_D" contains their date but its type is string. I would like to convert this string field to date field but the OK button is inactive. What's the problem?
I use QGIS. Look at the below picture


texts:
I try to label a field according to his length with VBScripting in ArcGIS 10.0

The idea is, if my field is more than a certain length, then please add a new line and split the field correctly.  My field can be Null.

I can't get the code below  to work (Verify returns nothing):

Function FindLabel ( [JOIN_NUMBER] )
If IsNull([JOIN_NUMBER] ) Then
FindLabel = [JOIN_NUMBER]
Else
FindLabel = Left([JOIN_NUMBER] ,8) & vbnewline & Right([JOIN_NUMBER] ,Len([JOIN_NUMBER] ,-8))
End If
End Function


texts: How can I remove clouds' borders on Sentinel-2 images?

texts:
I have to replace area with clouds from another image without clouds. So I have a problem when I remove clouds from my mask I have borders of clouds. I use Sentinel-2 SLC image. For begin I open my mask of scene classification(SLC) in 'jp2' formats. Then I resize my image to format my composites(10980x10980). I use ReadAsArray for both files. Then, where mask have labels with clouds and shadows I set 0 and works with arrays:

raster_composite1[:, mask_slc1 == 0] = raster_composite2[:, mask_slc1 == 0]#i have 4 bands

Input image:

In output I have image:

So, how can I remove those white borders ?


texts: Arcpy doesn't put shapefiles in another database despite being defined

texts:
I'm trying to calculate the meancenter of a pharmacies in Istanbul file by grouping with the case field "ilce_adi" which means neighbourhood's name. It works well but despite being defined, it does not put the output shapefiles into a new geographic database. Here is my script.
import arcpy
import time

input_FC = r"C:\ScriptData\data.gdb\pharmacies"
CF_output = "pharmacies_CENTRALFEATURE.shp"
MEAN_output = "pharmacies_MEANCENTER.shp"

CASE_Field = "ilce_adi"

arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\ScriptData\process.gdb"

print"The script is working.."

start_time = time.time()

arcpy.CentralFeature_stats(input_FC, CF_output, "Euclidean Distance", "#","#",CASE_Field)

arcpy.MeanCenter_stats(input_FC, MEAN_output, "#",CASE_Field,"#")

end_time = time.time()
process_time = end_time - start_time

print "Script is done in {:.2f} seconds".format(process_time)


texts: How to set output resolution for gdalwarp to that of source file?

texts:
I have a large raster, which I want to re-project and crop for a new location that I'm creating in GRASS. I seem to have gotten the re-projection and cropping right with this call to gdalwarp:

gdalwarp -t_srs EPSG:32142 \
  NE1_HR_LC_SR_W.tif \
  -te -1246270.9107927915 -186894.1315662132 2391103.024689787 2372883.4615327567 \
  NE1_HR_LC_SR_W_32142.tif

Unfortunately, the resolution of the target file is much lower than that of the source file. I see in the gdalwarp documetation that the argument -tr specifies the target file's resolution, but it is not clear to me how to specify that the target file's resolution should be that of the source file.


texts: How to reclassify raster inside polygon mask, leaving values outside as they are?

texts:
I am in the final stages of a landcover classification and need to reclassify thematic raster values that are inside different polygon masks, while leaving the values outside as they are.

Can I do this with raster calculator? And, if so, how?


texts: What is the best way to represent bridges using a point vector layer in QGIS?

texts:
I'm working on a hiking/biking maps of trails in the woods which sometimes have bridges that need to be shown on the map. I'm trying to figure out the best way to capture and represent them using QGIS and a point shapefile.

I'm capturing them in a general "Features/Markers" layer where I also store the location of things like information booths and notable trail features/locations. I have a attribute named "type" that I use to style each type of feature ("bridge", "information", "feature", etc.) and a "name" field I can use to optionally label the feature.

Since bridges point in a certain direction I added a "rotation" field which I'm referencing in "Style, Advanced, Rotation Field". Finally I'm using "Map Unit" as my unit so the size of the bridge scales with the size of the map. I'm considering also adding a "size" field to the "feature" layer as well in case I determine different bridges need to be different sizes.

I'm curious how others capture/style bridges and if there's anything I'm not considering?

Here's a screenshot of how it looks:


texts: Is height conversion between ellipsoids necessary?

texts:
I have measurement data that uses X/Y in different zones of JGD2011 and an ellipsoid height above GRS1980 (but it also includes a geoid height as well). My task is to transform this data to "WGS84 LLA".

For the horizontal part I used a transform from (for example) EPSG:6677 to EPSG:4326, and all seems well. However, I am really confused what to do with the height (and whether I even need to do something).

The WGS84 and GRS80 ellipsoids seem to differ, but I was unable to find out by how much, and how to convert the data.

I tried a conversion from EPSG:6667 to EPSG:4979 with adjusted input data, but the result is a noop, so maybe there is no difference after all.

So my question is: how should I handle the height? I am not even sure if I should output the ellipsoid height or geoid height, WGS84 also includes a geoid definition ...?


texts: Clip raster using shapefile into multiple rasters using ArcGIS Desktop?

texts:
I have a raster file representing a large area and a shapefile of 30 polygons representing watersheds. I would like to clip the raster with the shapefile to create 30 rasters representing each watershed? I would like to automate the process as I will be repeating it for another 10 raster files representing large areas.

I'm using ArcGIS 10.1 with an advanced arcinfo license. Can this be done without the use of python?


texts: Tabulating points from CSV that are within 1 km of points from another CSV using QGIS?

texts:
I have two sets of data. One that is from a csv and contains a relatively small amount of data (we will call location data), and another csv that contains a larger dataset that contains environmental data.

I want to create a separate csv file that contains all the environmental data that is within 1 km of the location data.

For example,

If temperature data comes within a 1 km radius of 1 or more points from the locations data, I want to create a new file that contains all the data that is in that 1 km radius.

How should I go about doing this using QGIS?

See the image I attached. The pink points are the location data and the small points is the environmental data. I only want to look at the data that overlaps with the pink.

Keep in mind the pink data points are styled and there is a 2000 m diameter.


texts:
I'm trying to update my text elements, but after running script no changes occur and no error are triggered. Running suggested code triggered an error.

I need to update my title and date text box.

I used the suggested script and receive:

Runtime error
Traceback (most recent call last):
File "<string>", line 72, in <module>
ImportError: No module named mapping

Here's what I have so far:

# Import arcpy module
import arcpy

#Work Env
arcpy.env.workspace = "F:\APPDATA\GISMAPS\Projects\Planning\Requests\Bryan\2018\Planning\Teresita_care\Test_File"

# Script arguments
Parcels = arcpy.GetParameterAsText(0)

Selection_type = arcpy.GetParameterAsText(1)
if Selection_type == '#' or not Selection_type:
    Selection_type = "NEW_SELECTION" # provide a default value if unspecified

Distance__value_or_field_ = arcpy.GetParameterAsText(2)
if Distance__value_or_field_ == '#' or not Distance__value_or_field_:
    Distance__value_or_field_ = "300 Feet" # provide a default value if unspecified

Distance__value_or_field___2_ = arcpy.GetParameterAsText(3)
if Distance__value_or_field___2_ == '#' or not Distance__value_or_field___2_:
    Distance__value_or_field___2_ = "500 Feet" # provide a default value if unspecified

Expression = arcpy.GetParameterAsText(4)
if Expression == '#' or not Expression:
    Expression = "\"AIN\" = '7050005016'" # provide a default value if unspecified

v300ft_shp = arcpy.GetParameterAsText(5)

v500ft_shp = arcpy.GetParameterAsText(6)

# Local variables:
#Parcel_Address = Parcels

#If layer already exist overwrite
arcpy.env.overwriteOutput=True

#Create Parcels layer
arcpy.MakeFeatureLayer_management("F:/APPDATA/GISMAPS/Projects/Planning/Requests/Bryan/2018/Planning/Teresita_care/Test_File/Parcels.shp","Parcels.lyr")

# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management("Parcels.lyr", Selection_type, Expression)

# identify the current map document

mxd = arcpy.mapping.MapDocument('CURRENT')

# identify the data frame
df = arcpy.mapping.ListDataFrames(mxd)[0]

# use the zoom to selected features method of the data frame to update the extent
df.zoomToSelectedFeatures ()

#Set Scale
df.scale = 3860

# Process: Buffer
arcpy.Buffer_analysis("Parcels.lyr", "F:/APPDATA/GISMAPS/Projects/Planning/Requests/Bryan/2018/Planning/Teresita_care/Test_File/samv300ft_shp", Distance__value_or_field_, "FULL", "ROUND", "NONE", "", "PLANAR")

#Import Symbology layer to buffer
arcpy.ApplySymbologyFromLayer_management ("samv300ft_shp", "F:/APPDATA/GISMAPS/Projects/Planning/Requests/Bryan/2018/Planning/Teresita_care/Test_File/Symbol_300ft.lyr")

# Process: Buffer (2)
arcpy.Buffer_analysis("Parcels.lyr", "F:/APPDATA/GISMAPS/Projects/Planning/Requests/Bryan/2018/Planning/Teresita_care/Test_File/samv500ft_shp", Distance__value_or_field___2_, "FULL", "ROUND", "NONE", "", "PLANAR")

#Import Symbology layer to buffer
arcpy.ApplySymbologyFromLayer_management ("samv500ft_shp", "F:/APPDATA/GISMAPS/Projects/Planning/Requests/Bryan/2018/Planning/Teresita_care/Test_File/Symbol_300ft.lyr")

import arcpy
import os
import sys
import mapping as m

# Folder containing MXD's
folder = r'F:\APPDATA\GISMAPS\Projects\Planning\Requests\Bryan\2018\Planning\Teresita_care\Test_File\Test_Script.mxd'
arcpy.env.workspace = folder

# Find and Replace text element
find_elm = 'TEXT_ELEMENT'
replace_elm = 'Text you want to replace find_elm'
# Find all .mxd files in folder
# replaces text element in mxd if it exists
for mapDoc in arcpy.ListFiles('*.mxd'):
    mxd = arcpy.mapping.MapDocument(os.path.join(folder, mapDoc))
    for elm in arcpy.mapping.ListLayoutElements(mxd, 'TEXT_ELEMENT'):
        if elm.text == find_elm:
            elm.text = replace_elm
            print 'Replaced {0} in {1}'.format(find_elm, mapDoc)
    mxd.save()
    del mxd


texts: QGIS layer.geometry.intersection() not finding intersections between layers

texts:
I wrote the following python script to find intersections between two layers, and although the two layers have intersections, it returned an empty list.

intersections = []
for a in layer1.getFeatures():
    for b in layer2.getFeatures():
        if a.geometry.intersects(b.geometry()):
            intersection = a.geometry().intersection(b.geometry())
            intersections.append(intersection.geometry().area())

The same script returns intersections if I simply try it with different shapefiles.


texts: Using SVG file to fill polygon using QGIS- problem

texts:
I try to fulfill polygon with SVG file (which created with inkscape)

but when i load the file into QGIS by this way:

i get polygon layer with no symbology:

Now, i red Using SVG from Wikipedia to fill polygon? but didn't succeed to fill the polygon.
When i use the option "RASTER IMAGE FILL" i get this unwanted result:

while in ArcGIS this exact symbology is very elegance:


texts: Georeferencer output placed in wrong location

texts:
I am using the georeferencer to align multiple Rasters. Out of 10 attempts 4 worked well, and the other 6 seem to complete, but it places the raster in the middle of the ocean (always in the same place).

Steps:

select the target (correctly aligned) raster
open georeferencer
open the mis-aligned raster
mark points on the mis-aligned raster using "from map canvas" and select same point on the target raster
go into options and set the CRS to the same CRS as the target raster.
run the georeferencer

Completes fine, layer is loaded, but not showing on map. When "zoom to layer" on the new layer, it places it out in the middle of the ocean - always the same extents.

All layers and rasters loaded are in the same CRS. Under settings/options/crs I have it to set new layers to the correct/same CRS. The target and loaded (to be aligned) rasters are all the same CRS and located adjacent to each other.

Here is the metadata from one that worked correctly:

Driver
GDAL provider
GTiff
GeoTIFF
Dataset Description
D:/Atlas/2017/Solana/Q1_2017/orthos/final/d2_flt2_aligned.tif
AREA_OR_POINT=Area
Band 1
STATISTICS_MAXIMUM=8184
STATISTICS_MEAN=6417.1849122364
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=2864.6464188394
Band 2
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=212.74360670194
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=94.814437278534
Dimensions
X: 1323 Y: 5068 Bands: 2
Origin
315336,3.64444e+06
Pixel Size
0.244643,-0.244643
No Data Value
*NoDataValue not set*
Data Type
UInt16 - Sixteen bit unsigned integer
Pyramid overviews
Layer Spatial Reference System
+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs
Layer Extent (layer original source projection)
315336.0186480708653107,3643195.5188297014683485 : 315659.6811249362654053,3644435.3687410801649094
Band
Band 1
Band No
1
No Stats
No stats collected yet
Band
Band 2
Band No
2
No Stats
No stats collected yet

Here is the metadat from one that was placed in the ocean:

Driver
GDAL provider
GTiff
GeoTIFF
Dataset Description
D:/************a_aligned.tif
AREA_OR_POINT=Area
Band 1
STATISTICS_MAXIMUM=8508
STATISTICS_MEAN=1457.6642209972
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=2982.9951333815
Band 2
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=49.187032723175
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=100.61475615584
Dimensions
X: 6540 Y: 6130 Bands: 2
Origin
-1.25767e+07,3.88515e+06
Pixel Size
0.282878,-0.282878
No Data Value
*NoDataValue not set*
Data Type
UInt16 - Sixteen bit unsigned integer
Pyramid overviews
Layer Spatial Reference System
+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs
Layer Extent (layer original source projection)
-12576677.7759907748550177,3883415.9359119967557490 : -12574827.7554864250123501,3885149.9765376332215965
Band
Band 1
Band No
1
No Stats
No stats collected yet
Band
Band 2
Band No
2
No Stats
No stats collected yet


texts: Show/hide features on layer in OpenLayers?

texts: In previous versions of OpenLayers, features on a layer could be hidden by changing visibility to 'hidden' but that does not seem to work on OpenLayers 4. How can features be modified so that we can hide them or show them? Ultimately I want to be able to show or hide features based on an event on my map.


texts: Reprojecting MODIS-Sphere ESRI GRID file to WGS84 using QGIS/GDAL

texts:
I have an ESRI GRID file projected in MODIS-Sphere (here's the dataset http://urban.yale.edu/sites/default/files/data/setoguneralphutyra_uf.zip) that I need to convert to a WGS84 GeoTIFF.

I tried Raster > Projections > Warp (Reproject) and got this nonsense:

I then thought I'd use the MODIS reprojection tool or HEG to convert it, but they only accept HDF files and using QGIS' warp or translate functions to convert this file to HDF throwns an error. This guy was trying to do the same thing in Arc, no joy:
MODIS-Sphere to WGS84 coordinate system in ArcGIS

I looked for clues in the metadata, and the file seems a little goofy; gdalinfo yields:

Driver: AIG/Arc/Info Binary Grid
Files: seto_uf
       seto_uf.aux
       seto_uf/.aux.xml
       seto_uf/.DS_Store
       seto_uf/dblbnd.adf
       seto_uf/hdr.adf
       seto_uf/log
       seto_uf/metadata.xml
       seto_uf/sta.adf
       seto_uf/vat.adf
       seto_uf/w001001.adf
       seto_uf/w001001.tif
       seto_uf/w001001.tif.aux.xml
       seto_uf/w001001x.adf
Size is 7468, 2911
Coordinate System is `'
Origin = (-17345341.010356999933720,8423784.764957003295422)
Pixel Size = (5000.000000000000000,-5000.000000000000000)
Corner Coordinates:
Upper Left  (-17345341.010, 8423784.765)
Lower Left  (-17345341.010,-6131215.235)
Upper Right (19994658.990, 8423784.765)
Lower Right (19994658.990,-6131215.235)
Center      ( 1324658.990, 1146284.765)
Band 1 Block=256x4 Type=Byte, ColorInterp=Undefined
  Description = Seto_UF
  Min=0.000 Max=101.000
  NoData Value=255

So it can't determine the coordinate system.

There's a .tif included in the directory, but gdalinfo on that shows:

Driver: GTiff/GeoTIFF
Files: w001001.tif
       w001001.tif.aux.xml
Size is 7468, 2911
Coordinate System is:
GEOGCS["Unspecified datum based upon the GRS 1980 Authalic Sphere",
    DATUM["unknown",
        SPHEROID["unnamed",6371007,1]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4047"]]
Origin = (-17345341.010356999933720,8423784.764957003295422)
Pixel Size = (5000.000000000000000,-5000.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-17345341.010, 8423784.765)
Lower Left  (-17345341.010,-6131215.235)
Upper Right (19994658.990, 8423784.765)
Lower Right (19994658.990,-6131215.235)
Center      ( 1324658.990, 1146284.765)

So it says the units are degrees but those huge corner coordinates and origin values don't agree.

Any ideas?

My setup:
OSX 10.9.4
QGIS 2.6.1 Brighton
GDAL 1.11.2 (apparently there are newer versions but this is the latest you can get on OSX without having to compile it yourself)