Directions Magazine
Hello. Login | Register

Articles

All Articles | Post Comment

MapInfo Wishlist Response #1

Bookmark and Share
Monday, July 26th 1999
Comments
Read More About: real estate
Classified Ads:

Summary:

MapInfo’s Andrew Dressel responds to reader’s wishes for MapInfo Professional.

I hadn't been keeping up with my reading at Directions Mag when one of our favorite customers, Steve Wallace at the Florida Farm Bureau, sent me a message that mentioned the wish list.When I checked it out, you might imagine my surprise to see 145 wishes for MapInfo Professional. (It turns out that most come directly from the popular MapInfo-L wish list.)

I started wading through them and saw right away that some could be addressed immediately.In fact, I had already been working on one due to a question raised in a user group meeting I attended recently: rotating symbols.

So, here is a tool, written in MapBasic, that MapInfo Professional users can install to handle items #1 and #5 based on popularity as of July 26, 1999.

Item # 1 (12 votes)
Product: MapInfo Professional
Category: General
Date: 7/12/99
String Substitution.
Replace string "A" with string "B" when found in column "ColX" of a table or selection.
Author: MapInfo-L

This is really pretty easy and straight forward in MapBasic, and most of the code I wrote deals with the user interface.Once I have the name of the table, the name of the column, the 'replace' string, and the 'with' string in string variables, this is all I have to do:


  Fetch First From sTable
  Do While Not EOT(sTable)
    sText = aColumn
    i = InStr(1, sText, sReplace)
    If i > 0 Then
      iRowID = aRowID
      sText = Left$(sText, i-1) + sWith +
              Right$(sText, Len(sText)-Len(sReplace)-i+1)
      Update sTable Set sColumn = sText Where RowID = iRowID
    End If
    Fetch Next From sTable
  Loop

Item # 5 (7 votes)
Product: MapInfo Professional
Category: General
Date: 7/12/99
Symbol Rotation.
Symbols should be able to be rotated, and the rotation controlled by a pointer to some database column containing the rotation values.
Author: MapInfo-L

It is possible to rotate symbols individually through the user interface, and it is also quite easy to rotate a bunch of symbols based on a value in a database column with MapBasic, but it involves a few more variables: (in order of appearance)

sTable: string that contains the table name
oOld: object that contains the current geographic object
aObj: alias that refers to the geographic object column
iRowID: integer that contains the current row number
aRowID: alias that refers to the current row number
sOldSymbol: symbol that contains the existing symbol
iSymobl: integer that contains the number of the existing symbol
iColor: integer that contains the color of the existing symbol
iSize: integer that contains the size of the existing symbol
sFont: string that contains the font name of the existing symbol
iStyle: integer that contains the style of the existing symbol
aColumn: alias that refers to the column that contains the angle
oNew: object that contains the new, rotated symbol


  Fetch First From sTable
  Do While Not EOT(sTable)
    oOld = aObj
    iRowID = aRowID
    sOldSymbol = ObjectInfo(oOld , OBJ_INFO_SYMBOL)
    iSymbol = StyleAttr(sOldSymbol, SYMBOL_CODE)
    iColor = StyleAttr(sOldSymbol, SYMBOL_COLOR)
    iSize = StyleAttr(sOldSymbol, SYMBOL_POINTSIZE)
    sFont = StyleAttr(sOldSymbol, SYMBOL_FONT_NAME)
    iStyle = StyleAttr(sOldSymbol, SYMBOL_FONT_STYLE)
    Create Point Into Variable oNew (CentroidX(oOld ),
                                     CentroidY(oOld ))
      Symbol MakeFontSymbol(iSymbol, iColor, iSize, sFont,
                            iStyle, aColumn)
    Update sTable Set obj = oNew Where RowID = iRowID
    Fetch Next From sTable
  Loop

Three other capabilities I had already built into the tool to address user group feed back are:

3.Automatically pick the column that contains 'lat' or 'y' for the latitude column and pick the column that contains 'lon' or 'x' for the longitude column when creating point based on coordinates stored in columns.

4.Automatically populate two columns (create them if necessary) with coordinate values of object centroid.

5.Automatically convert a column to character and pad the values it contains with the correct number of leading zeros so that ZIPCodes look correct and match properly.

Here is the complete tool.I've compiled it with MapBasic version 4.1.2 so that anyone with MapInfo Professional 4.1.2 or greater can use it.

  • ColMan.zip

  • Bookmark and Share


    Stay Connected

    Twitter RSS Facebook LinkedIn Delicious Apple Devices Android Blackberry






    Recent Comments

    Journal News Removes Interactive Gun Permit Map

    The Lower Hudson Journal News has been under fire for publishing a map of gun permit holders in two counties in New York State  before Christma. (APB coverage 1, 2, podcast). On Friday January 18 the paper removed the interactive map. Why? Publisher Janet Hasson gave answers in a media statement and in a letter to readers.

    In a statement in response to The Poynter Institute (a journalism school) she argued:

    With the passage this week of the NYSAFE gun law, which allows permit holders to request their names and addresses be removed from the public record, we decided to remove the gun permit data from lohud.com at 5 pm today. While the new law does not require us to remove the data, we believe that doing so complies with its spirit. For the past four weeks, there has been vigorous debate over our publication of the permit data, which has been viewed nearly 1.2 million times by readers. One of our core missions as a newspaper is to empower our readers with as much information as possible on the critical issues they face, and guns have certainly become a top issue since the massacre in nearby Newtown, Conn. Sharing as much public information as possible provides our readers with the ability to contribute to the discussion, in any way they wish, on how to make their communities safer. We remain committed to our mission of providing the critical public service of championing free speech and open records.

    In a letter to readers published on Friday she wrote:

    So intense was the opposition to our publication of the names and addresses that legislation passed earlier this week in Albany included a provision allowing permit holders to request confidentiality and imposing a 120-day moratorium on the release of permit holder data.

    She goes on to say that during the 27 days the map was online any one interested would have seen it and that the data would eventually be out of date. She also noted that the paper does not endorse the way the state chose to limit availability of the data.

    The original map/article still includes a graphic - but it's a snapshot, a raster image, with no interactivity. Says Hasson in the letter to readers:

     And we will keep a snapshot of our map — with all its red dots — on our website to remind the community that guns are a fact of life we should never forget.

    I continue to applaud the paper for requesting the data via a Freedom on Informat request, mapping it, keeping the map up despite threats and criticism and now responding to state law. I think the paper did a service to the state, to citizens and to journalism.

    - via reader Jim and Poynter

    30-Second Pitch: Valarm
    What’s new with JavaScript and geospatial - wrapup from the js.geo event
    Privacy 2013 Style: Exploring New LBS Devices and Services
    Attention Shoppers! aisle411’s Indoor Location App is a Hit with Top Retailers
    US Topo - A New National Map Series, 2012 Update
    Recent Developments in Remote Sensing for Human Disaster Management and Mitigation - Spotlight on Africa: An Overview
    Drones: War machine today, helpful tool tomorrow - NPR Marketplace
    Everything You Need to Know about Landsat 8

    DirectionsMag.com

    About Us | Advertise | Contact Us | Web Terms & Conditions | Privacy Policy
    © 2013 Directions Media. All Rights Reserved