Working with Garmin Data Cards

You have the option to transfer all data types in MapSource to a removable storage card. The storage card accepts all data types, but only some Garmin GPS devices are capable of reading all data types. All Garmin GPS devices, however, are capable of reading the map data.
The following are possible scenarios when transferring MapSource data. NOTE: Not all data transfer options will be available in MapSource unless you own the specific GPS device:
  • Transferring only maps to the storage card: The storage card is completely erased before adding new maps.
  • Transferring maps as well as other data (waypoints, routes, and tracks): The storage card is completely erased before adding new maps, waypoints, routes, and tracks to the storage card.
  • Transferring only waypoints, routes, and tracks (no maps): There are two scenarios. 1) If the data card currently has maps stored on it, the maps stay on the storage card and the other data is erased and replaced with new data. 2) If the data card contains no maps, the storage card is completely erased and replaced with new data.
NOTE: Preloaded (pre-programmed) BlueChart or Fishing Hot Spots data cards should not be used in the USB Programmer or in a GPS device for saving MapSource maps. The preloaded data will be lost. If you have a BlueChart or Fishing Hot Spots data card in your GPS device, remove it before transferring maps sets to avoid losing the preloaded data. If you choose to overwrite the preloaded data on a BlueChart or Fishing Hot Spots data card, Garmin will not replace or recover the lost data.

Transferring and Saving MapSource Data For GPS GARMIN

Map Sets, waypoints, routes, and tracks can be transferred from MapSource to a Garmin device or from a Garmin device to MapSource.
NOTE: For information on connecting your GPS or other Garmin device to your computer, refer to your unit's Owner's Manual. Always check your GPS Owner's Manual to verify which data transfer options are available.
Data can be transferred in a variety of methods, as shown in the list below:
  • To the internal memory of a Garmin GPS device, which accepts all data types: maps, waypoints, routes, and tracks. You can transfer through a Serial Port or a USB Port (if applicable).
  • To a Storage Card in a Garmin GPS Device via a serial or USB port (if applicable). The storage card accepts all data types, but only some Garmin GPS devices are capable of reading all data types.
  • To a Garmin storage card in a Garmin USB data card programmer. Some GPS devices will accept all data types, but most only accept map data.
  • To a non-Garmin storage card in a Card Reader connected to your computer. Depending on what your Garmin GPS Device supports, the available card types are Compact Flash (CF) or Secure Digital (SD) Cards. Only map data may be transferred.
  • To a Secure Digital (SD) Card in a Garmin iQue or to the unit’s internal memory. Only maps may be transferred from MapSource to the iQue. Maps are saved and transferred to the iQue during the next HotSync operation. iQue users may also transfer tracks from the iQue to MapSource via a HotSync operation.
  • To a Secure Digital (SD) Card or to a Garmin cf Que in a Pocket PC, or to the unit's internal memory. You can transfer maps, waypoints, and tracks; route transfer is not supported at this time.

CREATING DEMO APPLICATION MapServer WebGIS - PostGIS

CREATING DEMO APPLICATION MapServer WebGIS - PostGIS
We will modify the demo / sample GIS Web application that you created above, into MapServer WebGIS applications that retrieve data from the geometry and attribute PostgreSQL server that already supports PostGIS. The application also can be downloaded at: http://www.hatma.info/download/gis/Demo_MapServer_PostGIS.zip. After downloading is complete, extract its contents into the appropriate directory, ie: apps, http.d and Apache / htdocs. Then load sql data into your PostgreSQL database. Then restart your Apache by executing apache-restart.bat. open http://localhost in a web browser, then click the demo link on the "Hatma Suryotrisongko Web GIS Demo - PostGIS Spatial Database URLs: ": http://localhost/demo2/demo.phtml Link URL demo second program, on the main page MODIFY FILE CONFIGURATION first (CHAMELEON.MAP) FROM SAMPLE / DEMO APPLICATION ABOVE, BECOME THE APPLICATION WebGIS TAKE DATA FROM THE SERVER PostgreSQL database. We'll change the line calling the data layer definition shp on line, so that direct data retrieval from the database. In general, we will change the way as follows: Step I. comment mark (#) on line data definitions # DATA (data file shp) Step II. Insert definition of data retrieval from the database CONNECTIONTYPE PostGIS CONNECTION "user = [user name] dbname = [database name] host = [host database] port = [port database : 5432] password = [password] " DATA "[geometry column name] FROM [table name] USING UNIQUE [unique index / primary key]" FILTER "[condition / requirements]" www.hatma.info 1 WebgGIS with MapServer - MapLab - Chameleon - PostGIS Please note that the writing column names, table names MUST use lowercase letters, while others use a capital letter (see the section "DATA" and "Filter" above), but it must also comply with the writing command understood by the postgresql database (on the DATA definition does not use the syntax SELECT, FILTER is the definition does not use the WHERE syntax.) "USING UNIQUE [unique index / primary key] "in the definition line DATA is used for speed up queries using indexes. Step III. Adjust another definition line LabelItem "name" CLASSITEM "capital" CLASS EXPRESSION "1" TEMPLATE "ttt_query.html" SYMBOL 2 SIZE 8 NAME "Cities" COLOR 0 0 0 END Please note that the writing of the name attribute on LABELITEM data column, CLASSITEM, and others must use lowercase letters. So also with the contents of EXPRESSION definition, must be in accordance with written instructions understood by postgresql database. So the following changes in the configuration file first (. Map) Layer land_fn # DATA land_fn CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tland_fn USING UNIQUE gid" Layer park # DATA park CONNECTIONTYPE PostGIS www.hatma.info 2 WebgGIS with MapServer - MapLab - Chameleon - PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tpark USING UNIQUE gid" Layer drain_fn # DATA drain_fn CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tdrain_fn USING UNIQUE gid" FILTER "poly_featu = 16 OR poly_featu = 21" CLASSITEM "poly_featu" Drainage layer # DATA drainage CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tdrainage USING UNIQUE gid" FILTER "poly_featu = 0" CLASSITEM "poly_featu" Layer prov_bound # DATA province CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tprovince USING UNIQUE gid" Layer fedlimit # DATA fedlimit CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tfedlimit USING UNIQUE gid" Layer rail # DATA rail CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM trail USING UNIQUE gid" Layer Road # DATA road CONNECTIONTYPE PostGIS www.hatma.info 3 WebgGIS with MapServer - MapLab - Chameleon - PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM troad USING UNIQUE gid" Layer popplace # DATA popplace CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tpopplace USING UNIQUE gid" FILTER "capital> = 1 AND capital <= 3" LabelItem "name" CLASSITEM "capital" Layer "grid" # DATA "grid" CONNECTIONTYPE PostGIS CONNECTION "user = hatma_s dbname = dbspatialdemo host = localhost port = 5432 password = 2006bedogtelu" DATA "the_geom FROM tgrid USING UNIQUE gid" Some changes to the file chameleon.php Once completed the configuration file was changed, then we test whether the application is already we create can run well, and whether the data are shown together with the data are shown in the demo application that is still taking data from the shp file. www.hatma.info 4 WebgGIS with MapServer - MapLab - Chameleon - PostGIS Display program to retrieve data from database

