Tuesday, November 25, 2014

Solution: IntelliJ not recognizing a particular file correctly, instead its stuck as a text file

4 Comments
I had mistakenly save my class as fileName.text file and tried to rename it with fileName .java but the IntelliJ couldn't recognize it and throws the error saying..
After spending long hours on internet, I found a solution and sharing/keeping here for future reference.

Step 1: Click "File"==> "Settings"
Step 2: Expand "Editor" & Click "File Types"
Step 3: You will see all file types on Right. Navigate to the "Text Files" and Click it
Step 4: You should able to see your file name on the bottom of Registered Patterns (lower box)
Step 5: Remove your file from the Registered Patterns. The problem should solved and let you to rename with fileName.java
Step 6: If not, delete the file from the project and create it again with name fileName



Get PDF fonts information line by line using PDFBox API

2 Comments
Sample code snippet on extracting font information line by line using PDFBox API in JAVA.

 public String[] getFontLineByLineFromPdf(String fileName)throws IOException  
   {  
     PDDocument doc= PDDocument.load(fileName);  
     PDFTextStripper stripper = new PDFTextStripper() {  
       String prevBaseFont = "";  
       protected void writeString(String text, List<TextPosition> textPositions) throws IOException  
       {  
         StringBuilder builder = new StringBuilder();  
         for (TextPosition position : textPositions)  
         {  
           String baseFont = position.getFont().getBaseFont();  
           if (baseFont != null && !baseFont.equals(prevBaseFont))  
           {  
             builder.append('[').append(baseFont).append(']');  
             prevBaseFont = baseFont;  
           }  
           builder.append(position.getCharacter());  
         }  
         writeString(builder.toString());  
       }  
     };  
     String content=stripper.getText(doc);  
     doc.close();  
     String pdfLinesWithFont[]= content.split("\\r?\\n");  
     return pdfLinesWithFont;  
   }  

Monday, November 17, 2014

Call for Proposals, Presentations and Workshops: Free and Open Source Software for Geospatial 2015, Burlington, CA

Be The First To Comment
FOSS4G North America will be hosted from March 9th to 12th, 2015 at the Hyatt Regency in Burlingame, California. This gorgeous venue is close to the San Francisco Airport and offers many quiet places to sit down and talk with friends and colleagues in addition to the great session rooms.
The deadline for the call for papers is today, Monday, November 17th.

Submit a presentation or workshop now.
Accepted speakers receive a free full access pass to the entire conference!

See which talks are already accepted.
FOSS4G NA 2015 is co-hosted with EclipseCon, and a PostgreSQL event.

Attend any talk or workshop for one low price.
FOSS4G North America is a collaborative event by OSGeo & LocationTech, organized by the Eclipse Foundation.

Register before December 31, 2014 and save!



Friday, November 7, 2014

Tips to share a leaflet map with multiple ROIs

Be The First To Comment
Do you have a Leaflet map? Yes. Can you panned and and zoomed to a particular event or ROI in the map? Yes. Then, how can you share that map zoomed or centered with ROI/events to your webpage or email as a link? One of the answers may be set the zoom level and set view near the ROI.  Alright, what will you do if you have a map with multiple ROI/events? Do you make multiple maps with multiple zoom level and view? You can, but probably not a good idea to do that. 

The solution comes here, leaflet-hash.js, solves your needs, it is a JavaScript library written by Michael Lawrence Evans, which appends the URL hashes to web pages automatically and the hash changes with Leaflet map on drag or zoom. The hash consists of map zoom level and latitude/longitude of the center of map viewport, everything you need to share the map with focused ROI as link in following simple steps:

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me