300x250 AD TOP

Flexible Home Layout

Join This Site On Google Friend

Quem sou eu

My Photo
from Black still Gray, want to be White

Movie Category 5

Movie Category 4

Sub menu section

Main menu section

Comments

Contact Us

Name

Email *

Message *

Powered by Blogger.

7/22/10

Tagged under: , ,

Create a selection theme and "reverse selection theme."

Product: MapXtreme Java
Version: 4.5
Platform: Not Platform Related
Category: Code Samples

Summary:
Create a selection theme and "reverse selection theme."

Question:
This code sample creates a selection theme on the selected feature, and a second selection theme on all other features in the layer.

Answer:

// Assumptions
// selectedLayer is type Layer & represents the layer the selections are being created on
// mapj is type MapJ
// columnName is type String & represents a column name of the layer data

selectedLayer.setSelectable(true);
selectedLayer.getThemeList().removeAll();

// define a selection obj & selection theme rendition for the NON-SELECTED features
Selection sel1 = new Selection();
SelectionTheme nonselectedTheme = new SelectionTheme("non-selected features");
Rendition nonselThemeRend = new RenditionImpl();
nonselThemeRend.setValue(Rendition.FILL, Color.blue);
nonselectedTheme.setRendition(nonselThemeRend);
nonselectedTheme.setSelection(sel1);

// define a selection obj and selection theme rendition for the SELECTED features
Selection sel2 = new Selection();
SelectionTheme selectedTheme = new SelectionTheme("selected feature");
Rendition selThemeRend = new RenditionImpl();
selThemeRend.setValue(Rendition.FILL, Color.yellow);
selectedTheme.setRendition(selThemeRend);
selectedTheme.setSelection(sel2);

// get all the features from this layer and add them to the selection object
// add the theme to the theme list
// dispose of the feature set then get the feature the user clicked on...
// ... and remove it from the selection
FeatureSet fsAll = null;
FeatureSet fsAtPoint = null;
RewindableFeatureSet rwFs = null;
ArrayList colNames = new ArrayList();
colNames.add(columnName);
try
{
fsAll = selectedLayer.searchAll(colNames, null);
sel1.add(fsAll);
selectedLayer.getThemeList().add(nonselectedTheme);
selectedLayer.getThemeList().add(selectedTheme);
fsAll.dispose();

fsAtPoint = selectedLayer.searchAtPoint(colNames, dp,null);
rwFs = new RewindableFeatureSet(fsAtPoint);
Feature ft = rwFs.getNextFeature();
rwFs.rewind();
sel1.remove(ft);
sel2.add(rwFs);
}
catch(Exception e)
{
e.printStackTrace();
}

SOURCE

7/19/10

Tagged under: ,

How to find Qibla Direction ?

Used a google map Technolgy that has been implemented on Qibla Locator.

7/18/10

Tagged under: ,

Merge two or more Shapefiles or TAB files

GeoMerge is a geoprocessing utility that allows you to merge two or more shapefiles or TAB files into a single shapefile.

Select two or more shapefiles or TAB files that are to be merged, and click the 'Merge Files' button. The files will be validated for a common schema. If all of the files selected have exactly the same column definitions in the .dbf file the records and shapes from each individual file will be concatenated into a new shapefile.

Features

GeoMerge currently supports the following formats without conversion:

  • ESRI Shapefile
  • MapInfo TAB


GeoMerge is FREE for Internet Download! Just download and run the GeoMerge.exe file to start the installation procedure, then follow the instructions displayed on your screen.
Download

File:


Version: 1.0.1

Size: 580 KB




Tagged under:

How to set up XY Coordinate System

For Shape File:
  1. Use ArcCatalog
  2. Open the file (shape), connecting the Folder if there is not yet connected.
  3. Right Click on Shape File name in TOC and Choose "Properties"
  4. Click Select Button
  5. Choose Coordinate System,
example : Coordinate Systems > Geographic Coordinate Systems >North America >
NAD 1983 (CRS)

another source :