DATA CONVERSION INTO SHP PostGIS FOR USE IN

DATA CONVERSION INTO SHP PostGIS FOR USE IN APPLICATION SAMPLE / DEMO WebGIS



6. Observe the sql file, whose contents would make the table and its content in accordance with shp files.     example sql file content (road.sql): BEGIN; CREATE TABLE "troad" (gid serial PRIMARY KEY, "Fnode_" int8, "Tnode_" int8, "Lpoly_" int8, "Rpoly_" int8, "Length" float8, "Road_" int8, "Road_id" int8, "F_code" int2, "Name_e" varchar (26), "Name_f" varchar (26)); SELECT AddGeometryColumn troad ('',' ',' the_geom ',' -1 ',' MULTILINESTRING ', 2); INSERT INTO "troad" ("fnode_", "tnode_", "lpoly_", "rpoly_", "length", "road_", "road_id", "f_code", "name_e", "name_f", the_geom) VALUES ('65 ', '70', '3 ', '3', '31779 .260 ', '1', '1 ', '74', NULL, NULL, '01050000000100000001020000000400000000000000164F414100000060EB773 341000000A0EC494141000000808A71334100000080DF2B414100000080CE3E334100000000C41F414100000000E0273341 '); ... ... ... ... ... ... ... ... ... .... 7. load all these sql files into a PostgreSQL database by executing command with the format "psql-d [target_database]-f [file_sql]" in the SQL terminal monitor o psql-d-f dbspatialdemo road.sql o psql-d-f dbspatialdemo rail.sql o psql-d-f dbspatialdemo province.sql o psql-d-f dbspatialdemo popplace.sql o psql-d-f dbspatialdemo park.sql o psql-d-f dbspatialdemo land_fn.sql o psql-d-f dbspatialdemo grid.sql o psql-d-f dbspatialdemo fedlimit.sql o psql-d-f dbspatialdemo drainage.sql o psql-d-f dbspatialdemo drain_fn.sql Observe the results. • The column of type POINT geometry contained in the table: tpopplace • Column type MULTILINESTRING geometry contained in the table: troad; trail; tgrid; tfedlimit www.hatma.info 4 WebgGIS with MapServer - MapLab - Chameleon - PostGIS • Column type MULTIPOLYGON geometry contained in the table: tprovince; tpark; tland_fn; tdrainage; tdrain_fn 8. Create a GIST index on each column of type geometry at each table. Then do a vacuum analyze, to update the statistical geometry (do Vacuum regularly, especially when there are changes in spatial data) o CREATE INDEX troad_gist_index troad ON USING GIST (the_geom GIST_GEOMETRY_OPS ); VACUUM Analyze troad (the_geom); o CREATE INDEX trail trail_gist_index ON USING GIST (the_geom GIST_GEOMETRY_OPS); Analyze VACUUM trail (the_geom); o CREATE INDEX tprovince_gist_index tprovince ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tprovince (the_geom); o CREATE INDEX tpopplace_gist_index tpopplace ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tpopplace (the_geom); o CREATE INDEX tpark_gist_index tpark ON USING GIST (the_geom GIST_GEOMETRY_OPS ); VACUUM Analyze tpark (the_geom); o CREATE INDEX tland_fn_gist_index tland_fn ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tland_fn (the_geom); o CREATE INDEX tgrid_gist_index tgrid ON USING GIST (the_geom GIST_GEOMETRY_OPS ); VACUUM Analyze tgrid (the_geom); o CREATE INDEX tfedlimit_gist_index tfedlimit ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tfedlimit (the_geom); o CREATE INDEX tdrainage_gist_index tdrainage ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tdrainage (the_geom); o CREATE INDEX tdrain_fn_gist_index tdrain_fn ON USING GIST (the_geom GIST_GEOMETRY_OPS); VACUUM Analyze tdrain_fn (the_geom); 9. Gid Create an index on each table. Due to speed up the query, then required a unique column in a table geometry, with the index that has been defined him: o CREATE INDEX ON troad_gid troad (gid); o CREATE INDEX ON trail_gid trail (gid); o CREATE INDEX ON tprovince_gid tprovince (gid); o CREATE INDEX ON tpopplace_gid tpopplace (gid); o CREATE INDEX ON tpark_gid tpark (gid); o CREATE INDEX ON tland_fn_gid tland_fn (gid); www.hatma.info 5 WebgGIS with MapServer - MapLab - Chameleon - PostGIS o CREATE INDEX ON tgrid_gid tgrid (gid); o CREATE INDEX ON tfedlimit_gid tfedlimit (gid); o CREATE INDEX ON tdrainage_gid tdrainage (gid); o CREATE INDEX ON tdrain_fn_gid tdrain_fn (gid); 10. See in pgAdmin, whether ten table and its contents have been entered in the database. If true, then you have successfully entered shp data into a table in the database.
STEP I. CREATING A DATABASE Spatial 1. PgAdmin Run, and then create a new user    WebgGIS with MapServer - MapLab - Chameleon - PostGIS    Then enter the new user data 2. Create a new database, using template_postgis     WebgGIS with MapServer - MapLab - Chameleon - PostGIS 3. Enter the database details 4. Copy the shp files are used in the sample application demo WebGIS above, from     folder D: \ ms4w \ apps \ demo \ samples \ data into the bin directory on the server installation     PostgreSQL (C: \ Program Files \ PostgreSQL \ 8.2 \ bin). 5. Then run "psql" SQL terminal monitor, and do the conversion of all files     shp above into the form *. sql. Thus obtained ten sql file. o shp2pgsql road troad> road.sql o shp2pgsql rail trail> rail.sql o shp2pgsql province tprovince> province.sql o shp2pgsql popplace tpopplace> popplace.sql o shp2pgsql park tpark> park.sql o shp2pgsql land_fn tland_fn> land_fn.sql o shp2pgsql grid tgrid> grid.sql o shp2pgsql fedlimit tfedlimit> fedlimit.sql o shp2pgsql drainage tdrainage> drainage.sql o shp2pgsql drain_fn tdrain_fn> drain_fn.sql WebgGIS with MapServer - MapLab - Chameleon - PostGIS
In the above discussion we have had some shp data used in sample / demo WebGIS, among others: o raster image: bathymetry layer (bath_mapserver.tif) o polygon: land_fn layer (land_fn.shp); layer park (park.shp); layer drain_fn (Drain_fn.shp); drainage layer (drainage.shp) o line: layer prov_bound (province.shp); layer fedlimit (fedlimit.shp); layer rail (rail.shp); Layer Road (road.shp); o point: layer popplace (popplace.shp); o grid: grid layer (grid.shp) Next we will change the above shp data into a table in the database PostgreSQL.

OVERVIEW OF INSTALLATION PostgreSQL and PostGIS in map server

OVERVIEW OF INSTALLATION PostgreSQL and PostGIS



MAINTAINING CONSISTENCY IN COLUMN SPATIAL DATA Make sure we meet the geometry column OpenGIS standard specification. One of them with the function IsValid (). For example: select IsValid ('LINESTRING (0 0, 1 1)'), IsValid ('LINESTRING (0 0.0 0)'); IsValid | IsValid ---------+--------- t | f There are ways to make us keep the data in order to remain compliant, ie by creating a check constraint. For example: ALTER TABLE mytable ADD CONSTRAINT CHECK geometry_valid_check (IsValid (the_geom)); check constraint will also be created automatically if you add a column geometric with AddGeometryColumn command (). LOADING spatial data There are several methods we can use. The first way is to use insert query command as usual. Suppose we create a file (roads.sql) containing: www.hatma.info 2 WebgGIS with MapServer - MapLab - Chameleon - PostGIS BEGIN; INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES (1, GeomFromText ('LINESTRING (243,118.191108 191 232 243 242)', -1), 'Jeff Rd'); INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES (2, GeomFromText ('LINESTRING (244,158.189265 189 141 244 817)', -1), 'Geordie Rd'); INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES (3, GeomFromText ('LINESTRING (228,138.192612 192 783 229 814)', -1), 'St. Paul'); INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES (4, GeomFromText ('LINESTRING (252,431.189631 189 412 259 122)', -1), 'Graeme Ave'); INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES- (5, GeomFromText ('LINESTRING (224,148.190871 190 131 228 134)', -1), 'Phil TCE'); INSERT INTO ROADS_GEOM (ID, Genome, NAME) VALUES- (6, GeomFromText ('LINESTRING (263,418.198213 198 231 268 322)', -1), 'Dave Cres'); COMMIT; Then execute the command on the "psql" SQL terminal monitor: psql-d [database]-f roads.sql USING SHP2PGSQL If we already have a shp file that contains our spatial data, easier using data shp2pgsql loader that will convert ESRI shp file into SQL. Shp2pgsql can we run on the "psql" SQL terminal monitor. For example: shp2pgsql shaperoads myschema.roadstable> roads.sql psql-d-f roadsdb roads.sql Or: shp2pgsql shaperoads myschema.roadstable | psql-d roadsdb Showing SPATIAL DATA To display the spatial data, we use the SELECT command. For example: SELECT id, AsText (Genome) U.S. Genome, name FROM ROADS_GEOM; We can use several operators in our query: www.hatma.info 3 WebgGIS with MapServer - MapLab - Chameleon - PostGIS o & & Say whether the outer boundary geometry of an object intersects / intersect with the boundary outer geometry of other objects. o ~ = Test whether the 2 pieces of geometry is identical. For example, if 'POLYGON ((0 0.1 1.1 0.0 0)) 'synonymous with' Polygon ((0 0.1 1.1 0.0 0)) '(yes). o = Test whether the outer limits of 2 pieces of geometry is identical Example: SELECT ID, NAME FROM ROADS_GEOM Genome WHERE ~ = GeomFromText ('LINESTRING (243,118.191108 191 232 243 242)', -1); SELECT ID, NAME FROM ROADS_GEOM WHERE GeomFromText Genome & & ('POLYGON ((191232 243117.191232 243119.191234 - 243,117.191232 243 117 ))',- 1); USING PGSQL2SHP We can use pgsql2shp to convert a table (or a particular spatial data on our database) into the ESRI file formats. shp pgsql2shp [<options>] <database> [<schema>.] <table> pgsql2shp [<options>] <database> <query> INDEX MAKE Spatial Index is used to speed data search. Using PostGIS GiST (Generalized Search Trees) indexes. CREATE INDEX [indexname] ON [tablename] USING GIST ([geometryfield] GIST_GEOMETRY_OPS); Table with 1 million barisdata, at 300MHz Solaris machine, requires computing waktgu 1 hr. www.hatma.info 4 WebgGIS with MapServer - MapLab - Chameleon - PostGIS Then execute the command to create / update the statistical geometry very importantly, to optimize query execution by the database. Analyze VACUUM [table_name] ([column_name]); Vacuum Database Should be done regularly, as in most PostgreSQL DBA with a cron job to do VACUUM periodically, to keep the index can function well in accelerating the query. Complex queries We can use the functions of geometry in our query command. Suppose function distance () is used to measure the distance between 2 pieces of geometry objects. SELECT the_geom FROM geom_table WHERE distance (the_geom, GeomFromText ('POINT (100 000 200 000)', -1)) <100 We can use the function expand () to find objects within a radius geometry of an object: SELECT * FROM GEOTABLE WHERE GEOCOLUMN & & Expand (GeomFromText ('POINT (1000 1000)', -1), 100) AND Distance (GeomFromText ('POINT (1000 1000)', -1), GEOCOLUMN) <100; Spatial functions can be seen in the manual / PostGIS reference. EXAMPLE IMPLEMENTATION Spatial SQL Create a table and its contents with the following command. CREATE TABLE bc_roads ( gid INTEGER PRIMARY KEY, name VARCHAR ) SELECT AddGeometryColumn ('public', 'bc_roads', 'the_geom', -1, 'LINESTRING', 2); www.hatma.info 5 WebgGIS with MapServer - MapLab - Chameleon - PostGIS insert into bc_roads values ​​(1, 'FIRST STREET', GeomFromText ('LINESTRING (1 1, 3 2, 4 3)')); insert into bc_roads values ​​(2, 'SECOND STREET', GeomFromText ('LINESTRING (2 4, 4 0)')); CREATE TABLE bc_municipality ( gid INTEGER PRIMARY KEY, code INTEGER UNIQUE, name VARCHAR ) SELECT AddGeometryColumn ('public', 'bc_municipality', 'the_geom', -1, 'MULTIPOLYGON', 2); insert into bc_municipality values ​​(1, 101, 'AREA FIRST', GeomFromText ('MULTIPOLYGON (((1 1, 5 1, 5 5, 1 5, 1 1 )))')); insert into bc_municipality values ​​(2, 102, 'SECOND AREA', GeomFromText ('MULTIPOLYGON (((4 4, 6 4, 6 6, 4 6, 4 4 )))')); insert into bc_municipality values ​​(3, 103, 'AREA THIRD', GeomFromText ('MULTIPOLYGON (((2 2, 4 2, 4 4, 2 4, 2 2 )))')); insert into bc_municipality values ​​(4, 104, 'AREA FOURTH', GeomFromText ('MULTIPOLYGON (( (2 2, 4 2, 4 4, 2 4, 2 2), (3 3, 4 3, 4 4, 3 4, 3 3))) ')); SIMPLE EXAMPLE OF THE PROBLEM 1. Seeking a total length of roads (in kilometers)? SELECT sum (length (the_geom)) / 1000 U.S. PANJANG_JALAN FROM bc_roads; 2. The location of the intersection of all roads with points (1 1) SELECT ASTEXT (intersection (the_geom, GeomFromText ('POINT (1 1)'))) FROM bc_roads; 3. Area Cities named 'AREA FIRST' (in hectares) SELECT area (the_geom) / 10 000 AS LUAS_HEKTAR FROM bc_municipality WHERE name = 'AREA FIRST'; 4. What is the biggest city? SELECT name, area (the_geom) / 10 000 AS LUAS_HEKTAR FROM bc_municipality LIMIT 1; www.hatma.info 6 WebgGIS with MapServer - MapLab - Chameleon - PostGIS Or SELECT max (area (the_geom) / 10000) U.S. LUAS_HEKTAR FROM bc_municipality; 5. How long is the road in each city? M.name SELECT, SUM (LENGTH (r.the_geom)) / 1000 U.S. KM_JALAN FROM bc_roads r, m bc_municipality WHERE Contains (m.the_geom, r.the_geom) AND m.the_geom & & r.the_geom GROUP BY m.name; 6. Create a new table with the contents: all roads in the city 'AREA FIRST' with additional column length was in all the cities, and the point of intersection with the city AREA FIRST. CREATE TABLE AS pg_roads SELECT r. *, ASTEXT (Intersection (r.the_geom, m.the_geom)) AS "Intersect IN:", LENGTH (r.the_geom) / 1000 AS "ORIGINAL LONG ROAD (KM)" FROM bc_roads r, m bc_municipality WHERE r.the_geom & & m.the_geom AND contains (m.the_geom, r.the_geom) AND m.name = 'AREA FIRST'; 7. How many kilometers long road "ONE WAY" in town "FIRST AREA"? SELECT SUM (LENGTH (r.the_geom)) / 1000 AS "KM length =" FROM bc_roads r, m bc_municipality WHERE m.name = 'AREA FIRST' AND r.name = 'ONE WAY' AND m.the_geom & & r.the_geom 8. Find the largest city that has a hole SELECT gid, area (the_geom) / 1000 AS 'AREA OF THE CITY " FROM bc_municipality WHERE nrings (the_geom)> 1 ORDER BY "CITY AREA" DESC LIMIT 1
SPATIAL OBJECT PostGIS supports all spatial objects be specified by the OpenGIS Consortium (Http://www.opengis.org) on ​​the document for the Simple Features Specification for SQL (Http://www.opengis.org/techno/specs/99-049.pdf). PostGIS also develop capability with 3DZ, 3DM and 4D coordinates. WKB and time-out OpenGIS standard way to specify ada2 mengexpresikan spatial objects: the format Well-Known Text (timeout) and the Well-Known Binary (WKB). Examples of time-out: 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))) WebgGIS with MapServer - MapLab - Chameleon - PostGIS Input data in the database typically uses time-out format as above. However, data spatial database is stored in hexadecimal format. We can manipulate the format Input / Output, as follows: bytea WKB = asBinary (geometry); text timeout = asText (geometry); geometry = GeomFromWKB (bytea WKB, SRID); geometry = GeometryFromText (text time-out, SRID); NB: SRID = spatial referencing system identifier. insert query example: INSERT INTO SPATIALTABLE (THE_GEOM, THE_NAME) VALUES (GeomFromText ('POINT (-126.4 45.32)', 312), 'A Place'); CREATING A SPATIAL DATABASE The easiest way is to use pgAdmin, which is already available on the shortcut Windows start menu, the folder PostgreSQL. After pgAdmin starts, select Edit menu
  
New Objects New Database. Enter the database template choices: template_postgis TABLES AND TABLE GEOMETRY_COLUMNS SPATIAL_REF_SYS We will look at our database there are some tables that have been made. One of them SPATIAL_REF_SYS and GEOMETRY_COLUMNS. Which is used to store meta information of spatial objects that we make. SELECT * FROM spatial_ref_sys; SELECT * FROM geometry_columns; CREATING A SPATIAL TABLE The first step is to make the database as usual. For example: CREATE TABLE ROADS_GEOM (ID int4, NAME varchar (25)) WebgGIS with MapServer - MapLab - Chameleon - PostGIS The second step is to add a spatial column with AddGeometryColumn function. With the format: "SELECT AddGeometryColumn (<table_name>, <column_name>, <srid>, <type>, <dimension>). " For example: SELECT AddGeometryColumn ('public', 'roads_geom', 'Genome', 423, 'LINESTRING', 2); SELECT AddGeometryColumn ('roads_geom', 'Genome', 423, 'LINESTRING', 2); If you do not want to bother with SRID (Spatial Reference ID), give the value of SRID = -1. For example: CREATE TABLE roads (ROAD_ID int4, ROAD_NAME varchar (128)); SELECT AddGeometryColumn ('roads', 'roads_geom', -1, 'Geometry', 3); Note that the OGC geometries do not allow the value of Z or M. So that part dimension we just give the value 2.
This section will review simply about PostGIS (spatial extension to PostgreSQL database). Database used: postgresql-8.2.3-1; on platform Windows INSTALLATION PostgreSQL - PostGIS There are various ways to build the PostgreSQL database that supports spatial data (PostGIS). But how easy it is to use the postgresql-8.2.msi (installer windows with full PostgreSQL features, including PostGIS) that can be downloaded at web site: http://www.postgresql.org. Then, do not forget to visit the site to PostGIS more complete information, including downloadable documentation / manual posGIS (http://www.postgis.org/)

HOW TO MAP SERVER INSTALLATION IN Chameleon

INSTALLATION MS4W, MAPLAB AND Chameleon MS4W
MS4W can be downloaded at www.maptools.org. In it are united application Apache Web Server, PHP, Map Server and the various libraries required to construct WebGIS system. There are two versions that can be downloaded MS4W, version 1.x and 2.x versions. But if we want to use Chameleon framework, more either select MS4W version 1.x (in use today is version 1.6) because the Chameleon not yet completely support PHP5 on version 2.x MS4W package. After you successfully download ms4w_1.6.zip, then extract the contents into root of the hard disk partition (eg C: / or D: /), so that the entire contents of the package is located in MS4W C: / ms4w or D: / ms4w. Then execute apache-install.bat to install service Apache. If the service is already running, it will show the process httpd.exe in window Windows Task Manager. Check by opening http://localhost in your web browser. If the front page MS4W appear, then your installation successfully. Front page ms4w PHP MapScript To enable the PHP / MapScript, we have made some changes on konfiurasi php.ini located in D: \ ms4w \ Apache \ cgi-bin \ php.ini. remove character ";" On "; extension = php_mapscript_4.10.0.dll". Then restart Apache with execute apache-restart.bat. WebgGIS with MapServer - MapLab - Chameleon - PostGIS To check the installation of MapScript, create a file in the folder msinfo.php D: \ ms4w \ Apache \ htdocs which contains: "<? Php echo ms_getVersion ();?>", Then open http://localhost/msinfo.php with a web browser. If the show version of MapServer report, then MapScript has been going well. Msinfo.php MapLab and Chameleon Download the package MapLab and Chameleon to MS4W on the website www.maptools.org. Then put the contents of chameleon_ms4w-2.4.1-20060906.zip and maplab_ms4w-2.2.1.zip to the directory http.d, apps, and apache / htdocs director ms4w you. Restart Apache, and consider whether to have seen the link url http://localhost MapLab Chameleon 2.2.1 and 2.4. If true, then the installation MapLab and Chameleon on MS4W has been successful. Maplab so flawlessly, it takes JRE (Java Runtime Environment) installed on your computer. Link URL Chameleon, on the main page Link URL MapLab, on the main page

MapServer WebGIS CREATING DEMO APPLICATION


MapServer WebGIS CREATING DEMO APPLICATION

For more convenience, we will use GIS-based Web application demo MapServer and Chameleon framework that can be downloaded at
title="http://www.hatma.info/download/gis/Demo_MapServer.zip .">http://www.hatma.info/download/gis/Demo_MapServer.zip.
After the download is complete, extract its contents into the appropriate directory, ie: apps, http.d and Apache / htdocs, the directory ms4w you. Then restart Apache by executing apache-restart.bat. Open http://localhost with a web browser, then click the demo link on the "Hatma Suryotrisongko Web GIS Demo URLs: "(http://localhost/demo/demo.phtml) Link URL demo program, on the main page Display Web GIS Demo www.hatma.info 1 WebgGIS with MapServer - MapLab - Chameleon - PostGIS
HTML FILE AND PHTML Two main file located in D: \ ms4w \ apps \ demo \ samples \ htdocs, namely: demo.html Contains templates for interface applications, with source code / standard HTML tags and program / tag Chameleon framework, characterized by the dean opened and closed tags <cwc2 ...> with </ cwc2> <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN"> <html> <head> <title> Web GIS Demo </ title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ............................... ff ................................... <script language="JavaScript" type="text/javascript"> ............................... ff ................................... //--> </ Script> href="sample.css" <link rel="stylesheet" type="text/css"> </ Head> <body onLoad="myOnLoad()"> <form method="post"> ............................... ff ................................... <div id="MainMapLayer" name="MainMapLayer"> <! - MapDHTML -> <Cwc2 type = "MapDHTML" visible = "true" width = "400" height = "300" allowresize = "true" marqueecolor = "FF3333" marqueewidth = "2" minscale = "1" bordercolor = "# 0000ff" borderwidth = "0 "/></ div> ............................... ff ................................... <! - That include the javascript code manages the DHTML layers -> src="sample.js" language="JavaScript" <script type="text/javascript"> </ script> </ Form> </ Body> </ Html> The contents of the file demo.html demo.phtml Contains the main class calls Chameleon, defines the template file and map file <? Php include ("../../ htdocs / chameleon.php "); www.hatma.info 2 WebgGIS with MapServer - MapLab - Chameleon - PostGIS $ SzTemplate = ". / Demo.html"; $ SzMapFile = ".. / map / chameleon.map"; SampleApp class extends Chameleon { SampleApp function () { parent:: Chameleon (); $ This-> moMapSession = new MapSession_RW; $ This-> moMapSession-> setTempDir (getSessionSavePath ()); } } $ OApp = new SampleApp (); $ OApp-> registerSkin ('skins / sample'); $ OApp-> CWCInitialize ($ szTemplate, $ szMapFile); $ OApp-> CWCExecute (); ?> The contents of the file demo.phtml
DATA SHP Spatial map data stored in ESRI shp format in the directory D: \ ms4w \ apps \ demo \ samples \ data. o raster image: bathymetry layer (bath_mapserver.tif) o polygon: land_fn layer (land_fn.shp); layer park (park.shp); layer drain_fn (Drain_fn.shp); drainage layer (drainage.shp) o line: layer prov_bound (province.shp); layer fedlimit (fedlimit.shp); layer rail (rail.shp); Layer Road (road.shp); o point: layer popplace (popplace.shp); o grid: grid layer (grid.shp)
CONFIGURATION FILE (CHAMELEON.MAP) The configuration file (*. map) is located in D: \ ms4w \ apps \ demo \ samples \ folder, (chameleon.map) which consists of several parts. Among others: • common definitions # # Start of map file # # Sample map file for a Chameleon app. www.hatma.info 3 WebgGIS with MapServer - MapLab - Chameleon - PostGIS # NAME DEMO STATUS ON SIZE 400 300 SYMBOLSET .. / etc / symbols.sym Extents -712 631 -2594561 3467361 3840000 Units Meters SHAPEPATH ".. / data" IMAGECOLOR 255 255 255 FONTSET .. / etc / fonts.txt TRANSPARENT FALSE • Web interface definition # # Start of web interface definition # WEB # MINSCALE 2000000 # MAXSCALE 50000000 # # On Windows systems, / tmp and / tmp / ms_tmp / Should Be created at the root # Of the drive Nowhere the. MAP file resides. # ImagePath "/ ms4w/tmp/ms_tmp /" ImageUrl "/ ms_tmp /" # LOG "/ tmp / gmap.log" Metadata END END • map reference # # Start of reference map # REFERENCE IMAGE images / keymap.gif Extents -712 631 -2594561 3467361 3840000 STATUS ON COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 SIZE 120 1990 END • scale # # Start of scalebar # www.hatma.info 4 WebgGIS with MapServer - MapLab - Chameleon - PostGIS SCALEBAR IMAGECOLOR 255 255 255 LABEL COLOR 0 0 0 SIZE SMALL END SIZE 150 5 COLOR 255 255 255 BACKGROUNDCOLOR 0 0 0 OUTLINECOLOR 0 0 0 Units kilometers Intervals 5 STATUS ON END • mechanism of cartography as a result of the query process QUERYMAP STYLE HILITE COLOR 255 0 0 END • map projection system Projection "Init = EPSG: 42304" END Layer Definitions: • bathymetry layer (bath_mapserver.tif), raster image Layer GROUP "Raster" NAME bathymetry Metadata "DESCRIPTION" "Elevation / bathymetry" "GROUP" "Raster" "Layer" "bathymetry" END TYPE raster STATUS ON DATA bath_mapserver.tif Projection "Init = EPSG: 42304" END END • Examples of polygon-type layer: layer land_fn (land_fn.shp) www.hatma.info 5 WebgGIS with MapServer - MapLab - Chameleon - PostGIS Layer GROUP "Polygon" NAME land_fn Metadata "DESCRIPTION" "Foreign Lands" "GROUP" "Polygon" "Layer" "land_fn" END TYPE polygon STATUS ON DATA land_fn CLASS NAME "Foreign Lands" COLOR 240 240 240 OUTLINECOLOR 199 199 199 END Projection "Init = EPSG: 42304" END END • Example of layer-type line: layer prov_bound (province.shp) Layer GROUP "Line" NAME prov_bound Metadata "DESCRIPTION" "Province" "GROUP" "Line" "Layer" "prov_bound" END LINE TYPE STATUS ON DATA province CLASS NAME "Province" COLOR 120 120 120 END Projection "Init = EPSG: 42304" END END • Example of layer-type point: layer popplace (popplace.shp) Layer GROUP "Point" NAME popplace Metadata "DESCRIPTION" "Cities" www.hatma.info 6 WebgGIS with MapServer - MapLab - Chameleon - PostGIS "RESULT_FIELDS" "NAME" "GROUP" "Point" "Layer" "popplace" END TYPE POINT STATUS ON DATA popplace LabelItem "Name" CLASSITEM "Capital" CLASS EXPRESSION "1" TEMPLATE "ttt_query.html" SYMBOL 2 SIZE 8 NAME "Cities" LABEL COLOR 255 0 0 FONT-italic fritqat TYPE truetype SIZE 8 AUTO POSITION PARTIALS FALSE OUTLINECOLOR 255 255 255 END COLOR 0 0 0 END CLASS EXPRESSION / 2 | 3 / TEMPLATE "ttt_query.html" 7 SYMBOL SIZE 6 NAME "Cities" LABEL COLOR 0 0 0 FONT fritqat TYPE truetype SIZE 8 AUTO POSITION PARTIALS FALSE OUTLINECOLOR 255 255 255 END COLOR 0 0 0 END Tolerance 5 Projection "Init = EPSG: 42304" END END www.hatma.info 7 WebgGIS with MapServer - MapLab - Chameleon - PostGIS • layer grid (grid.shp) Layer GROUP "Grid" NAME "grid" Metadata "DESCRIPTION" "Grid" "GROUP" "Grid" "Layer" "grid" END LINE TYPE STATUS OFF DATA "grid" CLASS NAME "Graticule" COLOR 0 0 0 END Projection title=""init=epsg:42304"">"Init = EPSG: 42304" END END More see the file chameleon.map on D: \ ms4w \ apps \ demo \ samples \ folder \ chameleon.map


CONFIGURATION FILE ADMINISTRATION USING MAPLAB In order to more easily and avoid writing the wrong configuration file, provided Web-based administration page that can be accessed by address http://localhost/maplab/. Although there are 3 main features (MapEdit, MapBrowser and GmapFactory), to create / change the map configuration file (*. map) we use MapEdit menu. Figure MapEdit start page www.hatma.info 8 WebgGIS with MapServer - MapLab - Chameleon - PostGIS MapEdit was opening a map from a sample configuration file above the web GIS The test configuration we have created, by clicking the preview button Preview chameleon.map configuration files on MapEdit

POSITION TRACKING SYSTEM USING GPS CAR VIA SMS


This system is used for
Track position and view tracking vehicles on a region map. System
designed is a software that can make requests to the position
particular vehicle and processing the response data into the vehicle's position in a
area map., as well as hardware which connect with a GPS receiver to
receive requests and respond position via SMS.


The materials needed to manufacture this tool are:
• GPS that has a serial port (1 fruit)
• AVR family microcontroller (1 fruit)
PCB Matrix (1 fruit)
ATMEGA 162 + socket 40-pin (1 pc)
Max RS 232 + IC socket 16 pin (1 pc)
IC AN 7805 (1 fruit)
TIP TR 3055 (1 fruit)
11.0529 MHz crystal / clock (1 fruit)
Capacitor: - 33 pF (2 pieces)
- 100 nF (2 pieces)
- 1 μF/50V (6 pieces)
- 10 μF/25V (1 fruit)
- 1000 μF/25V (2 pieces)



Resistor 560 (2 pieces)
Diode 1N4002 (10 pieces)
LPT1: - DB15 male (1 fruit)
- DB9 male (1 fruit)
- Cover DB9 (2 pieces)
Fuse + Holder (small) (1 fruit)
Green LED lights small (10 pieces)
8 Line Data cable (1 meters)
Phone Connector (1 piece)
Connector cable: - Fill 6 (1 fruit)
- Fill 8 (2 pieces)
- Fill 10 (2 pieces)
Push button (1 fruit)
• GSM Modem Sony Ericcson (1 fruit)
How it Works GPS Receiver Aircraft
GPS satellites are generally emit two kinds of micro wave signal
namely:
L1 1575.42 MHz with a frequency that carries the navigation message and code signals
SPS (Standard Positioning Service). L2 with a frequency of 1227.60 Mhz
used to measure the delay in the ionosphere layer using
receiver PPS (Precise Positioning Service). Three binary codes used for
phase shift the L1 and L2 signals transmitted by a GPS satellite. Third
kind of binary code that is as berkut:
1) modulation code C / A (Coarse Acquisition) in phase L1. Code C / A is
sent repeatedly every 1 MHz PRN (Pseudo Random Noise).
2) The code C / A PRN is different for each GPS satellite is
identification to the satellite.
3) modulation code C / A is used as the basis for the use of
GPS in civil society.
NMEA Output
Output from the GPS receiver has a certain structure
called NMEA output. Example output structure along the way
reading is as follows:
$ GPGGA Output:
$ GPGGA, 180432.00,4027.027912, N, 08704.857070, W, 2,07,1.0,212.15,
M, -33.81, M, 4.2,0555 * 73

Introduction to Global System for Mobile Phone Communication (GSM)
GSM (Global System for Mobile Communication) is a system
open telecommunications, there are no ownership (non-proprietary) that developed
rapidly and constantly. Its main advantages is its ability to
internasinal roaming. This provides a standard system with no limits
relationship in more than 159 countries. With GSM satellite roaming, services also
can reach remote areas. SMS was created as part of
GSM standard. All GSM network operators have the Message Centre, which
responsible for the operation or management of news
there.

GSM Modem (Sony Ericcson GT47)
Sony Ericsson GT47 is a dual band (EGSM 900/1800MHz) GSM / GPRS
serial modem with integrators an instant and cost-effective M2M, as a solution to
get a faster application. GT47 is a plug-and-play modem with
Integral SIM card reader and standard connector interfaces. By installing RS232
connector directly on the application or the computer, ready to be used as GM29
wireless modem. Modem can send and receive data by GPRS, HSCSD,

CSD, SMS and fax. GT47 has a feature to send and receive SMS
with text mode and PDU. Figure 6 shows the mechanical design module GT47
which tebuat of plastic.
Module

At Protocol Command to read the SMS with the text mode on the GT47
AT + CMGR = 2
+ CMGR: "RECUNREAD", "+6285645046302",, "06/06/19, 12:40:17
+28 ", 145,4,0,0," +62855000000 ", 145.11
mintaposisi
OK
�� GT47 supports the SMS service as below:
• Sending; MO (mobile-originated) with a PDU (protocol data units) and modes
text.
• Receiving; MT (mobile-terminated) with PDU and text mode.
• CBM (cell broadcast message) service in which a message is sent to
all subscribers are located in one or more specific cells in the GSM
Modem network (for example, traffic reports). This feature is network
dependent
• SMS STATUS REPORT according to GSM MODEM 03:40.
• SMS based on GSM MODEM COMMAND 03:40.
In addition �� GT47 also supports the following data:
• GT47 is the installation and activation of GPRS and GSM Modem. GT47
is a GPRS class 8 (4 +1). a Class B terminal, which provides
• GT47 capable of supporting a CSD communication at 9.6 kbps
• GT47 supports communications HSCSD class 2 (2 +1)

�� (Short Message Service)
Short Message Service is one of the company's service operator
GSM mobile phone. By these means the mobile phone can receive and
send short messages with the form of text with maximum length
as many as 160 characters for the Latin alphabet and 70 characters for non-Latin alphabet,
such as Arabic or Chinese alphabet. There is one thing that is very interesting from this service,
which offer relatively cheap rates for each time sending a message.


HARDWARE DESIGN subsystem (HARDWARE)
The hardware used in this system is the hardware
support the process of receiving SMS, sending SMS, SMS messages and processing
hardware is the source of GPS data. Tools required are:
- The aircraft GPS receiver as a source of position data.
- ATMEGA 162 Microcontroller with IC
- GSM device with a working mobile phone number
to receive and send SMS from PC to a GSM system hardware and
vice versa. In this last project used
Sony Ericsson GSM Modem GM29 type.
The device Computer with operation system (Windows XP Service Pack 1).


GPS PLANNING
GPS Output Data Format as many as five types of NMEA 0180, NMEA
0182, NMEA 0183, AVIATION, and plotting. The format of the data set
by the NMEA (National Maritime Electronics Association) and can be connected to
computer via serial communication port using RS-232 cable. Data
output used is NMEA 0183 data format in the form of a sentence (string)
which is an 8-bit ASCII character sets. Every sentence begins with a single
character '$', two characters Talker ID, three-character Sentence ID, and followed by data
fields, each separated by a comma and terminated by an optional cheksum
and character cariage return / line feed (CR / LF



MINIMUM DESIGN SYSTEM (MICRO CONTROLLER)
ATMEGA162 microcontroller is used which is
microcontroller with RISC architecture. The advantages of this microcontroller is
have an internal system memory 16 Kb Flash EEPROM, 35 bit Input / Output and
2 port serial communication. Minimum system microcontroller to function as a medium
interface and processing of data between GPS, GSM Modem and unit Input / Output.
The circuit is equipped with an ISP that works for Flash Programming
write the desired program to the microcontroller. Minimum circuit system
microcontroller.

POWER SUPPLY PLANNING
This device must remain in operation (not dead), so that the required resources
energy taken from the car battery. To adjust the car battery voltage
at 12 V with a voltage microcontroller, GPS and GSM Modem that is equal to
5 V, it takes a power supply. Circuit power supply.


PLANNING RS 232
RS-232 voltage levels from the GPS or GSM modem to be converted into
minimum TTL voltage levels on the system microcontroller, and therefore used
serial communication circuit:




PLANNING SMS
For media use GSM modem for data communications, with consideration
easily in serial connection with the SMS Gateway and microcontroller. GSM
Modem using a serial communications port for communication with
microcontroller. SMS format.


PLANNING PROGRAM The program contained in the SMS Gateway is: 1. Courses in module As String Public KirimPesan Public Connection As New ADODB.Connection As New ADODB.Recordset Public simpanSQL As New ADODB.Recordset Public LihatSQL As New ADODB.Recordset Public HapusSQL As New ADODB.Recordset Public SQL1 As New ADODB.Recordset Public SQL2 As New ADODB.Recordset Public SQL3 2. Program on forms Below are some parts of the program on forms SMS Gateway by using Visual Basic 6.0 • Function SetModeText () Dim a As Double As String Dim BUFFER MSComm1.Output = "AT + CMGF = 1" & vbCrLf a = Timer While Timer - a <2 BUFFER = BUFFER + MSComm1.Input DoEvents Wend If InStr (BUFFER, "OK") Then Shape1.FillColor = vbGreen 'MsgBox "GSM Modem ins Text Mode " Label8.Caption = "GSM Modem In Text Mode" End If End Function • Function cek_update () If count = Int (Text4.Text) Then check = False Else check = True count = Int (Text4.Text) End If End Function • Function kirim_posisi_db () BukaKoneksi Set SQL1 = Koneksi.Execute ("insert into position values ('""','" & Text7.Text & "','" & Text6.Text & "','" & Text3.Text & "')") TutupKoneksi End Function • Function terima1 () ReadyGSMModem1 time End Function • Function DELETE_SMS () Dim a As Double As String Dim BUFFER MSComm1.Output = "AT + CMGD = 1" & vbCr a = Timer While Timer - a <1 BUFFER = BUFFER + MSComm1.Input DoEvents Wend If InStr (BUFFER, "OK") Then Shape2.BackColor = vbYellow 'MsgBox "DELETE" Label9.Caption = "New SMS Deleted" End If 3.3.3. Programme - Main program The programs will be made on the microcontroller using CodeVisionAVR the basic application programs such as programming language C programming Program listing as follows. 1. Program to check the GPS {GPS = 0; while (getchar1 ()!='$'); if (getchar1 ()==' G ') if (getchar1 ()==' P ') if (getchar1 ()==' G ') if (getchar1 ()==' G ') if (getchar1 ()==' A ') { getchar1 (); while (getchar1 ()!=','); A1 = getchar1 (); A2 = getchar1 (); A3 = getchar1 (); A4 = getchar1 (); getchar1 ();//. A5 = getchar1 (); A6 = getchar1 (); A7 = getchar1 (); A8 = getchar1 (); getchar1 ();//, getchar1 (); / / N getchar1 (); / /, B1 = getchar1 (); B2 = getchar1 (); B3 = getchar1 (); B4 = getchar1 (); B5 = getchar1 (); getchar1 (); / /. B6 = getchar1 (); B7 = getchar1 (); B8 = getchar1 (); B9 = getchar1 (); detect_lcd { lcd_gotoxy (0.0); lcd_putsf ("Lint ");// lcd_gotoxy (6.0); lcd_putchar ('-'); lcd_putchar (A1); lcd_putchar (A2); lcd_putchar ('.'); lcd_putchar (A3); lcd_putchar (A4); lcd_putchar (A5); lcd_putchar (A6); lcd_putchar (A7); lcd_putchar (A8); delay_ms (1000); lcd_gotoxy (0.0); lcd_putsf ("Bujr ");// lcd_gotoxy (6.1); lcd_putchar (B1); lcd_putchar (B2); lcd_putchar (B3); lcd_putchar ('.'); lcd_putchar (B4); lcd_putchar (B5); lcd_putchar (B6); lcd_putchar (B7); lcd_putchar (B8); lcd_putchar (B9); delay_ms (1000); } GPS = 1; } } 2. Program to check the GSM { printf ("at"); putchar (13); while (getchar ()!=' O ') {printf ("at"); enter;}; } 3. Program to check SMS {Unsigned char dat, x_psn, cnt_psn; ready_gsm (); / / be sure That GSM is ready read_sms = 0; printf ("at + cmgr = 1"); enter; dat = getchar (); while (dat! ='+'){ printf ("at + cmgr = 1"); enter; dat = getchar ();} ; if (getchar ()!=' R ') / / + CMGR: "REC READ", "+6285645046302", / / ERROR {While (getchar ()!=' 8');// 8 as the header identification number of of GSM for (i = 0; i <= 9; i + +) rx_no [i] = getchar (); / / Insert no while (getchar ()! = 13); / / 13 as tail of SMS coding char getchar ();// 10 if (getchar ()==' X ') / / X as the header of the SMS for (i = 0, cnt_psn = 1; i <cnt_psn; i + +) {X_psn = getchar (); / / enter x_psn if (x_psn! = 13) {Rx_psn [i] = x_psn; cnt_psn = cnt_psn +1;} / / Insert msg else break; } delete (); / / DELETE SMS if (cnt_psn == 7) compare_sms (); / / compare SMS with reference data else {detect_lcd {lcd_clear (); lcd_putsf ("New SMS Invalid "); delay_ms (500);}} for (i = 0; i <10; i + +) {rx_no [i] = 0;} / / CLEAR NO for (i = 0; i <= 5; i + +) {rx_psn [i] = 0;} / / CLEAR PSN } else Detect_lcd {{lcd_clear (); lcd_putsf ("New SMS = No .!");}} detect_lcd delay_ms (1000); read_sms = 1; } 4. Program to compare SMS {Detect_lcd {Lcd_clear (); lcd_putsf ("08"); for (i = 0; i <10; i + +) / / VIEW / print no & msg {Lcd_putchar (rx_no [i]);} delay_ms (1000); lcd_clear (); for (i = 0; i <6; i + +) / / VIEW / print no & msg {Lcd_putchar (rx_psn [i]);} } for (i = 0; i <11; i + +) / / check no { result = rx_no [i]-no [i]; if (i == 10 & & result == 0) { flag_no = 1; detect_lcd {lcd_gotoxy (12.0); lcd_putsf ("same ");}} if (hasil! = 0) Detect_lcd {{lcd_gotoxy (12.0); lcd_putsf ("| =");} break;} } if (flag_no) / / Command bellows will from be accesed if SMS from number ................ {Xpsn = 0; for (i = 0; i <= 5; i + +) {Result = rx_psn [i], msg [i]; if (i == 5 & & result == 0) {send_pss (); detect_lcd {lcd_gotoxy (6.1); lcd_putsf ("p1");}} if (hasil! = 0) break; } result = 0; } flag_no = 0; } 5. Program to delete SMS { printf ("at + cmgd = 1"); enter; while (getchar ()!=' O ') {printf ("at + cmgd = 1"); enter;}; } send_pss void () {Send_sms = 0; printf ("at + cmgs1 ="); putchar (34); printf ("085645046302"); putchar (34); putchar (13); while (getchar ()!='>'); printf ("-% c% c% c% c% c% c% c% c", A1, A2, A3, A4, A5, A6, A7, A8); / / enter; printf ("% c% c% c% c% c% c% c% c% c", B1, B2, B3, B4, B5, B6, B7, B8, B9); putchar (26); send_sms = 1; } Examples