Monday, December 4, 2017

GIS Concepts,Shp files,Google Maps API

Work in progress



COMPONENTS OF GIS:                                                 
1) H/W                        
2) S/W,                                   
3) Knowledge                        
4) Data                                              
5) Network

 MAP ELEMENTS :                                                                


  1. Legend                   
  2.  Scale                                          
  3. North Arrow                                                                               
  4. Title                                                                                   
  5. Date created or updated                                       
  6. Author or organizations

TYPES OF DATA 

VECTOR DATA : Discrete representation of geospatial features as co-ordinates pairs(x,y)

  • Feature classes
  • Point
  • Polygon
  • Line: 
  • are stored in geodatabase,csv ,shape file ,imagary file ,.tif/feature class
  • imagary[raster data]

RASTER DATA : Each pixal represent some portion of earth 


  • coarse grained data ,low raster resolution 
  • fined grained data : high resolution


GEOCODINGMapping locations on earth to co -ordinates 

MAPPING CO-ORDINATES TO PROVIDE REGULAR AND CONSISTENT METHODS TO QUANITFY LOCATION OF OBJECTS AND THEIR SPATIAL RELATIONSHIPS  

GEO REFERNCING


DATA QUERY
ATTRIBUTE QUERY

SPATIAL QUERY

LAYERS

TOPOLOGY

  1. The study of geometric properties and spatial relations unaffected by the continuous change of shape or size of figures.
  2. Rules that define how geographical elements interact with each other

TYPES OF SCALES

VERBAL0-99 ,99-100 ETC


GRAPHICAL :  GRADUATED COLOR SCALES



TYPES OF MAPS
  1. THEMATIC MAPS  BASE LAYER ARE SHOWN USING GRADUATED COLOR/SYMBOLS        
  2. CHORORPLETH INTEGRAL DATA  
     in which areas are shaded or patterned in proportion to the measurement of the statistical variable being displayed on the map, such as population density or per-capita income. Choropleth maps can also be used to display nominal data such as country names on a world map or most popular car model per region.
      
                                    
  3. ISOPLETH    [    CALIFORNIA WIND MAP]                           
  4. PROPORTIONAL SYMBOL
    The proportional symbol technique uses symbols of different sizes to represent data associated with different areas or locations within the map. For example, a disc may be shown at the location of each city in a map, with the area of the disc being proportional to the population of the city.: UNION PACIFIC  PIE CHARTS
  5. FLOW MAP [
    These maps depict in detail ground relief (landforms and terrain), drainage (lakes and rivers), forest cover, administrative areas, populated areas, transportation routes and facilities (including roads and railways), and other man-made features.
    ] 
  6.  CARTOGRAMS  [AREAS PROPORTIONAL TO DATA LIKE NUMBER OF WALMARTS ]   

  1. TOPOGRAPHY : These maps depict in detail ground relief (landforms and terrain), drainage (lakes and rivers), forest cover, administrative areas, populated areas, transportation routes and facilities (including roads and railways), and other man-made features.




Importing Shape Data to DB


Geometric data types:
  • POINT(0 0)
  • LINESTRING(0 0,1 1,1 2)
  • POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))
  • MULTIPOINT(0 0,1 2)
  • MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))
  • MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))
  • GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))

http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut02

https://postgis.net/docs/manual-1.4/ch04.html#RefObject


Add following extensions to DB
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- Enable PostGIS Advanced 3D 
-- and other geoprocessing algorithms
-- sfcgal not available with all distributions
CREATE EXTENSION postgis_sfcgal;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- rule based standardizer
CREATE EXTENSION address_standardizer;
-- example rule data set
CREATE EXTENSION address_standardizer_data_us;
-- Enable US Tiger Geocoder                                            
RUS POSTGIS IMPORT/EXPORT MANAGER
ESTABLISH CONNECTION TO DB
IMPORT THE SHAPE FILE ,YOU CAH MODIFY OPTIONS IF YOU LIKE
RUN IMPORT
--------------------------------------------------

Google Maps API

google.maps.Map class

 var  map = new google.maps.map(div,mapOptions)

google.maps.Latlong(a,b)

google.maps.map(div,{
mapTypeId: google.maps.MapTypeId.ROADMAP|SATELLITE|HYBRID|TERRAIN
center: Initial Center,
zoom:8
zoomControl
zoomControlOptions
draggable: false
zoomControl:false
clickableIcons:false
fullscreenControl
mapTypeControl
mapTypeControlOptions
panControl
panControlOptions
rotateControl
rotateControlOptions
streetView
streetViewControl
streetViewControlOptions
tilt

})
google.maps.MapTypeId.ROADMAP|SATELLITE|TERRAN|HYBRID
gogle.maps.marker
google.maps.MapTypeId.ROADMAP|SATELLITE|HYBRID|TERRAIN
  • ROADMAPdisplays normal street map
  • SATELLITEdisplays satellite images
  • HYBRIDTransparent layer of major streets on satellite images
  • TERRAIN:  terrain+vegetation
