GME

Geospatial Modelling Environment

setspatialreference (Set Default Spatial Reference)

Sets the default spatial reference to use when creating new feature classes that are not based on existing geodatasets

Description

This command sets a default spatial reference to use when creating new datasets that are not based on existing datasets. For most GME commands, when new datasets are created the spatial reference of the new layer is derived from the spatial reference of the input layers (e.g. when creating a kernel density raster, the spatial reference of the output raster is acquired from the input point dataset). A few commands, however, can be run without reference to any other datasets (e.g. the genvecgrid command with the extent option). In these cases, if no default spatial reference is already defined then the output dataset is just assigned as an unknown coordinate system. Geodatabases, however, require that a spatial reference is explicitly defined. Setting the default spatial reference with this command allows you to generate output to geodatabases for the subset of commands that cannot automatically determine an appropriate spatial reference from input data.

There are three options for setting the spatial reference (use only one of them). The spatial reference can be acquired from an existing vector dataset (the vector parameter), an existing raster dataset (the raster parameter), or from a projection text file (these are normally found here: C:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems).

Syntax

setspatialreference([vector], [raster], [prj]);

[vector]acquires the default spatial reference from a vector dataset
[raster]acquires the default spatial reference from a raster dataset
[prj]acquires the default spatial reference from projection file (*.prj)

Example

setspatialreference(vector="C:\data\parcels.shp");

setspatialreference(raster="C:\data\landcover.img");

setspatialreference(prj="C:\data\UTMZn13NWGS84.prj");


Messages

Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently  Read more...

Links

Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn