public void AddUpdateAttributeField(string oldFeatureFile)
{
DriverUtils.RegisterOgrDriver();
DataSource dataSource;
Layer layer;
var isShapeFile = IsShapeInGdb(oldFeatureFile);
if (isShapeFile)
{
dataSource = Ogr.Open(oldFeatureFile, 1); //second argument in open specifies mode of data, 1 RW & 0 readonly mode
layer = dataSource.GetLayerByIndex(0);
FieldDefn gdalFiedlDefn = new FieldDefn("FID_GDAL",FieldType.OFTInteger);
layer.CreateField(gdalFiedlDefn, 0);
Feature feature = layer.GetNextFeature();
while (feature!= null)
{
feature.SetField("FID_GDAL",feature.GetFID()); // Add FID shapefile
layer.SetFeature(feature);
feature = layer.GetNextFeature();
}
dataSource.FlushCache();
}
else
{
try
{
EnableEsriLiscences();
string gdbPath = Path.GetDirectoryName(oldFeatureFile);
string featureName = Path.GetFileNameWithoutExtension(oldFeatureFile);
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactory();
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspaceFactory.OpenFromFile(gdbPath, 1);
IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(featureName);
IFields fields = featureClass.Fields;
if (fields.FindField("FID_GDAL") == -1)
{
// Create a Int field called "FID_GDAL" for the fields collection
Thursday, January 19, 2017
Code snippet : Create/update polygon attribute fields using Ogr and ESRI Arcobjects
A code snippet example to check if a feature is standalone ESRI Shape or featureclass inside ESRI Gdb, then add new filed or update attribute value in attribute table .... standalone shape/features are created/updated using GDAL/OGR implementation and feature/featureclass stored in ESRI personal GDB are created/updated using ESRI ArcObjects. Any solution to replace later with GDAL/Ogr is highly appreciated. Please comment below if you find one.
Friday, January 13, 2017
Code snippet: Create new Field in a Shape File using GDAL/OGR in C#
Add new field in existing shape file using OGR in C#.
public void AddAttributeField(string oldShapeFile)
{
Ogr.RegisterAll();
DataSource dataSource = Ogr.Open(oldShapeFile, 1); //second argument in open specifies mode of data, 1 RW & 0 readonly mode
Layer layer = dataSource.GetLayerByIndex(0);
FieldDefn gdalFiedlDefn = new FieldDefn("NEW_FIELD",FieldType.OFTInteger);
layer.CreateField(gdalFiedlDefn, 1);
Feature feature = layer.GetNextFeature();
while (feature!= null)
{
feature.SetField("NEW_FIELD",feature.GetFID()); // Populate new field with feature FID
layer.SetFeature(feature);
feature = layer.GetNextFeature();
}
dataSource.FlushCache();
}
Friday, December 30, 2016
ESRI FeatureClass vs Feature Layer
Feature Layer: A layer that references a set of feature data. Feature data represents geographic entities as points, lines, and polygons.
Feature Class:In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Feature classes can be stored in geodatabases, shapefiles, coverages, or other data formats. Feature classes allow homogeneous features to be grouped into a single unit for data storage purposes. For example, highways, primary roads, and secondary roads can be grouped into a line feature class named "roads." In a geodatabase, feature classes can also store annotation and dimensions.
Rasterized Feature Layer: A feature layer in ArcGlobe that exists as points, lines and polygons but is rendered as cell data. When layers are added to ArcGlobe, they may automatically be rendered in raster format to retain their cartographic symbology.
Feature Class:In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Feature classes can be stored in geodatabases, shapefiles, coverages, or other data formats. Feature classes allow homogeneous features to be grouped into a single unit for data storage purposes. For example, highways, primary roads, and secondary roads can be grouped into a line feature class named "roads." In a geodatabase, feature classes can also store annotation and dimensions.
Rasterized Feature Layer: A feature layer in ArcGlobe that exists as points, lines and polygons but is rendered as cell data. When layers are added to ArcGlobe, they may automatically be rendered in raster format to retain their cartographic symbology.
Monday, December 12, 2016
Register Database to ArcGIS server
There are two methods to register Database to ArcGIS Server
A) Register via ArcGIS Desktop
B) Register via ArcGIS Server Manager Web Interface
SOURCE: http://gisdeveloper.blogspot.com/2014_04_01_archive.html ( Copied here for my future reference)
REGISTER DATABASE TO ARCGIS SERVER
While publishing data (from database) to ArcGIS server it gives you a warning that
A) Register via ArcGIS Desktop
- Double click to ensure ArcGIS Server Instance is connected to ArcGIS Desktop
- Right Click to Publisher connection to ArcGIS Server
- Then Click ArcGIS Server Properties to open ArcGIS Server Properies
- Add Data Store in Registered Databases
B) Register via ArcGIS Server Manager Web Interface
SOURCE: http://gisdeveloper.blogspot.com/2014_04_01_archive.html ( Copied here for my future reference)
REGISTER DATABASE TO ARCGIS SERVER
While publishing data (from database) to ArcGIS server it gives you a warning that
24011: Data source is not registered with the server and data will be copied to the server
How to resolve this ??
Well there are different approaches, here is the one which i followed. But before doing anything Please Note:
Note: The client side libraries need to be copied to ArcGIS server's bin folder. What does this mean ??
Well you have to copy the libraries (obtained from esri's customer portal Or simply google it "PostgreSQLClientLibs922" Or PostgreSQL libraries for ArcGIS server)
Copy the correct version of libraries to
C:\Program Files\ArcGIS\Server\bin
Note to see the correct version of libraries click here.
Now,
Note: The client side libraries need to be copied to ArcGIS server's bin folder. What does this mean ??
Well you have to copy the libraries (obtained from esri's customer portal Or simply google it "PostgreSQLClientLibs922" Or PostgreSQL libraries for ArcGIS server)
Copy the correct version of libraries to
C:\Program Files\ArcGIS\Server\bin
Note to see the correct version of libraries click here.
Now,
- Open ArcGIS server Manager from (prefer Internet Explorer)http://localhost:6080/arcgis/manager/site.html
- Sign in to your ArcGIS server account
- On home Page under Directories tab click on Data Store
- Click on Registered Database
Monday, December 5, 2016
Postgresql tips
Start to postgresql : sudo -u postgres psql postgres
Connect to database : \connect database_name
Drop all tables from a database: drop schema public cascade;
List all databases :
\list
or\l
: list all databases\dt
: list all tables in the current database
\q
and then press ENTER
to quit psql
Connect to database : \connect database_name
Drop all tables from a database: drop schema public cascade;
Tuesday, November 22, 2016
American Association of Geographers' Annual Meeting2017
American Association of Geographers' Annual Meeting in Boston, MA
Welcome to Boston
2017 AAG Annual Meeting
April 5-9, 2017
Hynes Convention Center
Welcome to the 2017 American Association of Geographers' Annual Meeting in Boston, MA! You will be joined by fellow geographers, GIS specialists, environmental scientists, and other leaders for the latest in research and applications in geography, sustainability, and GIScience. The meeting will be held from April 5-9, 2017, and will feature over 6,600 presentations, posters, workshops, and field trips by leading scholars, experts, and researchers.
The 2017 Meeting will be headquartered at the Hynes Convention Center, located in the Back Bay neighborhood of Boston. Sessions and events will also take place at the official 2017 AAG Meeting hotels: the Sheraton Boston and the Marriott Copley Place. The additional meeting venues are located steps away from the Hynes Convention Center.
Featured Themes
Each year, the AAG identifies a few themes for its Annual Meeting to help focus discussion and provide a fresh and engaging structure to the conference program. Of course, attendees are also invited to develop themes relevant to the meeting's location or influenced by political and intellectual trends within the discipline. As always, any topic relevant to geography is welcome at the AAG Annual Meeting.
The Featured Themes for the 2017 Annual Meeting are:
The Featured Themes for the 2017 Annual Meeting are:
- Geographies of Bread and Water in the 21st Century
- Mainstreaming Human Rights in Geography and at the AAG
- Uncertainty and Context in Geography and GIScience
American Geophysical Union Fall Meeting 2016
Announcements
With approximately 24,000 attendees in 2015, AGU’s Fall Meeting is the largest Earth and space science meeting in the world. This year will mark Fall Meeting’s 49th year as the premiere place to present your research; hear about the latest discoveries, trends, and challenges in the field; and network with colleagues that can enhance your career.
Fall Meeting sessions are held at the Moscone Convention Center. The center is located at the edge of the city’s dynamic South of Market district and just four blocks from Union Square, the city’s vibrant shopping district, and the Powell Street cable car to Nob Hill, Chinatown, and Fisherman’s Wharf.
Fall Meeting brings together the entire Earth and space science community from across the globe for discussions of emerging trends and the latest research. The technical program includes presentations on new and cutting-edge science, much of which has not yet been published, meaning you’ll return to work with knowledge you can’t get anywhere else.
With more than 1,700 sessions in 2015, Fall Meeting’s scientific program spans the Earth and space sciences, offering something for everyone no matter their scientific discipline. The meeting offers a unique mix of more than 20,000 oral and poster presentations, a broad range of keynote lectures, various types of formal and informal networking and career advancement opportunities, and an exhibit hall packed with hundreds of exhibitors showcasing new and relevant research tools and services that meet the professional needs of our attendees year after year. Join us in 2016 for another dynamic experience.
About Fall Meeting
Fall Meeting is the largest worldwide conference in the geophysical sciences, attracting more than 24,000 Earth and space scientists, educators, students, and other leaders. Now in its 49th year, Fall Meeting brings together the entire Earth and space science community from across the globe for discussions of emerging trends and the latest research. The technical program includes presentations on new and cutting-edge science, much of which has not yet been published, meaning you’ll return to work with knowledge you can’t get anywhere else.
Fall Meeting offers a unique mix of more than 20,000 oral and poster presentations, a broad range of keynote sessions, various types of formal and informal networking and career advancement opportunities, and an exhibit hall packed with hundreds of exhibitors showcasing new and relevant research tools and services that meet the professional needs of our attendees’ year after year.
International Conference on Advances in Geographic Information Systems 2016
24th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems (ACM SIGSPATIAL 2016) Annoucements
Monday October 31 - Thursday November 3, 2016 — San Francisco Airport Marriott Waterfront, California, USA
The ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems 2016 (ACM SIGSPATIAL 2016) is the twenty-fourth event in a series of symposia and workshops that began in 1993 with the aim of bringing together researchers, developers, users, and practitioners in relation to novel systems based on geo-spatial data and knowledge, and fostering interdisciplinary discussions and research in all aspects of geographic information systems. The conference provides a forum for original research contributions covering all conceptual, design, and implementation aspects of geospatial data ranging from applications, user interfaces, and visualization to data storage and query processing and indexing. The conference is the premier annual event of the ACM Special Interest Group on Spatial Information (ACM SIGSPATIAL). Researchers, students, and practitioners are invited to submit their contributions to ACM SIGSPATIAL 2016.
2017 Esri Developer Summit
2017 ESRI Developer Summit Announcements
The ESRI DevSummit has everything you need for building next-generation apps with advanced mapping and analysis tools from Esri. For developer, by developers is going to held on March 7-10, 2017, Palm Springs Convention Center.
Following Tech stack will cover during the summit -
Discover ways to better leverage your GIS investment, and test-drive ArcGIS on a variety of devices. Streamline how you build native applications with ArcGIS Runtime SDKs. Plus, bounce ideas and challenges off the staff responsible for building and implementing Runtime SDKs.
Desktop Development
Explore best practices for development patterns, prolem solving, deployment challenges, and platform integration. Then get your questions answered by the people responbible for building and deploying apps with ArcObjects, Python, and the ArcGIS SDK for the Microsoft. NET framework.
International Conference for Free and Open Source Software for Geospatial - FOSS4G 2017
FOSS4G Boston 2017 Announcements
The annual FOSS4G conference is the largest global gathering focused on open source geospatial software. FOSS4G brings together developers, users, decision-makers and observers from a broad spectrum of organizations and fields of operation. Through six days of workshops, presentations, discussions, and cooperation, FOSS4G participants create effective and relevant geospatial products, standards, and protocols.
FOSS4G has been held all over the world and draws attendees from over 40 countries. Bonn, Germany hosted the conference in 2016. In 2017, Boston, Massachusetts, USA will host on August 14-19, 2017
Subscribe to:
Posts
(
Atom
)