Layers on Google Map

Maps

Map class

google.maps.Map class
This class extends MVCObject.
Constructor
Map
Map(mapDiv[, opts])
Parameters:
  • mapDiv:  Element
  • opts (optional):  MapOptions
Creates a new map inside of the given HTML container, which is typically a DIV element.
Methods
fitBounds
fitBounds(bounds[, padding])
Parameters:
Return Value:  None
Sets the viewport to contain the given bounds.
Note: When the map is set to display: none, the fitBounds function reads the map's size as 0x0, and therefore does not do anything. To change the viewport while the map is hidden, set the map to visibility: hidden, thereby ensuring the map div has an actual size.
getBounds
getBounds()
Parameters:  None
Return Value:  LatLngBounds
Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized (i.e. the mapType is still null), or center and zoom have not been set then the result is null or undefined.
getCenter
getCenter()
Parameters:  None
Return Value:  LatLng
Returns the position displayed at the center of the map. Note that this LatLng object is notwrapped. See LatLng for more information.
getClickableIcons
getClickableIcons()
Parameters:  None
Return Value:  boolean
Returns the clickability of the map icons. A map icon represents a point of interest, also known as a POI. If the returned value is true, then the icons are clickable on the map.
getDiv
getDiv()
Parameters:  None
Return Value:  Element
getHeading
getHeading()
Parameters:  None
Return Value:  number
Returns the compass heading of aerial imagery. The heading value is measured in degrees (clockwise) from cardinal direction North.
getMapTypeId
getMapTypeId()
Parameters:  None
Return Value:  MapTypeId|string
getProjection
getProjection()
Parameters:  None
Return Value:  Projection
Returns the current Projection. If the map is not yet initialized (i.e. the mapType is still null) then the result is null. Listen to projection_changed and check its value to ensure it is not null.
getStreetView
getStreetView()
Parameters:  None
Return Value:  StreetViewPanorama
Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView(). Changes to the map's streetViewControl will be reflected in the display of such a bound panorama.
getTilt
getTilt()
Parameters:  None
Return Value:  number
Returns the current angle of incidence of the map, in degrees from the viewport plane to the map plane. The result will be 0 for imagery taken directly overhead or 45 for 45° imagery. 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: This method does not return the value set by setTilt. See setTilt for details.
getZoom
getZoom()
Parameters:  None
Return Value:  number
panBy
panBy(x, y)
Parameters:
  • x:  number
  • y:  number
Return Value:  None
Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values).
panTo
panTo(latLng)
Parameters:
Return Value:  None
Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.
panToBounds
panToBounds(latLngBounds[, padding])
Parameters:
Return Value:  None
Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}.
setCenter
setCenter(latlng)
Parameters:
Return Value:  None
setClickableIcons
setClickableIcons(value)
Parameters:
  • value:  boolean
Return Value:  None
Controls whether the map icons are clickable or not. A map icon represents a point of interest, also known as a POI. To disable the clickability of map icons, pass a value of false to this method.
setHeading
setHeading(heading)
Parameters:
  • heading:  number
Return Value:  None
Sets the compass heading for aerial imagery measured in degrees from cardinal direction North.
setMapTypeId
setMapTypeId(mapTypeId)
Parameters:
Return Value:  None
setOptions
setOptions(options)
Parameters:
Return Value:  None
setStreetView
setStreetView(panorama)
Parameters:
Return Value:  None
Binds a StreetViewPanorama to the map. This panorama overrides the default StreetViewPanorama, allowing the map to bind to an external panorama outside of the map. Setting the panorama to null binds the default embedded panorama back to the map.
setTilt
setTilt(tilt)
Parameters:
  • tilt:  number
Return Value:  None
Controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45setTilt(0) causes the map to always use a 0° overhead view regardless of the zoom level and viewport. setTilt(45) causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note:getTilt returns the current tilt angle, not the value set by setTilt. Because getTilt and setTilt refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects.
setZoom
setZoom(zoom)
Parameters:
  • zoom:  number
Return Value:  None
Properties
controls
Type:  Array<MVCArray>
Additional controls to attach to the map. To add a control to the map, add the control's 
 to the MVCArray corresponding to the ControlPosition where it should be rendered.
data
Type:  Data
An instance of Data, bound to the map. Add features to this Data object to conveniently display them on this map.
mapTypes
Type:  MapTypeRegistry
A registry of MapType instances by string ID.
overlayMapTypes
Type:  MVCArray<MapType>
Additional map types to overlay. Overlay map types will display on top of the base map they are attached to, in the order in which they appear in the overlayMapTypes array (overlays with higher index values are displayed in front of overlays with lower index values).
Events
bounds_changed
function()
Arguments:  None
This event is fired when the viewport bounds have changed.
center_changed
function()
Arguments:  None
This event is fired when the map center property changes.
click
function(event)
Arguments:
This event is fired when the user clicks on the map. An ApiMouseEvent with properties for the clicked location is returned unless a place icon was clicked, in which case an IconMouseEvent with a placeid is returned. IconMouseEvent and ApiMouseEvent are identical, except that IconMouseEvent has the placeid field. The event can always be treated as an ApiMouseEvent when the placeid is not important. The click event is not fired if a marker or infowindow was clicked.
dblclick
function(event)
Arguments:
This event is fired when the user double-clicks on the map. Note that the click event will also fire, right before this one.
drag
function()
Arguments:  None
This event is repeatedly fired while the user drags the map.
dragend
function()
Arguments:  None
This event is fired when the user stops dragging the map.
dragstart
function()
Arguments:  None
This event is fired when the user starts dragging the map.
heading_changed
function()
Arguments:  None
This event is fired when the map heading property changes.
idle
function()
Arguments:  None
This event is fired when the map becomes idle after panning or zooming.
maptypeid_changed
function()
Arguments:  None
This event is fired when the mapTypeId property changes.
mousemove
function(event)
Arguments:
This event is fired whenever the user's mouse moves over the map container.
mouseout
function(event)
Arguments:
This event is fired when the user's mouse exits the map container.
mouseover
function(event)
Arguments:
This event is fired when the user's mouse enters the map container.
projection_changed
function()
Arguments:  None
This event is fired when the projection has changed.
rightclick
function(event)
Arguments:
This event is fired when the DOM contextmenu event is fired on the map container.
tilesloaded
function()
Arguments:  None
This event is fired when the visible tiles have finished loading.
tilt_changed
function()
Arguments:  None
This event is fired when the map tilt property changes.
zoom_changed
function()
Arguments:  None
This event is fired when the map zoom property changes.

MapOptions interface

google.maps.MapOptions interface
MapOptions object used to define the properties that can be set on a Map.
Properties
backgroundColor
Type:  string
Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans. This option can only be set when the map is initialized.
center
The initial Map center. Required.
clickableIcons
Type:  boolean
When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI. By default map icons are clickable.
disableDefaultUI
Type:  boolean
Enables/disables all default UI. May be overridden individually.
disableDoubleClickZoom
Type:  boolean
Enables/disables zoom and center on double click. Enabled by default.
Note: This property is not recommended. To disable zooming on double click, you can use the gestureHandling property, and set it to "none".
draggable
Type:  boolean
If false, prevents the map from being dragged. Dragging is enabled by default.
Note: This property is deprecated. To disable dragging on the map, you can use the gestureHandling property, and set it to "none".
draggableCursor
Type:  string
The name or url of the cursor to display when mousing over a draggable map. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggableCursor: 'url(http://www.example.com/icon.png), auto;'.
draggingCursor
Type:  string
The name or url of the cursor to display when the map is being dragged. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggingCursor: 'url(http://www.example.com/icon.png), auto;'.
fullscreenControl
Type:  boolean
The enabled/disabled state of the Fullscreen control.
fullscreenControlOptions
The display options for the Fullscreen control.
gestureHandling
Type:  string
This setting controls how the API handles gestures on the map. Allowed values:
  • "cooperative": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map.
    In this mode the map cooperates with the page.
  • "greedy": All touch gestures and scroll events pan or zoom the map.
  • "none": The map cannot be panned or zoomed by user gestures.
  • "auto": (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or in an iframe.
heading
Type:  number
The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available.
keyboardShortcuts
Type:  boolean
If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default.
mapTypeControl
Type:  boolean
The initial enabled/disabled state of the Map type control.
mapTypeControlOptions
The initial display options for the Map type control.
mapTypeId
Type:  MapTypeId|string
The initial Map mapTypeId. Defaults to ROADMAP.
maxZoom
Type:  number
The maximum zoom level which will be displayed on the map. If omitted, or set to null, the maximum zoom from the current map type is used instead. Valid values: Integers between zero, and up to the supported maximum zoom level.
minZoom
Type:  number
The minimum zoom level which will be displayed on the map. If omitted, or set to null, the minimum zoom from the current map type is used instead. Valid values: Integers between zero, and up to the supported maximum zoom level.
noClear
Type:  boolean
If true, do not clear the contents of the Map div.
panControl
Type:  boolean
The enabled/disabled state of the Pan control.
Note: The Pan control is not available in the new set of controls introduced in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you can choose to use the earlier set of controls rather than the new controls, thus making the Pan control available as part of the old control set. See What's New in the v3.22 Map Controls.
panControlOptions
The display options for the Pan control.
Note: The Pan control is not available in the new set of controls introduced in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you can choose to use the earlier set of controls rather than the new controls, thus making the Pan control available as part of the old control set. See What's New in the v3.22 Map Controls.
rotateControl
Type:  boolean
The enabled/disabled state of the Rotate control.
rotateControlOptions
The display options for the Rotate control.
scaleControl
Type:  boolean
The initial enabled/disabled state of the Scale control.
scaleControlOptions
The initial display options for the Scale control.
scrollwheel
Type:  boolean
If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.
Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none".
streetView
StreetViewPanorama to display when the Street View pegman is dropped on the map. If no panorama is specified, a default StreetViewPanorama will be displayed in the map's div when the pegman is dropped.
streetViewControl
Type:  boolean
The initial enabled/disabled state of the Street View Pegman control. This control is part of the default UI, and should be set to false when displaying a map type on which the Street View road overlay should not appear (e.g. a non-Earth map type).
streetViewControlOptions
The initial display options for the Street View Pegman control.
styles
Type:  Array<MapTypeStyle>
Styles to apply to each of the default map types. Note that for satellite/hybrid and terrainmodes, these styles will only apply to labels and geometry.
tilt
Type:  number
Controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note:getTilt returns the current tilt angle, not the value specified by this option. Because getTiltand this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects.
zoom
Type:  number
The initial Map zoom level. Required. Valid values: Integers between zero, and up to the supported maximum zoom level.
zoomControl
Type:  boolean
The enabled/disabled state of the Zoom control.
zoomControlOptions
The display options for the Zoom control.

MapTypeStyle interface

google.maps.MapTypeStyle interface
The MapTypeStyle is a collection of selectors and stylers that define how the map should be styled. Selectors specify the map features and/or elements that should be affected, and stylers specify how those features and elements should be modified. For details, see the style reference.
Properties
elementType
Type:  string
The element to which a styler should be applied. An element is a visual aspect of a feature on the map. Example: a label, an icon, the stroke or fill applied to the geometry, and more. Optional. If elementType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference.
featureType
Type:  string
The feature, or group of features, to which a styler should be applied. Optional. If featureType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference.
stylers
Type:  Array
The style rules to apply to the selected map features and elements. The rules are applied in the order that you specify in this array. For guidelines on usage and allowed values, see the style reference.

MouseEvent interface

google.maps.MouseEvent interface
This object is returned from various mouse events on the map and overlays, and contains all the fields shown below.
Methods
stop
stop()
Parameters:  None
Return Value:  None
Prevents this event from propagating further.
Properties
latLng
Type:  LatLng
The latitude/longitude that was below the cursor when the event occurred.

IconMouseEvent interface

google.maps.IconMouseEvent interface
This object is sent in an event when a user clicks on an icon on the map. The place ID of this place is stored in the placeId member. To prevent the default info window from showing up, call the stop() method on this event to prevent it being propagated. Learn more about place IDs in the Places API developer guide.
This interface extends MouseEvent.
Properties
placeId
Type:  string
The place ID of the place that was clicked. This place ID can be used to query more information about the feature that was clicked.
Learn more about place IDs in the Places API developer guide.

MapTypeId constants

google.maps.MapTypeId constants
Identifiers for common MapTypes. Specify these by value, or by using the constant's name. For example, 'satellite'or google.maps.MapTypeId.SATELLITE.
Constants
HYBRIDThis map type displays a transparent layer of major streets on satellite images.
ROADMAPThis map type displays a normal street map.
SATELLITEThis map type displays satellite images.
TERRAINThis map type displays maps with physical features such as terrain and vegetation.

MapTypeRegistry class

google.maps.MapTypeRegistry class
A registry for MapType instances, keyed by MapType id.
This class extends MVCObject.
Constructor
MapTypeRegistry
MapTypeRegistry()
Parameters:  None
The MapTypeRegistry holds the collection of custom map types available to the map for its use. The API consults this registry when providing the list of avaiable map types within controls, for example.
Methods
set
set(id, mapType)
Parameters:
  • id:  string
  • mapType:  MapType|*
Return Value:  None
Sets the registry to associate the passed string identifier with the passed MapType.

TrafficLayer class

google.maps.TrafficLayer
google.maps.TrafficLayerOptions
google.maps.TransitLayer
google.maps.BicyclingLayer

Google MapsGoogle Maps OverviewAn Introduction to Google MapsTypes Of Google MapsZoom Of Google MapsGoogle Maps LocalizationGoogle Maps User Interface ControlsGoogle Maps MarkersDifferent Shapes Of Google MapsInfo Window Of Google MapsSymbols Used In Google MapsGoogle Maps Events



No comments:

Post a Comment